Skip to content

Commit

Permalink
Event Tickets Dashboard: Add an info box for the organizer and teams (#…
Browse files Browse the repository at this point in the history
…482)

* Add info box

* Remove css, add teams to context

* Add link for detail organizer and teams

* Add custom css

* Change background to none

* Add css style
  • Loading branch information
HungNgien authored Jan 7, 2025
1 parent c9ce050 commit c824b0d
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% load i18n %}
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Event organizer" %}
</h3>
</div>
<div class="panel-body timeline">
<div class="info-row">
{% trans "This event is organized by" %} <strong><a href="{% url 'control:organizer' request.organizer.slug %}">{{ request.organizer }}</a></strong>
</div>
<div class="info-row">
{% trans "Teams of the organizer are" %}
<span></span>
{% for id, name in organizer_teams %}
<strong><a href="{% url 'control:organizer.team' request.organizer.slug id %}">{{ name }}</a></strong>
{% if not forloop.last %}, {% endif %}
{% endfor %}
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
{% load i18n %}
<div class="panel panel-default items">
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Your timeline" %}
</h3>
</div>
<div class="panel-body timeline">
{% regroup timeline by date as tl_list %}
{% for day in tl_list %}
<div class="row {% if day.grouper < today %}text-muted{% endif %}">
<div class="col-date">
<strong>{{ day.grouper|date:"SHORT_DATE_FORMAT" }}</strong>
</div>
<div class="col-event">
{% for e in day.list %}
<strong class="">{{ e.time|date:"TIME_FORMAT" }}</strong>
<div class="panel-heading">
<h3 class="panel-title">
{% trans "Your timeline" %}
</h3>
</div>
<div class="panel-body timeline">
{% regroup timeline by date as tl_list %}
{% for day in tl_list %}
<div class="row {% if day.grouper < today %}text-muted{% endif %}">
<div class="col-date">
<strong>{{ day.grouper|date:"SHORT_DATE_FORMAT" }}</strong>
</div>
<div class="col-event">
{% for e in day.list %}
<strong class="">{{ e.time|date:"TIME_FORMAT" }}</strong>
&nbsp;
<span class="{% if e.time < nearly_now %}text-muted{% endif %}">
{{ e.entry.description }}
</span>
{% if e.entry.edit_url %}
&nbsp;
<span class="{% if e.time < nearly_now %}text-muted{% endif %}">
{{ e.entry.description }}
</span>
{% if e.entry.edit_url %}
&nbsp;
<a href="{{ e.entry.edit_url }}" class="text-muted">
<span class="fa fa-edit"></span>
</a>
{% endif %}
{% if forloop.revcounter > 1 %}
<br/>
{% endif %}
{% endfor %}
</div>
<a href="{{ e.entry.edit_url }}" class="text-muted">
<span class="fa fa-edit"></span>
</a>
{% endif %}
{% if forloop.revcounter > 1 %}
<br/>
{% endif %}
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
13 changes: 10 additions & 3 deletions src/pretix/control/templates/pretixcontrol/event/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,16 @@ <h3 class="panel-title">
{% include "pretixcontrol/event/fragment_subevent_choice_simple.html" %}
</form>
{% endif %}
{% if not request.event.has_subevents or subevent %}
{% include "pretixcontrol/event/fragment_timeline.html" %}
{% endif %}
<div class="dashboard custom">
{% if not request.event.has_subevents or subevent %}
<div class="panel panel-default items widget-container widget-small no-padding column"">
{% include "pretixcontrol/event/fragment_timeline.html" %}
</div>
{% endif %}
<div class="panel panel-default items widget-container widget-small no-padding last-column"">
{% include "pretixcontrol/event/fragment_info_box.html" %}
</div>
</div>
<div class="dashboard">
{% for w in widgets %}
<div class="widget-container widget-{{ w.display_size|default:"small" }} {% if w.lazy %}widget-lazy-loading{% endif %}" data-lazy-id="{{ w.lazy }}">
Expand Down
2 changes: 1 addition & 1 deletion src/pretix/control/views/dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@ def event_index(request, organizer, event):
'can_change_event_settings', request=request)
can_view_vouchers = request.user.has_event_permission(request.organizer, request.event, 'can_view_vouchers',
request=request)

widgets = []
if can_view_orders:
for r, result in event_dashboard_widgets.send(sender=request.event, subevent=subevent, lazy=True):
Expand Down Expand Up @@ -390,6 +389,7 @@ def event_index(request, organizer, event):
]
ctx['today'] = now().astimezone(request.event.timezone).date()
ctx['nearly_now'] = now().astimezone(request.event.timezone) - timedelta(seconds=20)
ctx['organizer_teams'] = request.organizer.teams.values_list('id', 'name')
resp = render(request, 'pretixcontrol/event/index.html', ctx)
# resp['Content-Security-Policy'] = "style-src 'unsafe-inline'"
return resp
Expand Down
39 changes: 39 additions & 0 deletions src/pretix/static/eventyay-common/scss/custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,42 @@
}
}
}


.custom {
margin-left: 0px;
margin-right: 0px;
}

.dashboard .widget-container.no-padding {
padding: 0;
background: none;
border: 1px solid #e5e5e5;
}

.dashboard .widget-container.widget-small.no-padding.column {
padding: 0;
background: none;
border-color: #e5e5e5;
margin-right: 10px;
}

.dashboard .widget-container.widget-small.no-padding.last-column {
padding: 0;
background: none;
border-color: #e5e5e5;
margin-right: 0px;
}

@media (max-width: $screen-sm-max) {
.dashboard .widget-container.widget-small.no-padding.column {
width: 100%;
margin-right: 0px;
}
}

@media (max-width: $screen-xs-max) {
.dashboard .widget-container.widget-small.no-padding.column {
margin-right: 0px;
}
}

0 comments on commit c824b0d

Please sign in to comment.