changeset 52:349162d0ce19

Fundamental fixes in snippet templates
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Mon, 07 Feb 2011 04:37:08 -0600
parents fd4c5b26b67a
children e3f9a241e1bb
files templates/profile/user.djhtml templates/snippet/snippet_details.djhtml
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/templates/profile/user.djhtml
+++ b/templates/profile/user.djhtml
@@ -68,11 +68,16 @@
     </h5>
     <ul>
       {% for s in snippets %}
-      {# FIXME: Use an urlconf for snippets #}
-      <li><a href="/snippet/{{s}}"}{{s}}</a></li>
+      <li><a href="{% url snippet_details s %}">
+          {% if s.title %}
+          {{s.title}}
+          {% else %}
+          Snippet #{{s.pk}}
+          {% endif %}
+      </a></li>
       {% endfor %}
-      {% endif %}
     </ul>
+    {% endif %}
   </div>
 </div>
 {% endif %}
--- a/templates/snippet/snippet_details.djhtml
+++ b/templates/snippet/snippet_details.djhtml
@@ -58,13 +58,6 @@
       {% else %}
       {% trans "Snippet" %} #{{ snippet.id}}
       {% endif %}
-      <span>
-        {% if snippet.author %}
-        {% blocktrans with snippet.author as author %}
-        by {{ author }}
-        {% endblocktrans %}
-        {% endif %}
-      </span>
     </h3>
 
     <div class="whitebox">
@@ -83,6 +76,16 @@
         &mdash;
         {% endif %}
         <a id="toggleWordwrap" href="#">{% trans "Wordwrap" %}</a>
+        <div>
+         author:
+          {% if snippet.author %}
+         <a href="{% url agora.apps.profile.views.showprofile snippet.author %}">
+           {{ snippet.author }}
+         </a>
+          {% else %}
+          anonymous
+          {% endif %}
+        </div>
       </div>
 
       <br />