Projet

Général

Profil

Télécharger (2,01 ko) Statistiques
| Branche: | Tag: | Révision:

root / corbo / templates / corbo / manage.html @ f9ae729f

1
{% extends 'corbo/base.html' %}
2
{% load i18n %}
3

    
4
{% block appbar %}
5
<h2>{% trans "Categories" %}</h2>
6
<a href="{% url 'add_category' %}" rel='popup'>{% trans 'New category' %}</a>
7
{% endblock %}
8

    
9
{% block content %}
10
<div id="management">
11
 {% if object_list %}
12
  <ul class='objects-list single-links'>
13
    {% for obj in object_list %}
14
    <li class='category'>
15
        <a href="{% url 'view_category' slug=obj.slug %}">{{ obj.name }} /
16
          {% blocktrans count announces_number=obj.get_announces_count %}
17
          {{ announces_number }} announce
18
          {% plural %}
19
          {{ announces_number }} announces
20
          {% endblocktrans %} /
21
          {% blocktrans count subscriptions_number=obj.get_subscriptions_count %}
22
          {{ subscriptions_number }} subscription
23
          {% plural %}
24
          {{ subscriptions_number }} subscriptions
25
          {% endblocktrans %}
26
        </a>
27
    </li>
28
    {% endfor %}
29
  </ul>
30

    
31
{% if is_paginated %}
32
<p class="paginator">
33
  {% if page_obj.number > 1 %}
34
    {% if page_obj.previous_page_number != 1 %}
35
      <a href="?page=1">1</a>
36
      ...
37
    {% endif %}
38
  {% endif %}
39
  {% if page_obj.has_previous %}
40
    <a href="?page={{ page_obj.previous_page_number }}">{{ page_obj.previous_page_number }}</a>
41
  {% endif %}
42
  <span class="this-page">
43
    {{ page_obj.number }}
44
  </span>
45
  {% if page_obj.has_next %}
46
    <a href="?page={{ page_obj.next_page_number }}">{{ page_obj.next_page_number }}</a>
47
  {% endif %}
48
  {% if page_obj.number != page_obj.paginator.num_pages %}
49
    {% if page_obj.paginator.num_pages > 1 %}
50
       {% if page_obj.next_page_number != page_obj.paginator.num_pages %}
51
         ...
52
         <a href="?page={{ page_obj.paginator.num_pages }}">{{ page_obj.paginator.num_pages }}</a>
53
       {% endif %}
54
     {% endif %}
55
   {% endif %}
56
</p>
57
{% endif %}
58

    
59
{% else %}
60
<div class="big-msg-info">
61
  {% blocktrans %}
62
  There are no categories yet. Click on "New category" button in the top
63
  right of the page to add a first one.
64
  {% endblocktrans %}
65
</div>
66
{% endif %}
67
</div>
68
{% endblock %}
(8-8/12)