Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show all speakers of a presentation

  • Loading branch information...
commit c1ff1546fe433970308e1aa894caa14c130cd177 1 parent 6f172da
Luke Hatcher lukeman authored
2  symposion/schedule/models.py
View
@@ -117,7 +117,7 @@ class Presentation(models.Model):
description = MarkupField()
abstract = MarkupField()
speaker = models.ForeignKey("speakers.Speaker", related_name="presentations")
- additional_speakers = models.ManyToManyField("speakers.Speaker", blank=True)
+ additional_speakers = models.ManyToManyField("speakers.Speaker", related_name="copresentations", blank=True)
cancelled = models.BooleanField(default=False)
proposal_base = models.OneToOneField(ProposalBase, related_name="presentation")
section = models.ForeignKey(Section, related_name="presentations")
10 symposion/speakers/models.py
View
@@ -42,3 +42,13 @@ def email(self):
return self.user.email
else:
return self.invite_email
+
+ @property
+ def all_presentations(self):
+ presentations = []
+ if self.presentations:
+ for p in self.presentations.all():
+ presentations.append(p)
+ for p in self.copresentations.all():
+ presentations.append(p)
+ return presentations
5 symposion/speakers/views.py
View
@@ -126,10 +126,11 @@ def speaker_edit(request, pk=None):
def speaker_profile(request, pk):
speaker = get_object_or_404(Speaker, pk=pk)
-
- if not speaker.presentations and not request.user.is_staff:
+ presentations = speaker.all_presentations
+ if not presentations and not request.user.is_staff:
raise Http404()
return render(request, "speakers/speaker_profile.html", {
"speaker": speaker,
+ "presentations": presentations,
})
37 symposion/templates/schedule/presentation_detail.html
View
@@ -1,38 +1,35 @@
{% extends "site_base.html" %}
+{% load sitetree %}
+
{% block head_title %}Presentation: {{ presentation.title }}{% endblock %}
+{% block breadcrumbs %}{% sitetree_breadcrumbs from "main" %}{% endblock %}
+
{% block body %}
-
- <h1>{{ presentation.title }}</h1>
+ {% if presentation.slot %}
+ <h4>
+ {{ presentation.slot.day.date|date:"l" }}
+ {{ presentation.slot.start}}&ndash;{{ presentation.slot.end }}
+ </h4>
+ {% endif %}
+ <h2>{{ presentation.title }}</h2>
- <h2>
+ <h4>
{% for speaker in presentation.speakers %}
- <a href="{% url speaker_profile speaker.pk %}">{{ speaker }}</a>
- {% if not forloop.last %}, {% endif %}{% endfor %}
- </h2>
-
+ <a href="{% url speaker_profile speaker.pk %}">{{ speaker }}</a>{% if not forloop.last %}, {% endif %}{% endfor %}
+ </h4>
+
<dl class="dl-horizontal">
<dt>Audience level:</dt>
<dd style="margin-bottom: 0;">{{ presentation.proposal.get_audience_level_display }}</dd>
- <dt>Track:</dt>
- <dd>{{ presentation.proposal.track }}</dd>
</dl>
-
- {% if presentation.slot %}
- <h2>
- {{ presentation.slot.day.date|date:"l" }}
- {{ presentation.slot.start}}&ndash;{{ presentation.slot.end }}
- in
- {{ presentation.slot.rooms|join:", " }}
- </h2>
- {% endif %}
<h3>Description</h3>
<div class="description">{{ presentation.description }}</div>
-
+
<h3>Abstract</h3>
-
+
<div class="abstract">{{ presentation.abstract|safe }}</div>
{% endblock %}
4 symposion/templates/speakers/speaker_profile.html
View
@@ -4,7 +4,7 @@
{% load thumbnail %}
-{% block page_title %}{% endblock %}
+{% block head_title %}{{ speaker.name }}{% endblock %}
{% block body %}
<div class="row">
@@ -23,7 +23,7 @@
<div class="bio">{{ speaker.biography|safe }}</div>
<h2>Presentations</h2>
- {% for presentation in speaker.presentations.all %}
+ {% for presentation in presentations %}
<h3><a href="{% url schedule_presentation_detail presentation.pk %}">{{ presentation.title }}</a></h3>
{% if presentation.slot %}
<p>
Please sign in to comment.
Something went wrong with that request. Please try again.