Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inyoka_theme_default/templates/ikhaya/category_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

{% block sidebar %}
{% call macros.sidebar() %}
{% if USER.can('static_file_edit') %}
{% if USER.has_perm('portal.change_staticfile') %}
{{ macros.sidebar_item(_('Upload new icon'), href('portal', 'files', 'new')) }}
{% endif %}
{% endcall %}
Expand Down
10 changes: 5 additions & 5 deletions inyoka_theme_default/templates/ikhaya/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
{% call macros.sidebar_item() %}
<a href="{{ category|url }}">{{ category.name|e }}</a>

{% if USER.can('category_edit') %}
{% if USER.has_perm('ikhaya.change_category"') %}
<a href="{{ href('ikhaya', 'category', category.slug, 'edit') }}"><span class="fa_icon-pencil"></span></a>
{% endif %}
{% endcall %}
Expand All @@ -61,13 +61,13 @@
{{ macros.sidebar_item(_('Archive'), href('ikhaya', 'archive'), 'fa_icon-archive') }}
{% endcall %}

{% if USER.can('article_edit') or USER.can('category_edit') %}
{% if USER.has_perm('ikhaya.change_article') or USER.has_perm('ikhaya.change_category"') %}
{% call macros.sidebar_admin() %}
{% if USER.can('article_edit') %}
{% if USER.has_perm('ikhaya.change_article') %}
{{ macros.sidebar_item(_('New article'), href('ikhaya', 'article', 'new')) }}
{% endif %}

{% if USER.can('category_edit') %}
{% if USER.has_perm('ikhaya.change_category"') %}
{{ macros.sidebar_item(_('Add category'), href('ikhaya', 'category', 'new')) }}
{% endif %}
{% endcall %}
Expand Down Expand Up @@ -131,7 +131,7 @@ <h3>
{% endif %}
</li>

{% if USER.can('article_edit') %}
{% if USER.has_perm('ikhaya.change_article') %}
<li>
<a href="{{ article|url('edit') }}">
{% trans %}Edit{% endtrans %}
Expand Down
2 changes: 1 addition & 1 deletion inyoka_theme_default/templates/pastebin/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{ macros.sidebar_item(_('Display entry as raw text'), entry|url('raw')) }}
{% endcall %}

{% if USER.can('manage_pastebin') %}
{% if USER.has_perm('pastebin.change_entry') %}
{% call macros.sidebar_admin() %}
{{ macros.sidebar_item(_('Delete entry'), entry|url('delete')) }}
{% endcall %}
Expand Down
4 changes: 2 additions & 2 deletions inyoka_theme_default/templates/planet/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
{% call macros.sidebar_item() %}
<a href="{{ blog|url|e }}">{{ blog.name|e }}</a>

{% if USER.can('category_edit') %}
{% if USER.has_perm('planet.change_blog') %}
<a href="{{ blog|url('edit') }}"> <span class="fa_icon-pencil"></span></a>
{% endif %}
{% endcall %}
{% endfor %}
{% endcall %}
{% endif %}

{% if USER.can('blog_edit') %}
{% if USER.has_perm('planet.change_blog') %}
{% call macros.sidebar_admin() %}
{{ macros.sidebar_item(_('new blog'), href('planet', 'blog', 'new')) }}
{{ macros.sidebar_item(_('Bloglist'), href('planet', 'blogs')) }}
Expand Down
2 changes: 1 addition & 1 deletion inyoka_theme_default/templates/planet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ <h3>
{% trans %}Permanent link{% endtrans %}
</a>
</li>
{% if USER.can('blog_edit') %}
{% if USER.has_perm('planet.change_blog') %}
{% if article.hidden and article.hidden_by %}
<li>
{% trans user_link=macros.render_user_link(article.hidden_by) %}
Expand Down
25 changes: 11 additions & 14 deletions inyoka_theme_default/templates/portal/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{% extends 'base.html' %}

{% block title %}
{{ _('Portal') }} - {{ super() }}
{{ _('Portal') }} {{ super() }}
{% endblock %}

{% set active_app = 'portal' %}
Expand All @@ -32,23 +32,20 @@
{{ macros.sidebar_item(_('Calendar'), href('portal', 'calendar')) }}
{% endcall %}

{% if USER.can('static_page_edit')
or USER.can('static_file_edit')
or USER.can('configuration_edit')
or USER.can('markup_css_edit')
{% if USER.has_perm('portal.change_staticpage')
or USER.has_perm('portal.change_staticfile')
or USER.has_perm('portal.change_storage')
%}
{% call macros.sidebar_admin() %}
{% if USER.can('configuration_edit') %}
{{ macros.sidebar_item(_('General'),href('portal', 'config')) }}
{% if USER.has_perm('portal.change_storage') %}
{{ macros.sidebar_item(_('General'), href('portal', 'config')) }}
{% endif %}
{% if USER.can('markup_css_edit') %}
{{ macros.sidebar_item(_('Stylesheets'),href('portal', 'styles')) }}
{% if USER.has_perm('portal.change_staticpage') %}
{{ macros.sidebar_item(_('Stylesheets'), href('portal', 'styles')) }}
{{ macros.sidebar_item(_('Static pages'), href('portal', 'pages')) }}
{% endif %}
{% if USER.can('static_page_edit') %}
{{ macros.sidebar_item(_('Static pages'),href('portal', 'pages')) }}
{% endif %}
{% if USER.can('static_file_edit') %}
{{ macros.sidebar_item(_('Static files'),href('portal', 'files')) }}
{% if USER.has_perm('portal.change_staticfile') %}
{{ macros.sidebar_item(_('Static files'), href('portal', 'files')) }}
{% endif %}
{% endcall %}
{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions inyoka_theme_default/templates/portal/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{% macro show_item(item) %}
{% if user[item] and user.settings['show_'+item] %}
<td>{{ user[item]|e }}</td>
{% elif user[item] and REQUEST.user.can('user_edit') %}
{% elif user[item] and REQUEST.user.has_perm('portal.change_user') %}
<td class="hidden-info">{{ user[item]|e }}</td>
{% else %}
<td>–</td>
Expand All @@ -33,7 +33,7 @@
{% block sidebar %}

{% call macros.sidebar() %}
{% if request.user.can('subscribe_to_users') %}
{% if request.user.has_perm('portal.subscribe_user') %}
{% call macros.sidebar_item() %}
{% if is_subscribed %}
{{ macros.outer_form(csrf_token(), action=href('portal', 'user', user.username, 'unsubscribe')|e , submit_label=_('Don’t watch anymore')) }}
Expand All @@ -47,7 +47,7 @@
{{ macros.sidebar_item(_('show posts'), href('forum', 'author', user.username)) }}
{% endcall %}

{% if request.user.can('user_edit') %}
{% if request.user.has_perm('portal.change_user') %}
{% call macros.sidebar_admin() %}
{{ macros.sidebar_item(_('Edit user'), href('portal', 'user', user.username, 'edit', 'profile')) }}
{{ macros.sidebar_item(_('Edit groups'), href('portal', 'user', user.username, 'edit', 'groups')) }}
Expand Down Expand Up @@ -85,7 +85,7 @@ <h3>
<th>{% trans %}Jabber{% endtrans %}</th>
{% if user.jabber and user.settings['show_jabber'] %}
<td><a href="{{ user.jabber_url|e }}">{{ user.jabber|e }}</a></td>
{% elif user.jabber and REQUEST.user.can('user_edit') %}
{% elif user.jabber and REQUEST.user.has_perm('portal.change_user') %}
<td class="hidden-info">
<a href="{{ user.jabber_url|e }}">{{ user.jabber|e }}</a>
</td>
Expand Down