# HG changeset patch # User dellsystem # Date 1347401161 14400 # Node ID 17bc502c65a4286dfbf5455fa5e5d47b03e21463 # Parent 2602f54c018d815434106cc540563f5a13092eb8 Update "code" page Changed layout and added real data for the snippets list. diff -r 2602f54c018d -r 17bc502c65a4 static/css/mixins.less --- a/static/css/mixins.less Tue Sep 11 17:59:27 2012 -0400 +++ b/static/css/mixins.less Tue Sep 11 18:06:01 2012 -0400 @@ -71,7 +71,7 @@ } .pill { - .inline-block; + display: block; background: @lighterGrey; border: 1px solid lighten(@mediumGrey, 10%); .border-radius(3px); @@ -81,6 +81,8 @@ line-height: 1; text-shadow: 0 1px 0 @white; .box-shadow(inset 0 0 3px 0px @white); + margin-bottom: 10px; + .center-align; &:hover { color: @white; diff -r 2602f54c018d -r 17bc502c65a4 templates/code.djhtml --- a/templates/code.djhtml Tue Sep 11 17:59:27 2012 -0400 +++ b/templates/code.djhtml Tue Sep 11 18:06:01 2012 -0400 @@ -4,42 +4,82 @@

Browse code submissions

-Post a snippet -{% if user.is_authenticated %} -Upload a single -Upload a bundle -{% else %} -Login to upload singles/bundles +{% if not user.is_authenticated %} +

+ Welcome to Agora. +

{% endif %} -
-
-
-

Snippets

+

Snippets

+ + Post a snippet + + {% if snippets %} +

+ View more » +

+ {% else %} +

No one has yet created a snippet. + Be the first! +

+ {% endif %}

Modules

+ {% if user.is_authenticated %} + Upload a modules + {% else %} + + Login to upload modules + + {% endif %} + {% if modules %}
    -
  • test
  • -
  • test
  • -
  • test
  • -
  • test
  • + {% for module in modules %} +
  • {{ module }}
  • + {% endfor %}
+ {% else %} +

This feature is not yet available.

+ {% endif %}

Forge

+ {% if user.is_authenticated %} + Add a module to the forge + {% else %} + + Login to add a module to the forge + + {% endif %} + {% if forge %}
    -
  • test
  • -
  • test
  • -
  • test
  • -
  • test
  • + {% for forge_module in forge %} +
  • {{ forge_module }}
  • + {% endfor %}
+ {% else %} +

This feature is not yet available.

+ {% endif %}
diff -r 2602f54c018d -r 17bc502c65a4 urls.py --- a/urls.py Tue Sep 11 17:59:27 2012 -0400 +++ b/urls.py Tue Sep 11 18:06:01 2012 -0400 @@ -1,4 +1,5 @@ from django.conf.urls.defaults import * +from django.views.generic import ListView # Uncomment the next two lines to enable the admin: from django.contrib import admin @@ -22,8 +23,7 @@ {'template': 'discuss.djhtml'}, name='discuss'), url(r'^code$', - 'django.views.generic.simple.direct_to_template', - {'template': 'code.djhtml'}, + 'views.code', name='code'), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), url(r'^admin/', include(admin.site.urls)),