Skip to content

Commit 0052c5a

Browse files
authored
Merge branch 'enext' into organizer-creation
2 parents d5dfecc + 97faa60 commit 0052c5a

File tree

12 files changed

+387
-28
lines changed

12 files changed

+387
-28
lines changed

app/eventyay/base/models/auth.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,10 @@ class Meta:
287287
'administrator': is_administrator,
288288
}
289289

290+
@property
291+
def name(self):
292+
return self.fullname
293+
290294
def save(self, *args, **kwargs):
291295
self.email = self.email.lower()
292296
is_new = not self.pk

app/eventyay/base/models/mail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def valid_placeholders(self):
233233
'url',
234234
['event', 'user'],
235235
None,
236-
'https://pretalx.example.com/democon/me/submissions/',
236+
'https://eventyay.example.com/democon/me/submissions/',
237237
is_visible=False,
238238
)
239239
kwargs = ['event', 'user']
@@ -242,14 +242,14 @@ def valid_placeholders(self):
242242
'invitation_link',
243243
['event', 'user'],
244244
None,
245-
'https://pretalx.example.com/democon/invitation/123abc/',
245+
'https://eventyay.example.com/democon/invitation/123abc/',
246246
)
247247
elif self.role == MailTemplateRoles.NEW_SUBMISSION_INTERNAL:
248248
placeholders['orga_url'] = SimpleFunctionalMailTextPlaceholder(
249249
'orga_url',
250250
['event', 'submission'],
251251
None,
252-
'https://pretalx.example.com/orga/events/democon/submissions/124ABCD/',
252+
'https://eventyay.example.com/orga/events/democon/submissions/124ABCD/',
253253
)
254254

255255
kwargs = ['event', 'user', 'submission', 'slot']

app/eventyay/control/forms/filter.py

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,95 @@ def filter_qs(self, qs):
891891
return qs
892892

893893

894+
class SubmissionFilterForm(forms.Form):
895+
query = forms.CharField(
896+
label=_('Title or speaker'),
897+
required=False,
898+
widget=forms.TextInput(attrs={'placeholder': _('Title, speaker name or email')}),
899+
)
900+
901+
event_query = forms.CharField(
902+
label=_('Event name'),
903+
required=False,
904+
widget=forms.TextInput(attrs={'placeholder': _('Event name')}),
905+
)
906+
907+
proposal_state = forms.ChoiceField(
908+
label=_('Proposal state'),
909+
choices=(
910+
('', _('All proposals')),
911+
('submitted', _('Submitted')),
912+
('accepted', _('Accepted')),
913+
('rejected', _('Rejected')),
914+
('confirmed', _('Confirmed')),
915+
('withdrawn', _('Withdrawn')),
916+
),
917+
required=False,
918+
)
919+
920+
submission_type = forms.CharField(
921+
label=_('Session Type'),
922+
required=False,
923+
widget=forms.TextInput(attrs={'placeholder': _('Session Type')}),
924+
)
925+
926+
track = forms.CharField(
927+
label=_('Track'),
928+
required=False,
929+
widget=forms.TextInput(attrs={'placeholder': _('Track')}),
930+
)
931+
932+
tags = forms.CharField(
933+
label=_('Tags'),
934+
required=False,
935+
widget=forms.TextInput(attrs={'placeholder': _('Tags')}),
936+
)
937+
938+
ordering = forms.CharField(required=False, widget=forms.HiddenInput())
939+
940+
def filter_qs(self, qs):
941+
fdata = self.cleaned_data
942+
943+
# Search by title or speaker
944+
if fdata.get('query'):
945+
qs = qs.filter(
946+
Q(title__icontains=fdata['query'])
947+
| Q(speakers__fullname__icontains=fdata['query'])
948+
| Q(speakers__email__icontains=fdata['query'])
949+
).distinct()
950+
951+
# Search by event name
952+
if fdata.get('event_query'):
953+
qs = qs.filter(
954+
Q(event__name__icontains=fdata['event_query'])
955+
| Q(event__slug__icontains=fdata['event_query'])
956+
)
957+
958+
# Filter by proposal state
959+
if fdata.get('proposal_state'):
960+
qs = qs.filter(state=fdata['proposal_state'])
961+
962+
# Filter by session type
963+
if fdata.get('submission_type'):
964+
qs = qs.filter(
965+
Q(submission_type__name__icontains=fdata['submission_type'])
966+
)
967+
968+
# Filter by track
969+
if fdata.get('track'):
970+
qs = qs.filter(
971+
Q(track__name__icontains=fdata['track'])
972+
)
973+
974+
# Filter by tags
975+
if fdata.get('tags'):
976+
qs = qs.filter(
977+
Q(tags__tag__icontains=fdata['tags'])
978+
)
979+
980+
return qs
981+
982+
894983
class GiftCardFilterForm(FilterForm):
895984
orders = {
896985
'issuance': 'issuance',

app/eventyay/control/navigation.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,12 @@ def get_admin_navigation(request):
588588
'active': 'organizers' in url.url_name,
589589
'icon': 'group',
590590
},
591+
{
592+
'label': _('All Sessions'),
593+
'url': reverse('control:admin.submissions'),
594+
'active': 'submissions' in url.url_name,
595+
'icon': 'sticky-note-o',
596+
},
591597
{
592598
'label': _('Task management'),
593599
'url': reverse('control:admin.task_management'),
@@ -659,7 +665,7 @@ def get_admin_navigation(request):
659665
},
660666
{
661667
'label': _('Talk admin config'),
662-
'url': '/talk/orga/admin/',
668+
'url': '/orga/admin/',
663669
'active': False,
664670
'icon': 'group',
665671
},
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
{% extends "pretixcontrol/admin/base.html" %}
2+
{% load i18n %}
3+
{% load urlreplace %}
4+
{% load bootstrap3 %}
5+
6+
{% block title %}
7+
{% translate "Submissions" %}
8+
{% endblock %}
9+
10+
{% block content %}
11+
<h1>
12+
{% translate "Submissions" %}
13+
</h1>
14+
<p>
15+
{% translate "This is a list of all talk submissions across events." %}
16+
</p>
17+
18+
<div class="panel panel-default">
19+
<div class="panel-heading">
20+
<h3 class="panel-title">{% translate "Filter" %}</h3>
21+
</div>
22+
23+
<div class="panel-body">
24+
<form method="get" class="row filter-form">
25+
<div class="col-md-3 col-sm-6 col-xs-12">
26+
{% bootstrap_field filter_form.query layout='inline' %}
27+
</div>
28+
<div class="col-md-3 col-sm-6 col-xs-12">
29+
{% bootstrap_field filter_form.event_query layout='inline' %}
30+
</div>
31+
<div class="col-md-3 col-sm-6 col-xs-12">
32+
{% bootstrap_field filter_form.submission_type layout='inline' %}
33+
</div>
34+
<div class="col-md-3 col-sm-6 col-xs-12">
35+
{% bootstrap_field filter_form.track layout='inline' %}
36+
</div>
37+
<div class="col-md-3 col-sm-6 col-xs-12">
38+
{% bootstrap_field filter_form.tags layout='inline' %}
39+
</div>
40+
<div class="col-md-3 col-sm-6 col-xs-12">
41+
{% bootstrap_field filter_form.proposal_state layout='inline' %}
42+
</div>
43+
<div class="col-xs-12 text-right" style="margin-top:10px;">
44+
<button class="btn btn-primary" type="submit">
45+
<span class="fa fa-filter"></span>
46+
<span class="hidden-md">
47+
{% translate "Filter" %}
48+
</span>
49+
</button>
50+
</div>
51+
</form>
52+
</div>
53+
</div>
54+
55+
{% if submissions %}
56+
<div class="table-responsive">
57+
<table class="table table-condensed table-hover">
58+
<thead>
59+
<tr>
60+
<th>
61+
{% translate "Title" %}
62+
<a href="?{% url_replace request 'ordering' 'title' %}">
63+
<i class="fa fa-caret-up"></i>
64+
</a>
65+
<a href="?{% url_replace request 'ordering' '-title' %}">
66+
<i class="fa fa-caret-down"></i>
67+
</a>
68+
</th>
69+
<th>
70+
{% translate "Speakers" %}
71+
<a href="?{% url_replace request 'ordering' 'speakers' %}">
72+
<i class="fa fa-caret-up"></i>
73+
</a>
74+
<a href="?{% url_replace request 'ordering' '-speakers' %}">
75+
<i class="fa fa-caret-down"></i>
76+
</a>
77+
</th>
78+
<th>
79+
{% translate "Event" %}
80+
<a href="?{% url_replace request 'ordering' 'event' %}">
81+
<i class="fa fa-caret-up"></i>
82+
</a>
83+
<a href="?{% url_replace request 'ordering' '-event' %}">
84+
<i class="fa fa-caret-down"></i>
85+
</a>
86+
</th>
87+
<th>
88+
{% translate "Session Type" %}
89+
<a href="?{% url_replace request 'ordering' 'session_type' %}">
90+
<i class="fa fa-caret-up"></i>
91+
</a>
92+
<a href="?{% url_replace request 'ordering' '-session_type' %}">
93+
<i class="fa fa-caret-down"></i>
94+
</a>
95+
</th>
96+
<th>
97+
{% translate "Proposal State" %}
98+
<a href="?{% url_replace request 'ordering' 'state' %}">
99+
<i class="fa fa-caret-up"></i>
100+
</a>
101+
<a href="?{% url_replace request 'ordering' '-state' %}">
102+
<i class="fa fa-caret-down"></i>
103+
</a>
104+
</th>
105+
</tr>
106+
</thead>
107+
108+
{% with accepted="label-success" rejected="label-danger" confirmed="label-primary" withdrawn="label-default" default="label-info" %}
109+
<tbody>
110+
{% for submission in submissions %}
111+
<tr>
112+
<td>
113+
<strong>
114+
<a href="{% url 'orga:submissions.content.view' event=submission.event_slug code=submission.code %}">
115+
{{ submission.title }}
116+
</a>
117+
</strong>
118+
</td>
119+
<td>
120+
{% if submission.speakers|length > 40 %}
121+
<span title="{{ submission.speakers }}">
122+
{{ submission.speakers|slice:":40" }}&hellip;
123+
</span>
124+
{% else %}
125+
{{ submission.speakers }}
126+
{% endif %}
127+
</td>
128+
<td>
129+
<a href="{% url 'control:event.index' organizer=submission.organizer_slug event=submission.event_slug %}">
130+
{{ submission.event }}
131+
</a>
132+
</td>
133+
<td>{{ submission.session_type }}</td>
134+
<td>
135+
<span class="label
136+
{% if submission.proposal_state == 'accepted' %}
137+
{{ accepted }}
138+
{% elif submission.proposal_state == 'rejected' %}
139+
{{ rejected }}
140+
{% elif submission.proposal_state == 'confirmed' %}
141+
{{ confirmed }}
142+
{% elif submission.proposal_state == 'withdrawn' %}
143+
{{ withdrawn }}
144+
{% else %}
145+
{{ default }}
146+
{% endif %}">
147+
{{ submission.proposal_state|capfirst }}
148+
</span>
149+
</td>
150+
</tr>
151+
{% endfor %}
152+
</tbody>
153+
{% endwith %}
154+
</table>
155+
</div>
156+
157+
{% include "pretixcontrol/pagination.html" %}
158+
159+
{% else %}
160+
<div class="empty-collection">
161+
<p>
162+
{% translate "There are no submissions to show." %}
163+
</p>
164+
</div>
165+
{% endif %}
166+
{% endblock %}

app/eventyay/control/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@
608608
url(r'^$', admin.AdminDashboard.as_view(), name='admin.dashboard'),
609609
url(r'^organizers/$', admin.OrganizerList.as_view(), name='admin.organizers'),
610610
url(r'^events/$', admin.AdminEventList.as_view(), name='admin.events'),
611+
path('submissions/', admin.SubmissionListView.as_view(), name='admin.submissions'),
611612
url(r'^task_management', admin.TaskList.as_view(), name='admin.task_management'),
612613
url(r'^sudo/(?P<id>\d+)/$', user.EditStaffSession.as_view(), name='admin.user.sudo.edit'),
613614
url(r'^sudo/sessions/$', user.StaffSessionList.as_view(), name='admin.user.sudo.list'),

0 commit comments

Comments
 (0)