Added counts to book_sets.html and user_shelves.html templates.
authorMarek Stępniowski <marek@stepniowski.com>
Thu, 25 Sep 2008 15:23:25 +0000 (17:23 +0200)
committerMarek Stępniowski <marek@stepniowski.com>
Thu, 25 Sep 2008 15:23:25 +0000 (17:23 +0200)
apps/catalogue/forms.py
wolnelektury/templates/catalogue/main_page.html
wolnelektury/templates/catalogue/user_shelves.html

index 68363c6..63a5526 100644 (file)
@@ -32,7 +32,7 @@ class ObjectSetsForm(forms.Form):
         self.fields['set_ids'] = forms.MultipleChoiceField(
             label=u'Półki',
             required=False,
-            choices=[(tag.id, tag.name) for tag in Tag.objects.filter(category='set', user=user)],
+            choices=[(tag.id, "%s (%s)" % (tag.name, tag.book_count)) for tag in Tag.objects.filter(category='set', user=user)],
             initial=[tag.id for tag in obj.tags.filter(category='set', user=user)],
             widget=forms.CheckboxSelectMultiple
         )
index 107d27d..daa7ce8 100644 (file)
@@ -20,7 +20,7 @@
                 {% if shelves %}
                 <ul class="shelf-list">
                 {% for shelf in shelves %}
-                    <li><a href="{% url delete_shelf shelf.slug %}" class="delete-shelf">usuń</a> <a href="{{ shelf.get_absolute_url }}" class="visit-shelf">{{ shelf.name }}</a></li>
+                    <li><a href="{% url delete_shelf shelf.slug %}" class="delete-shelf">usuń</a> <a href="{{ shelf.get_absolute_url }}" class="visit-shelf">{{ shelf.name }} ({{ shelf.book_count }})</a></li>
                 {% endfor %}
                 </ul>
                 {% else %}
index 7f6ce55..ab34fe4 100644 (file)
@@ -2,7 +2,7 @@
 {% if shelves %}
 <ul class="shelf-list">
 {% for shelf in shelves %}
-    <li><a href="{% url delete_shelf shelf.slug %}" class="delete-shelf">usuń</a> <a href="{{ shelf.get_absolute_url }}" class="visit-shelf">{{ shelf.name }}</a></li>
+    <li><a href="{% url delete_shelf shelf.slug %}" class="delete-shelf">usuń</a> <a href="{{ shelf.get_absolute_url }}" class="visit-shelf">{{ shelf.name }} ({{ shelf.book_count }})</a></li>
 {% endfor %}
 </ul>
 {% else %}