Implement review comments

This commit is contained in:
Mira Weller
2024-04-30 21:49:58 +02:00
parent 4865879978
commit 46dce1bf43
4 changed files with 8 additions and 10 deletions
-3
View File
@@ -954,9 +954,6 @@ class EventLive(EventPermissionRequiredMixin, TemplateView):
permission = 'can_change_event_settings'
template_name = 'pretixcontrol/event/live.html'
def setup(self, request, *args, **kwargs):
super().setup(request, *args, **kwargs)
def get_context_data(self, **kwargs):
ctx = super().get_context_data(**kwargs)
ctx['issues'] = self.request.event.live_issues
@@ -123,14 +123,14 @@
{% blocktrans trimmed with datetime=request.now_dt|date:"SHORT_DATETIME_FORMAT" %}
You are currently using the time machine. The ticket shop is rendered as if it were {{ datetime }}.
{% endblocktrans %}
<a href="{% eventurl event "presale:event.timemachine" %}" class="stealth"><span class="fa fa-clock-o" aria-hidden="true"></span> <u>{% trans "Change" %}</u></a>
<a href="{% eventurl event "presale:event.timemachine" %}"><span class="fa fa-clock-o" aria-hidden="true"></span>{% trans "Change" %}</a>
</p>
{% elif request.user.is_authenticated or request.event_access_user.is_authenticated %}
<p>
{% eventurl event "presale:event.timemachine" as time_machine_link %}
{% blocktrans trimmed with time_machine_link=time_machine_link %}
To view your shop at different points in time, you can enable
<a href="{{ time_machine_link }}" class="stealth"><span class="fa fa-clock-o" aria-hidden="true"></span> <u>time machine</u></a>.
<a href="{{ time_machine_link }}"><span class="fa fa-clock-o" aria-hidden="true"></span>time machine</a>.
{% endblocktrans %}
</p>
{% elif request.event_domain or request.organizer_domain %}
@@ -138,7 +138,7 @@
{% url "control:event.transfer_session" event=event.slug organizer=event.organizer.slug as time_machine_link %}
{% blocktrans trimmed with time_machine_link=time_machine_link %}
To view your shop at different points in time, you can enable
<a href="{{ time_machine_link }}" class="stealth"><span class="fa fa-clock-o" aria-hidden="true"></span> <u>time machine</u></a>.
<a href="{{ time_machine_link }}"><span class="fa fa-clock-o" aria-hidden="true"></span>time machine</a>.
{% endblocktrans %}
</p>
{% endif %}
+2
View File
@@ -942,6 +942,8 @@ class EventTimeMachine(EventViewMixin, TemplateView):
super().setup(request, *args, **kwargs)
if not has_time_machine_permission(request, request.event):
raise PermissionDenied(_('You are not allowed to access time machine mode.'))
if not request.event.testmode:
raise PermissionDenied(_('This feature is only available in test mode.'))
self.timemachine_form = TimemachineForm(
data=request.method == 'POST' and request.POST or None,
initial=(
@@ -188,18 +188,17 @@ div.front-page {
margin-top: 30px;
}
.offline-banner {
background: $brand-danger;
color: white;
width: 100%;
padding: 5px;
text-align: center;
a, .btn-link {
text-decoration: underline;
color: white;
}
}
.offline-banner { background: $brand-danger; color: white; }
.offline-banner a { color: white; }
.timemachine-banner { background: $brand-warning; }
.timemachine-banner a, .timemachine-banner .btn-link { color: $text-color; }
#questions_group .panel-title a {
line-height: 22px;
}