From fa4c0fd1326a5535a88d6060f10c7e851a222f5c Mon Sep 17 00:00:00 2001 From: Michael Hall Date: Fri, 27 Apr 2018 22:49:56 -0400 Subject: [PATCH] Add show-speaker page --- .../events/schedule_event_talks.html | 4 ++ .../get_together/events/show_event.html | 2 +- .../get_together/speakers/show_speaker.html | 61 +++++++++++++++++++ .../get_together/speakers/show_talk.html | 3 +- get_together/urls.py | 1 + get_together/views/speakers.py | 10 +++ 6 files changed, 79 insertions(+), 2 deletions(-) diff --git a/get_together/templates/get_together/events/schedule_event_talks.html b/get_together/templates/get_together/events/schedule_event_talks.html index 218dd6b..f35f2dc 100644 --- a/get_together/templates/get_together/events/schedule_event_talks.html +++ b/get_together/templates/get_together/events/schedule_event_talks.html @@ -13,6 +13,9 @@ {% endif %}
+

Manage talks for: {{event.name}}

+{% if pending_talks %} +
{% for presentation in pending_talks %}
@@ -35,6 +38,7 @@
{% endfor %}
+{% endif %} {% if accepted_talks %}
diff --git a/get_together/templates/get_together/events/show_event.html b/get_together/templates/get_together/events/show_event.html index 74530f4..846ff9f 100644 --- a/get_together/templates/get_together/events/show_event.html +++ b/get_together/templates/get_together/events/show_event.html @@ -152,7 +152,7 @@ Presentations: {% for presentation in presentation_list %} -
{{presentation.talk.title}} by {{presentation.talk.speaker.user}}, {{presentation.talk.speaker.title}}
+
{{presentation.talk.title}} by {{presentation.talk.speaker.user}}, {{presentation.talk.speaker.title}}
{% endfor %} Propose a talk {% if pending_presentations %} diff --git a/get_together/templates/get_together/speakers/show_speaker.html b/get_together/templates/get_together/speakers/show_speaker.html index e69de29..541fdd9 100644 --- a/get_together/templates/get_together/speakers/show_speaker.html +++ b/get_together/templates/get_together/speakers/show_speaker.html @@ -0,0 +1,61 @@ +{% extends "get_together/base.html" %} +{% load markup static %} + +{% block styles %} + + +{% endblock %} + +{% block content %} +
+
+
+
+

{{ speaker.user }}

+
{{ speaker.title }}
+

+ {{ speaker.bio|markdown }} +

+ +{% if talks %} +
+

Talks

+
+
+ {% for talk in talks %} +
+
+
+

{{talk.title}}

+
+ {{ talk.speaker }} +
+
+
+
+ {% endfor %} +
+
+{% endif %} +
+
+
+
+

Events ({{presentations.count}})


+
+ {% for presentation in presentations %} +
+
+
{{presentation.event.name}}
+ {{ presentation.event.team }}
+ {{ presentation.event.local_start_time }} +
+
+ {% endfor %} +
+
+ +
+
+{% endblock %} + diff --git a/get_together/templates/get_together/speakers/show_talk.html b/get_together/templates/get_together/speakers/show_talk.html index 1905d92..bfe0f66 100644 --- a/get_together/templates/get_together/speakers/show_talk.html +++ b/get_together/templates/get_together/speakers/show_talk.html @@ -12,7 +12,7 @@ - + @@ -38,6 +38,7 @@
{{presentation.event.name}}
+ {{ presentation.event.team }}
{{ presentation.event.local_start_time }}
diff --git a/get_together/urls.py b/get_together/urls.py index 6bb8510..24da216 100644 --- a/get_together/urls.py +++ b/get_together/urls.py @@ -50,6 +50,7 @@ urlpatterns = [ path('profile/.ics', feeds.UserEventsCalendar(), name='user-event-ical'), path('profile/+add-speaker', views.add_speaker, name='add-speaker'), + path('speaker//', views.show_speaker, name='show-speaker'), path('speaker//+edit', views.edit_speaker, name='edit-speaker'), path('speaker//+delete', views.delete_speaker, name='delete-speaker'), diff --git a/get_together/views/speakers.py b/get_together/views/speakers.py index 96d7938..217badd 100644 --- a/get_together/views/speakers.py +++ b/get_together/views/speakers.py @@ -34,6 +34,16 @@ def list_user_talks(request): } return render(request, 'get_together/speakers/list_user_talks.html', context) +def show_speaker(request, speaker_id): + speaker = get_object_or_404(Speaker, id=speaker_id) + + context = { + 'speaker': speaker, + 'talks': Talk.objects.filter(speaker=speaker), + 'presentations': Presentation.objects.filter(talk__speaker=speaker, status=Presentation.ACCEPTED), + } + return render(request, 'get_together/speakers/show_speaker.html', context) + def add_speaker(request): new_speaker = Speaker(user=request.user.profile) if request.method == 'GET':
Speaker:{{ talk.speaker }}Speaker:{{ talk.speaker.user }}, {{ talk.speaker.title }}
Category:{{ talk.category }}