{% trans rev_id=rev.id %}This may not be the last update, you are seeing revision {{ rev_id }}!{% endtrans %}
+{% trans rev_id=rev.revision %}This may not be the last update, you are seeing revision {{ rev_id }}!{% endtrans %}
{{ rev.title }}
{% trans %}Page history{% endtrans %}
+{% trans %}Page history{% endtrans %}
{% trans page_name=page.name %}You're seeing the history of page "{{ page_name }}"{% endtrans %}
-
- {% for r in (page.revisions.all()|sort(attribute='date', reverse=True)) %}
+{% for r in (page.revisions.all()|sort(attribute='date', reverse=True)) %}
{% if loop.index < 2 %}
-
- - last - {{ page.revisions.last().author }} - {{ page.revisions.last().date|date('Y-m-d H:i') }} +
- {% trans %}last{% endtrans %} - + {{ user_profile_link(page.revisions.last().author) }} - + {{ page.revisions.last().date|localtime|date(DATETIME_FORMAT) }} {{ page.revisions.last().date|localtime|time(DATETIME_FORMAT) }} {% else %} -
- - {{ r['author'] }} - {{ r['date']|date('Y-m-d H:i') }} +
- {{ r.revision }} - + {{ user_profile_link(r.author) }} - + {{ page.revisions.last().date|localtime|date(DATETIME_FORMAT) }} {{ page.revisions.last().date|localtime|time(DATETIME_FORMAT) }} {% endif %} - {% endfor %} +{% endfor %}
-
{% if user.is_in_group(settings.SITH_GROUPS['counter-admin']['name']) or user.is_in_group(settings.SITH_GROUPS['root']['name']) %}
- {% trans %}General counters management{% endtrans %} +
- {% trans %}General products management{% endtrans %} {% endif %} {% for b in settings.SITH_COUNTER_BARS %} {% if user.is_in_group(b[1]+" admin") %} diff --git a/counter/models.py b/counter/models.py index cb35d290..9059a961 100644 --- a/counter/models.py +++ b/counter/models.py @@ -75,6 +75,9 @@ class Product(models.Model): def __str__(self): return self.name + def get_absolute_url(self): + return reverse('counter:product_list') + class Counter(models.Model): name = models.CharField(_('name'), max_length=30) club = models.ForeignKey(Club, related_name="counters") diff --git a/counter/templates/counter/product_list.jinja b/counter/templates/counter/product_list.jinja new file mode 100644 index 00000000..f9a50085 --- /dev/null +++ b/counter/templates/counter/product_list.jinja @@ -0,0 +1,23 @@ +{% extends "core/base.jinja" %} + +{% block title %} +{% trans %}Product list{% endtrans %} +{% endblock %} + +{% block content %} +
- {{ p }} + {% endfor %} +
{% trans %}New product{% endtrans %}
+{% if product_list %} +{% trans %}Product list{% endtrans %}
+-
+ {% for p in product_list %}
+