summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-12-24 16:09:17 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-12-25 08:01:32 (GMT)
commita2a00971dc71798b595a33ce53f5beec0e6a23b7 (patch)
tree46ba66fce8087a446523cd2ecdf869c72a3ff0f5
parent485ed76dd720306e755b6bc1573efaed3d2999fb (diff)
downloadchrono-wip/20279-events-view.zip
chrono-wip/20279-events-view.tar.gz
chrono-wip/20279-events-view.tar.bz2
manager: remove permission checks on settings individual parts (#20279)wip/20279-events-view
As the whole page is now restricted.
-rw-r--r--chrono/manager/templates/chrono/manager_agenda_settings.html2
-rw-r--r--chrono/manager/templates/chrono/manager_events_agenda_settings.html4
-rw-r--r--chrono/manager/templates/chrono/manager_meetings_agenda_settings.html22
-rw-r--r--chrono/manager/views.py5
4 files changed, 12 insertions, 21 deletions
diff --git a/chrono/manager/templates/chrono/manager_agenda_settings.html b/chrono/manager/templates/chrono/manager_agenda_settings.html
index 492f8c1..c034317 100644
--- a/chrono/manager/templates/chrono/manager_agenda_settings.html
+++ b/chrono/manager/templates/chrono/manager_agenda_settings.html
@@ -18,12 +18,10 @@
{% if user.is_staff %}
<a rel="popup" href="{% url 'chrono-manager-agenda-delete' pk=object.id %}">{% trans 'Delete' %}</a>
{% endif %}
-{% if user_can_manage %}
<a download href="{% url 'chrono-manager-agenda-export' pk=object.id %}">{% trans 'Export' %}</a>
<a rel="popup" href="{% url 'chrono-manager-agenda-edit' pk=object.id %}">{% trans 'Options' %}</a>
{% block agenda-extra-management-actions %}
{% endblock %}
-{% endif %}
</span>
{% endblock %}
diff --git a/chrono/manager/templates/chrono/manager_events_agenda_settings.html b/chrono/manager/templates/chrono/manager_events_agenda_settings.html
index 0896c1d..51461e6 100644
--- a/chrono/manager/templates/chrono/manager_events_agenda_settings.html
+++ b/chrono/manager/templates/chrono/manager_events_agenda_settings.html
@@ -22,7 +22,7 @@
{% elif event.waiting_list_places %}
data-total="{{event.waiting_list_places}}" data-booked="{{event.waiting_list}}"
{% endif %}
- ><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-event-edit' pk=agenda.id event_pk=event.id %}?next=settings{% else %}#{% endif %}">
+ ><a rel="popup" href="{% url 'chrono-manager-event-edit' pk=agenda.id event_pk=event.id %}?next=settings">
{% if event.label %}{{event.label}} / {% endif %}
{{ event.start_datetime }}
{% if event.full %}/ <span class="full">{% trans "full" %}</span>{% endif %}
@@ -41,7 +41,7 @@
({% trans "out of bookable period" %})
{% endif %}
</a>
- {% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-event-delete' pk=agenda.id event_pk=event.id %}?next=settings">{% trans "remove" %}</a>{% endif %}
+ <a rel="popup" class="delete" href="{% url 'chrono-manager-event-delete' pk=agenda.id event_pk=event.id %}?next=settings">{% trans "remove" %}</a>
<span class="occupation-bar"></span>
</li>
{% endfor %}
diff --git a/chrono/manager/templates/chrono/manager_meetings_agenda_settings.html b/chrono/manager/templates/chrono/manager_meetings_agenda_settings.html
index 111f649..a9fbf50 100644
--- a/chrono/manager/templates/chrono/manager_meetings_agenda_settings.html
+++ b/chrono/manager/templates/chrono/manager_meetings_agenda_settings.html
@@ -14,12 +14,12 @@
{% if object.meetingtype_set.count %}
<ul class="objects-list single-links">
{% for meeting_type in object.meetingtype_set.all %}
- <li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-meeting-type-edit' pk=meeting_type.id %}{% else %}#{% endif %}">
+ <li><a rel="popup" href="{% url 'chrono-manager-meeting-type-edit' pk=meeting_type.id %}">
{{meeting_type.label}}
<span class="duration">({{meeting_type.duration}} {% trans "minutes" %})</span>
<span class="identifier">[{% trans "identifier:" %} {{meeting_type.slug}}]</span>
</a>
- {% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-meeting-type-delete' pk=meeting_type.id %}">{% trans "remove" %}</a>{% endif %}
+ <a rel="popup" class="delete" href="{% url 'chrono-manager-meeting-type-delete' pk=meeting_type.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
</ul>
@@ -44,29 +44,27 @@
{% url 'chrono-manager-agenda-add-time-period' agenda_pk=object.pk pk=desk.pk as add_time_period_url %}
<ul class="objects-list single-links">
{% if forloop.counter != 1 or forloop.revcounter != 1 %}
- <li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-desk-edit' pk=desk.id %}{% else %}#{% endif %}">
+ <li><a rel="popup" href="{% url 'chrono-manager-desk-edit' pk=desk.id %}">
<strong>{{ desk.label }}</strong>
</a>
- {% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-desk-delete' pk=desk.id %}">{% trans "remove" %}</a>{% endif %}
+ <a rel="popup" class="delete" href="{% url 'chrono-manager-desk-delete' pk=desk.id %}">{% trans "remove" %}</a>
</li>
{% endif %}
{% for time_period in desk.timeperiod_set.all %}
- <li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-time-period-edit' pk=time_period.id %}{% else %}#{% endif %}">
- {{time_period.weekday_str}} / {{time_period.start_time}} → {{time_period.end_time}} </a>
- {% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-delete' pk=time_period.id %}">{% trans "remove" %}</a>{% endif %}
+ <li><a rel="popup" href="{% url 'chrono-manager-time-period-edit' pk=time_period.id %}">
+ {{time_period.weekday_str}} / {{time_period.start_time}} → {{time_period.end_time}}</a>
+ <a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-delete' pk=time_period.id %}">{% trans "remove" %}</a>
</li>
{% endfor %}
- {% if user_can_manage %}
<li><a class="add" rel="popup" href="{{add_time_period_url}}">{% trans 'Add a time period' %}</a></li>
- {% endif %}
{% if desk.timeperiod_set.count %}
{% url 'chrono-manager-agenda-add-time-period-exception' agenda_pk=object.pk pk=desk.pk as add_time_period_exception_url %}
- <li><a href="#"><strong>{% trans 'Exceptions' %}</strong></a><a class="link-action-icon upload" rel="popup" href="{% url 'chrono-manager-desk-add-import-time-period-exceptions' pk=desk.pk %}" title="{% trans 'Import exceptions from .ics' %}">{% trans 'upload' %}</a></li>
+ <li><a><strong>{% trans 'Exceptions' %}</strong></a><a class="link-action-icon upload" rel="popup" href="{% url 'chrono-manager-desk-add-import-time-period-exceptions' pk=desk.pk %}" title="{% trans 'Import exceptions from .ics' %}">{% trans 'upload' %}</a></li>
{% for exception in desk.get_exceptions_within_two_weeks %}
- <li><a rel="popup" href="{% if user_can_manage %}{% url 'chrono-manager-time-period-exception-edit' pk=exception.pk %}{% else %}#{% endif %}">
+ <li><a rel="popup" href="{% url 'chrono-manager-time-period-exception-edit' pk=exception.pk %}">
{{ exception }}
- {% if user_can_manage %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-exception-delete' pk=exception.id %}">{% trans "remove" %}</a>{% endif %}
+ <a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-exception-delete' pk=exception.id %}">{% trans "remove" %}</a>
{% endfor %}
{% if not desk.are_all_exceptions_displayed %}
<li><a class="timeperiod-exception-all" rel="popup" data-selector="div.timeperiod" href="{% url 'chrono-manager-time-period-exception-extract-list' pk=desk.id %}">({% trans 'see all exceptions' %})</a></li>
diff --git a/chrono/manager/views.py b/chrono/manager/views.py
index 24c8c51..2096909 100644
--- a/chrono/manager/views.py
+++ b/chrono/manager/views.py
@@ -618,11 +618,6 @@ class ManagedDeskSubobjectMixin(object):
class AgendaSettings(ManagedAgendaMixin, DetailView):
model = Agenda
- def get_context_data(self, **kwargs):
- context = super(AgendaSettings, self).get_context_data(**kwargs)
- context['user_can_manage'] = True
- return context
-
def get_template_names(self):
return ['chrono/manager_%s_agenda_settings.html' % self.agenda.kind]