[damned-lies] Fix display of figures link in vertimus detail template



commit 975e986ac7c406e06b28c8daeba346bc60f74958
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Jun 16 20:23:13 2009 +0200

    Fix display of figures link in vertimus detail template

 templates/vertimus/vertimus_detail.html |   10 ++++++----
 vertimus/views.py                       |    5 +++--
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/templates/vertimus/vertimus_detail.html b/templates/vertimus/vertimus_detail.html
index bcd701e..2d8b552 100644
--- a/templates/vertimus/vertimus_detail.html
+++ b/templates/vertimus/vertimus_detail.html
@@ -53,9 +53,9 @@ $(document).ready(function() {
 {% endif %}
 
 <div style="line-height: 1.7">
-  <em><a href="{{ stats.pot_url }}">
+  <em><a href="{{ pot_stats.pot_url }}">
       <img src="{{ MEDIA_URL }}img/download.png" alt="{% trans "Download POT file" %}" /></a>
-    {{ stats.pot_text }}
+    {{ pot_stats.pot_text }}
   </em>
   <br/>
   <a href="{{ po_url }}"><img src="{{ MEDIA_URL }}img/download.png" alt="{% trans "Download PO file" %}" /></a> {% trans "Translated:" %}
@@ -65,9 +65,11 @@ $(document).ready(function() {
     <div class="fuzzy" style="{{ LANGUAGE_BIDI|yesno:"right,left" }}:{{ stats.tr_percentage }}px; width:{{ stats.fu_percentage }}px;"></div>
     <div class="untranslated" style="{{ LANGUAGE_BIDI|yesno:"right,left" }}:{{ stats.tr_percentage|add:stats.fu_percentage }}px; width: {{ stats.un_percentage }}px;"></div>
   </div>
-  {% if stats.fig_count and stats.language %}
-  <a href="{% url stats.views.docimages module_name=module.name,potbase=stats.domain.name,branch_name=branch.name,langcode=stats.language.locale %}">
+  {% if pot_stats.fig_count and stats.language %}
+  <div style="display: inline; margin-left:110px;">
+    <a href="{% url stats.views.docimages module_name=module.name,potbase=stats.domain.name,branch_name=branch.name,langcode=stats.language.locale %}">
     <img src="{{ MEDIA_URL }}img/figure.png" alt="{% trans "Display document figures" %}"></a>
+  </div>
   {% endif %}
 </div>
 
diff --git a/vertimus/views.py b/vertimus/views.py
index 8de3bcf..61aa6a5 100644
--- a/vertimus/views.py
+++ b/vertimus/views.py
@@ -57,13 +57,13 @@ def vertimus(request, branch, domain, language, stats=None, level="0"):
        grandparent, second (2) is the parent of the grandparent, etc."""
     level = int(level)
 
+    pot_stats = get_object_or_404(Statistics, branch=branch, domain=domain, language=None)
     if not stats:
         try:
             stats = Statistics.objects.get(branch=branch, domain=domain, language=language)
             po_url = stats.po_url()
         except Statistics.DoesNotExist:
-            # Get the POT file stats
-            stats = get_object_or_404(Statistics, branch=branch, domain=domain, language=None)
+            stats = pot_stats
             po_url = urlresolvers.reverse('dynamic_po',
                         args=("%s.%s.%s.%s.po" % (branch.module.name, domain.name, branch.name, language.locale),))
     else:
@@ -122,6 +122,7 @@ def vertimus(request, branch, domain, language, stats=None, level="0"):
     context = {
         'pageSection': 'module',
         'stats': stats,
+        'pot_stats': pot_stats,
         'po_url': po_url,
         'branch': branch,
         'other_states': other_branch_states,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]