Skip to content
Snippets Groups Projects
Verified Commit ad44b24c authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Add buttons for changing preferences to group and person templates

parent 18a0043a
No related branches found
No related tags found
1 merge request!217Migrate from constance to dynamic-preferences
Pipeline #1825 passed with warnings
{# -*- engine:django -*- #}
{% extends "core/base.html" %}
{% load rules %}
{% load i18n static %}
{% load render_table from django_tables2 %}
......@@ -9,12 +10,26 @@
{% block content %}
<h4>{{ group.name }} <small class="grey-text">{{ group.short_name }}</small></h4>
<p>
<a href="{% url 'edit_group_by_id' group.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
</p>
{% has_perm 'core.edit_group' user group as can_change_group %}
{% has_perm 'core.change_group_preferences' user group as can_change_group_preferences %}
{% if can_change_group or can_change_group_preferences %}
<p>
{% if can_change_group %}
<a href="{% url 'edit_group_by_id' group.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
{% endif %}
{% if can_change_group_preferences %}
<a href="{% url "preferences_group" group.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">settings</i>
{% trans "Change preferences" %}
</a>
{% endif %}
</p>
{% endif %}
<h5>{% blocktrans %}Owners{% endblocktrans %}</h5>
{% render_table owners_table %}
......
......@@ -11,12 +11,23 @@
<h4>{{ person.first_name }} {{ person.last_name }}</h4>
{% has_perm 'core.edit_person' user person as can_change_person %}
{% if can_change_person %}
{% has_perm 'core.change_person_preferences' user person as can_change_person_preferences %}
{% if can_change_person or can_change_person_preferences %}
<p>
<a href="{% url 'edit_person_by_id' person.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
{% if can_change_person %}
<a href="{% url 'edit_person_by_id' person.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">edit</i>
{% trans "Edit" %}
</a>
{% endif %}
{% if can_change_person_preferences %}
<a href="{% url "preferences_person" person.id %}" class="btn waves-effect waves-light">
<i class="material-icons left">settings</i>
{% trans "Change preferences" %}
</a>
{% endif %}
</p>
{% endif %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment