0001-manager-remove-obsolete-user_can_manage-in-exception.patch
chrono/manager/templates/chrono/manager_time_period_exception_list.html | ||
---|---|---|
20 | 20 |
<ul class="objects-list single-links"> |
21 | 21 |
{% for exception in object_list %} |
22 | 22 |
<li> |
23 |
<a {% if user_can_manage and not exception.read_only %}href="{% url 'chrono-manager-time-period-exception-edit' pk=exception.id %}"{% endif %}>{{ exception }}</a>
|
|
24 |
{% if user_can_manage and not exception.from_settings and not exception.read_only %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-exception-delete' pk=exception.id %}{% if not page_obj %}?from_popup{% endif %}">{% trans "remove" %}</a>{% endif %}
|
|
23 |
<a {% if not exception.read_only %}href="{% url 'chrono-manager-time-period-exception-edit' pk=exception.id %}"{% endif %}>{{ exception }}</a> |
|
24 |
{% if not exception.from_settings and not exception.read_only %}<a rel="popup" class="delete" href="{% url 'chrono-manager-time-period-exception-delete' pk=exception.id %}{% if not page_obj %}?from_popup{% endif %}">{% trans "remove" %}</a>{% endif %} |
|
25 | 25 |
</li> |
26 | 26 |
{% endfor %} |
27 | 27 |
</ul> |
chrono/manager/views.py | ||
---|---|---|
2921 | 2921 |
Q(desk=self.desk) | Q(unavailability_calendar__desks=self.desk), end_datetime__gte=now() |
2922 | 2922 |
) |
2923 | 2923 | |
2924 |
def get_context_data(self, **kwargs): |
|
2925 |
context = super().get_context_data(**kwargs) |
|
2926 |
context['user_can_manage'] = self.desk.agenda.can_be_managed(self.request.user) |
|
2927 |
return context |
|
2928 | ||
2929 | 2924 | |
2930 | 2925 |
time_period_exception_list = TimePeriodExceptionListView.as_view() |
2931 | 2926 | |
2932 |
- |