clean templates
authorcavaliet
Tue, 19 Feb 2013 15:46:37 +0100
changeset 47 962c69862115
parent 46 a766937acc12
child 48 4c0838a3a8b6
clean templates
src/egonomy/templates/egonomy_all_fragments.html
src/egonomy/templates/egonomy_all_pictures.html
--- a/src/egonomy/templates/egonomy_all_fragments.html	Tue Feb 19 13:14:20 2013 +0100
+++ b/src/egonomy/templates/egonomy_all_fragments.html	Tue Feb 19 15:46:37 2013 +0100
@@ -3,7 +3,6 @@
 {% load i18n %}
 {% load thumbnail %}
 {% load navigation %}
-{% load highlight %}
 
 {% block title %}{% trans "All fragments" %}{% endblock %}
 
@@ -27,7 +26,7 @@
                               <a href="{% url 'view_fragment' fragment_pk=frg.pk %}">
                               <div class="center-image">
                                 <div class="image-and-fragment">
-                                 {% with frgmt=frg.object|default:frg  %}
+                                 {% with frgmt=frg.object|default:frg %}{# frg.object in search case, frg otherwise #}
                                  {% with image=frgmt.image.info.image_file %}
                                  {% if image %}
                                   {% if image|is_portrait %}
@@ -53,7 +52,7 @@
                                  {% endwith %}
                                 </div>
                              </div>
-                             <h3>{% if search %}{{ frg.highlighted.title|first|safe|default:frg.title }}{% else %}{{ frg.title }}{% endif %}</h3></a>
+                             <h3>{{ frg.highlighted.title|first|safe|default:frg.title }}</h3></a>
                              <p>{% trans "Annotated by" %} <strong>{{ frg.author }}</strong></p>
                             </li>
                           {% endfor %}
--- a/src/egonomy/templates/egonomy_all_pictures.html	Tue Feb 19 13:14:20 2013 +0100
+++ b/src/egonomy/templates/egonomy_all_pictures.html	Tue Feb 19 15:46:37 2013 +0100
@@ -3,7 +3,6 @@
 {% load i18n %}
 {% load thumbnail %}
 {% load navigation %}
-{% load highlight %}
 
 {% block title %}{% trans "All pictures" %}{% endblock %}
 
@@ -26,7 +25,7 @@
                             <li class="subcol subcol-eighth">
                                 <a href="{% url 'annotate_picture' image_id=img.id %}">
                                 <div class="center-image">
-                                 {% with img.info.image_file as image %}
+                                 {% with image=img.info.image_file %}
                                  {% if image %}
                                   {% if image|is_portrait %}
 							 	    {% thumbnail image "x110" format="PNG" crop="center" as im %}
@@ -46,9 +45,9 @@
 	                             {% endif %}
 	                             {% endwith %}
                                 </div>
-                                <h3>{% if img.metadata.titre %}{% if search %}{% highlight img.metadata.titre with search html_tag "span" css_class "highlight" %}{% else %}{{ img.metadata.titre }}{% endif %}{% else %}({% trans "No title" %}){% endif %}</h3></a>
-                                <p>{% trans "Author" %}&nbsp;: <strong>{% if img.metadata.auteur %}{{ img.metadata.auteur }}{% else %}({% trans "Not documented" %}){% endif %}</strong></p>
-                            </li>   
+                                <h3>{{ img.metadata.titre|default:_("No title") }}</h3></a>
+                                <p>{% trans "Author" %}&nbsp;: <strong>{{ img.metadata.auteur|default:_("Not documented") }}</strong></p>
+                            </li>
                           {% endfor %}
                         </ul>
                         {% if nb_pages > 1 %}<p>{% build_pagination nb_pages cur_page_nb url_pagination "contents_page clickable" %}</p>{% endif %}