]> git.parisson.com Git - telemeta.git/commitdiff
fix geo list pagination
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 12 Feb 2015 17:19:40 +0000 (18:19 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 12 Feb 2015 17:19:40 +0000 (18:19 +0100)
telemeta/templates/telemeta/geo_country_collections.html
telemeta/templates/telemeta/geo_country_items.html
telemeta/views/geo.py

index 85434291e466f7e9ed67a471df87279e72832440..17da117d056383410f40e787f9be28fadb1ea7b7 100644 (file)
@@ -5,8 +5,18 @@
 {% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
 
 {% block title %}
-<img src="{{ STATIC_URL }}telemeta/images/world_red.png" alt="geo-country" style="vertical-align:middle" /> <a href="{% url "telemeta-geo-continents" %}">{% trans "World" %}</a> /
-  <a href="{% url "telemeta-geo-countries" continent.flatname %}">{{ continent }}</a> / {{ country }}
+
+<div class='row'>
+ <div class="col-md-4">
+  <img src="{{ STATIC_URL }}telemeta/images/world_red.png" alt="geo-country" style="vertical-align:middle" /> <a href="{% url "telemeta-geo-continents" %}">{% trans "World" %}</a> /
+  <a href="{% url "telemeta-geo-countries" continent.flatname %}">{{ continent }}</a> / {{ country }} ({{ page_obj.start_index }} - {{ page_obj.end_index }} / {{ count }})
+ </div>
+<div class="col-md-8">
+{% bootstrap_paginate page_obj range=10 show_first_last="True" %}
+</div>
+<div class="col-md-0">&nbsp;</div>
+</div>
+
 {% endblock title %}
 
 {% block content %}
index ffd1469cd33483b769802b4fe74773309f284300..252c51184960b58a4a22861c2e361581f607f154 100644 (file)
@@ -5,9 +5,16 @@
 {% block head_title %}{{ country }} - {% trans "Geographic Navigator" %} - {{ block.super }}{% endblock %}
 
 {% block title %}
-<a href="{% url "telemeta-geo-continents" %}">{% trans "World" %}</a> /
-  <a href="{% url "telemeta-geo-countries" continent.flatname %}">{{ continent }}</a>
-  / {{ country }}
+<div class='row'>
+ <div class="col-md-4">
+  <img src="{{ STATIC_URL }}telemeta/images/world_red.png" alt="geo-country" style="vertical-align:middle" /> <a href="{% url "telemeta-geo-continents" %}">{% trans "World" %}</a> /
+  <a href="{% url "telemeta-geo-countries" continent.flatname %}">{{ continent }}</a> / {{ country }} ({{ page_obj.start_index }} - {{ page_obj.end_index }} / {{ count }})
+ </div>
+<div class="col-md-8">
+{% bootstrap_paginate page_obj range=10 show_first_last="True" %}
+</div>
+<div class="col-md-0">&nbsp;</div>
+</div>
 {% endblock title %}
 
 {% block content %}
index c7f00edb1fa04e3ce080ace5a266f3a364814997..29ddaf53a653a7ca1c93374fc74009fbab69085b 100644 (file)
@@ -94,10 +94,10 @@ class GeoCountryCollectionView(ListView):
         context = super(GeoCountryCollectionView, self).get_context_data(*args, **kwargs)
         context['country'] = self.country
         context['continent'] =  self.continent
+        context['count'] = self.object_list.count()
         return context
 
 
-
 class GeoCountryItemView(ListView):
 
     model = MediaItem
@@ -115,6 +115,7 @@ class GeoCountryItemView(ListView):
         context = super(GeoCountryItemView, self).get_context_data(*args, **kwargs)
         context['country'] = self.country
         context['continent'] =  self.continent
+        context['count'] = self.object_list.count()
         return context