diff --git a/ponyconf/templates/base.html b/ponyconf/templates/base.html index 49025eb..0d940bd 100644 --- a/ponyconf/templates/base.html +++ b/ponyconf/templates/base.html @@ -46,6 +46,7 @@ {% trans "Participate" %} {% trans "Topics" %} {% if request|staff %} + {% trans "Tracks" %} {% trans "Talks" %} {% trans "Speakers" %} {% endif %} diff --git a/proposals/templates/proposals/track_list.html b/proposals/templates/proposals/track_list.html new file mode 100644 index 0000000..8ad2423 --- /dev/null +++ b/proposals/templates/proposals/track_list.html @@ -0,0 +1,33 @@ +{% extends 'base.html' %} + +{% load bootstrap3 accounts_tags i18n %} + +{% block tracktab %} class="active"{% endblock %} + +{% block content %} + +

{% trans "Tracks" %}

+ +{% if request|orga %} +

{% trans "Add a track (not implemented)" %}

+{% endif %} + +

+ {% for track in track_list %} +
+

{{ track }}

+

{{ track.description }}

+ {% if request|staff %} + {{ track.talk_set.count }} {% trans "talk" %}{{ track.talk_set.count|pluralize }} + | + {% bootstrap_icon "pencil" %} (not implemented) + {% endif %} +
+ {% cycle '' '
' %} + {% cycle '' '' '' %} + {% empty %} +
{% trans "No tracks." %}
+ {% endfor %} +
+ +{% endblock %} diff --git a/proposals/urls.py b/proposals/urls.py index 13851d2..39391b2 100644 --- a/proposals/urls.py +++ b/proposals/urls.py @@ -18,6 +18,7 @@ urlpatterns = [ url(r'^topic/$', views.TopicList.as_view(), name='list-topics'), url(r'^topic/add/$', views.TopicCreate.as_view(), name='add-topic'), url(r'^topic/(?P[-\w]+)/edit/$', views.TopicUpdate.as_view(), name='edit-topic'), + url(r'^track/$', views.TrackList.as_view(), name='list-tracks'), url(r'^speakers/$', views.speaker_list, name='list-speakers'), url(r'^speaker/(?P[\w.@+-]+)$', views.user_details, name='show-speaker'), ] diff --git a/proposals/views.py b/proposals/views.py index 28afc68..da9dcd1 100644 --- a/proposals/views.py +++ b/proposals/views.py @@ -231,6 +231,15 @@ class TopicUpdate(OrgaRequiredMixin, TopicMixin, TopicFormMixin, UpdateView): pass +class TrackMixin(object): + def get_queryset(self): + return Track.objects.filter(site=get_current_site(self.request)).all() + + +class TrackList(LoginRequiredMixin, TrackMixin, ListView): + pass + + @login_required def vote(request, talk, score): talk = get_object_or_404(Talk, site=get_current_site(request), slug=talk)