Commit 92473297f590595cf47408bc90de20d4906b3a4d
1 parent
9f12a777
Exists in
master
and in
2 other branches
Modified list news template to non-staff members
Showing
1 changed file
with
11 additions
and
1 deletions
Show diff stats
news/templates/news/list.html
... | ... | @@ -3,11 +3,17 @@ |
3 | 3 | {% load static i18n django_bootstrap_breadcrumbs permission_tags pagination %} |
4 | 4 | |
5 | 5 | {% block breadcrumbs %} |
6 | - {{ block.super }} | |
6 | + {{ block.super }} | |
7 | + {% if user.is_staff %} | |
7 | 8 | {% trans 'Manage News' as manage_news %} |
8 | 9 | {% breadcrumb manage_news 'news:manage_news' %} |
10 | + {% else %} | |
11 | + {% trans 'News' as news %} | |
12 | + {% breadcrumb news 'news:manage_news' %} | |
13 | + {% endif %} | |
9 | 14 | {% endblock %} |
10 | 15 | |
16 | + | |
11 | 17 | {% block render_breadcrumbs %} |
12 | 18 | {% render_breadcrumbs %} |
13 | 19 | {% endblock %} |
... | ... | @@ -41,9 +47,11 @@ |
41 | 47 | </div> |
42 | 48 | </form> |
43 | 49 | </div> |
50 | + {% if user.is_staff %} | |
44 | 51 | <div class="col-md-3"> |
45 | 52 | <a href="{% url 'news:create' %}" class="pull-right btn btn-success btn-raised btn-md"><i class="fa fa-plus"></i> {% trans 'Create News' %}</a> |
46 | 53 | </div> |
54 | + {% endif %} | |
47 | 55 | </div> |
48 | 56 | |
49 | 57 | {% if news %} |
... | ... | @@ -54,12 +62,14 @@ |
54 | 62 | <a href="{% url 'news:view' new.slug %}"><h3> <b>{{ new }}</b> </h3></a> |
55 | 63 | <p>{{ new.creator}}, em {{ new.create_date }}</p> |
56 | 64 | </div> |
65 | + {% if user.is_staff %} | |
57 | 66 | <div class="col-md-6"> |
58 | 67 | <div align="right"> |
59 | 68 | <a href="{% url 'news:update' new.slug %}" class="btn btn-success btn-raised btn-sm"><i class="fa fa-edit"></i> {% trans 'Edit' %}</a> |
60 | 69 | <a href="javascript:delete_news.get('{% url 'news:delete' new.slug %}','#news','#modal_remove')" class="btn btn-default btn-raised btn-sm" class="btn btn-default btn-raised btn-sm"><i class="fa fa-trash"></i> {% trans 'Delete' %}</a> |
61 | 70 | </div> |
62 | 71 | </div> |
72 | + {% endif %} | |
63 | 73 | </div> |
64 | 74 | |
65 | 75 | </div> | ... | ... |