staff can delete speakers
This commit is contained in:
parent
e4e4cd35ef
commit
a2b3e50e9b
|
@ -68,7 +68,11 @@
|
||||||
|
|
||||||
{% for participant in talk.speakers.all %}
|
{% for participant in talk.speakers.all %}
|
||||||
{% if forloop.first %}<ul>{% endif %}
|
{% if forloop.first %}<ul>{% endif %}
|
||||||
<li><a href="{% url 'participant-details' participant.token %}">{{ participant }}</a>{% if participant.vip %} <span class="badge">VIP</span>{% endif %}</li>
|
<li>
|
||||||
|
<a href="{% url 'participant-details' participant.token %}">{{ participant }}</a>
|
||||||
|
{% if participant.vip %} <span class="badge">VIP</span>{% endif %}
|
||||||
|
<a href="{% url 'talk-speaker-remove' participant_id=participant.pk talk_id=talk.pk %}" class="btn btn-xs btn-danger"><span class=" glyphicon glyphicon-remove"></span> {% trans "remove" %}</a>
|
||||||
|
</li>
|
||||||
{% if forloop.last %}</ul>{% endif %}
|
{% if forloop.last %}</ul>{% endif %}
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<i>{% trans "No speakers." %}</i>
|
<i>{% trans "No speakers." %}</i>
|
||||||
|
|
|
@ -43,6 +43,8 @@ urlpatterns = [
|
||||||
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/confirm/$', views.talk_acknowledgment, {'confirm': True}, name='talk-confirm-by-staff'),
|
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/confirm/$', views.talk_acknowledgment, {'confirm': True}, name='talk-confirm-by-staff'),
|
||||||
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/desist/$', views.talk_acknowledgment, {'confirm': False}, name='talk-desist-by-staff'),
|
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/desist/$', views.talk_acknowledgment, {'confirm': False}, name='talk-desist-by-staff'),
|
||||||
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/edit/$', views.TalkUpdate.as_view(), name='talk-edit'),
|
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/edit/$', views.TalkUpdate.as_view(), name='talk-edit'),
|
||||||
|
# url(r'^staff/talks/(?P<talk_id>[\w\-]+)/speaker/add/$', views.talk_speaker_add, name='talk-speaker-add'), TODO WIP
|
||||||
|
url(r'^staff/talks/(?P<talk_id>[\w\-]+)/speaker/del/(?P<participant_id>[\w\-]+)/$', views.talk_speaker_del, name='talk-speaker-remove'),
|
||||||
url(r'^staff/speakers/$', views.participant_list, name='participant-list'),
|
url(r'^staff/speakers/$', views.participant_list, name='participant-list'),
|
||||||
url(r'^staff/speakers/add/$', views.ParticipantCreate.as_view(), name='participant-add'),
|
url(r'^staff/speakers/add/$', views.ParticipantCreate.as_view(), name='participant-add'),
|
||||||
url(r'^staff/speakers/(?P<participant_id>[\w\-]+)/$', views.participant_details, name='participant-details'),
|
url(r'^staff/speakers/(?P<participant_id>[\w\-]+)/$', views.participant_details, name='participant-details'),
|
||||||
|
|
14
cfp/views.py
14
cfp/views.py
|
@ -735,6 +735,20 @@ def talk_decide(request, talk_id, accept):
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
# @staff_required TODO WIP
|
||||||
|
# def talk_speaker_add(request, talk_id, participant_id=None):
|
||||||
|
# talk = get_object_or_404(Talk, token=talk_id, site=request.conference.site)
|
||||||
|
|
||||||
|
|
||||||
|
@staff_required
|
||||||
|
def talk_speaker_del(request, talk_id, participant_id):
|
||||||
|
talk = get_object_or_404(Talk, pk=talk_id, site=request.conference.site)
|
||||||
|
participant = get_object_or_404(Participant, pk=participant_id, site=request.conference.site)
|
||||||
|
talk.speakers.remove(participant)
|
||||||
|
messages.success(request, _('Speaker removed from this talk'))
|
||||||
|
return redirect(talk.get_absolute_url())
|
||||||
|
|
||||||
|
|
||||||
@staff_required
|
@staff_required
|
||||||
def participant_list(request):
|
def participant_list(request):
|
||||||
participants = Participant.objects.filter(site=request.conference.site) \
|
participants = Participant.objects.filter(site=request.conference.site) \
|
||||||
|
|
Loading…
Reference in New Issue
Block a user