mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Do not show "create new event" if there are no permissions to dos o
This commit is contained in:
@@ -14,11 +14,13 @@
|
||||
</div>
|
||||
<h2>{% trans "Your upcoming events" %}</h2>
|
||||
<div class="dashboard">
|
||||
<div class="widget-small widget-container">
|
||||
<a href="{% url "control:events.add" %}" class="widget">
|
||||
<div class="newevent"><span class="fa fa-plus-circle"></span>{% trans "Create a new event" %}</div>
|
||||
</a>
|
||||
</div>
|
||||
{% if can_create_event %}
|
||||
<div class="widget-small widget-container">
|
||||
<a href="{% url "control:events.add" %}" class="widget">
|
||||
<div class="newevent"><span class="fa fa-plus-circle"></span>{% trans "Create a new event" %}</div>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% for w in upcoming %}
|
||||
<div class="widget-{{ w.display_size|default:"small" }} {{ w.container_class|default:"widget-container" }} {% if w.lazy %}widget-lazy-loading{% endif %}" data-lazy-id="{{ w.lazy }}">
|
||||
<div class="widget">
|
||||
|
||||
@@ -535,6 +535,7 @@ def user_index(request):
|
||||
|
||||
ctx = {
|
||||
'widgets': rearrange(widgets),
|
||||
'can_create_event': request.user.teams.filter(can_create_events=True).exists(),
|
||||
'upcoming': widgets_for_event_qs(
|
||||
request,
|
||||
annotated_event_query(request, lazy=True).filter(
|
||||
|
||||
Reference in New Issue
Block a user