]> git.parisson.com Git - telemeta.git/commitdiff
cleanup
authoryomguy <yomguy@parisson.com>
Fri, 29 Apr 2011 22:46:39 +0000 (00:46 +0200)
committeryomguy <yomguy@parisson.com>
Fri, 29 Apr 2011 22:46:39 +0000 (00:46 +0200)
telemeta/templates/telemeta_default/collection_list.html
telemeta/templatetags/telemeta_utils.py
telemeta/urls.py

index 6bff068e45b00ea60580217da0f6921bd2b95764..3d3005fe135998c8490d7e636037fb24ccf87a86 100644 (file)
@@ -9,7 +9,7 @@
 {% endblock %}
 {% block title_buttons %}
      <a href="{% url telemeta-collections %}" class="component_icon button icon_search">{% trans "All" %}</a>
-     <a href="{% url telemeta-collections-novel %}" class="component_icon button icon_filter">{% trans "Unpublished" %}</a>
+     <a href="{% url telemeta-collections-unpublished %}" class="component_icon button icon_filter">{% trans "Unpublished" %}</a>
      <a href="{% url telemeta-collections-published %}" class="component_icon button icon_filter">{% trans "Published" %}</a>
     {% if user.is_authenticated and perms.telemeta.add_mediacollection %}
       <a href="{% url telemeta-collection-add %}" class="component_icon button icon_add">{% trans "Add" %}</a>
index b9bceb080c18dd2a56663f176c78a22ec29b3e14..7f278809641dd0f733fa937eb0d72ab8758fa507 100644 (file)
@@ -291,39 +291,3 @@ def set_var(parser, token):
         raise template.TemplateSyntaxError("'set' tag must be of the form:  {% set <var_name>  = <var_value> %}")
     return SetVarNode(parts[1], parts[3])
  
-def paginator(context, adjacent_pages=2):
-    """
-    To be used in conjunction with the object_list generic view.
-
-    Adds pagination context variables for use in displaying first, adjacent and
-    last page links in addition to those created by the object_list generic
-    view.
-
-    """
-    startPage = max(context['page'] - adjacent_pages, 1)
-    if startPage <= 3: startPage = 1
-    endPage = context['page'] + adjacent_pages + 1
-    if endPage >= context['pages'] - 1: endPage = context['pages'] + 1
-    page_numbers = [n for n in range(startPage, endPage) \
-            if n > 0 and n <= context['pages']]
-    page_obj = context['page_obj']
-    paginator = context['paginator']
-
-    return {
-        'page_obj': page_obj,
-        'paginator': paginator,
-        'hits': context['hits'],
-        'results_per_page': context['results_per_page'],
-        'page': context['page'],
-        'pages': context['pages'],
-        'page_numbers': page_numbers,
-        'next': context['next'],
-        'previous': context['previous'],
-        'has_next': context['has_next'],
-        'has_previous': context['has_previous'],
-        'show_first': 1 not in page_numbers,
-        'show_last': context['pages'] not in page_numbers,
-    }
-
-register.inclusion_tag('paginator.html', takes_context=True)(paginator)
-
index 801aee3a9e36909627ac00f3c894ad0615e81aac..128df0d846500a6fb3ac432e5e207ebba2da1519 100644 (file)
@@ -103,8 +103,8 @@ urlpatterns = patterns('',
     # collections
     url(r'^collections/$', 'django.views.generic.list_detail.object_list',
         dict(all_collections, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections"),
-    url(r'^collections_novel/$', 'django.views.generic.list_detail.object_list',
-        dict(all_collections_novel, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-novel"),
+    url(r'^collections_unpublished/$', 'django.views.generic.list_detail.object_list',
+        dict(all_collections_novel, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-unpublished"),
     url(r'^collections_published/$', 'django.views.generic.list_detail.object_list',
         dict(all_collections_published, paginate_by=20, template_name="telemeta/collection_list.html"), name="telemeta-collections-published"),
     url(r'^collections/?page=(?P<page>[0-9]+)$',