Cleanup speaker display when no title is given
This commit is contained in:
parent
3e0ba04aea
commit
9170eee9a9
4 changed files with 14 additions and 8 deletions
|
@ -42,9 +42,10 @@ class Speaker(models.Model):
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.title:
|
if self.title is not None and self.title != '':
|
||||||
return self.title
|
return '%s, %s' % (self.user, self.title)
|
||||||
return self.user.__str__()
|
else:
|
||||||
|
return str(self.user)
|
||||||
|
|
||||||
class Talk(models.Model):
|
class Talk(models.Model):
|
||||||
PRESENTATION=0
|
PRESENTATION=0
|
||||||
|
@ -79,7 +80,8 @@ class Talk(models.Model):
|
||||||
return self.presentations.filter(status=1, event__start_time__lte=timezone.now())
|
return self.presentations.filter(status=1, event__start_time__lte=timezone.now())
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.title
|
self.title
|
||||||
|
|
||||||
|
|
||||||
class SpeakerRequest(models.Model):
|
class SpeakerRequest(models.Model):
|
||||||
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
event = models.ForeignKey(Event, on_delete=models.CASCADE)
|
||||||
|
|
|
@ -207,7 +207,7 @@ textarea {
|
||||||
<div class="col-3" width="120px"><b>Presentations:</b></div>
|
<div class="col-3" width="120px"><b>Presentations:</b></div>
|
||||||
<div class="col-9">
|
<div class="col-9">
|
||||||
{% for presentation in presentation_list %}
|
{% for presentation in presentation_list %}
|
||||||
<div><a href="{% url 'show-talk' presentation.talk.id %}">{{presentation.talk.title}}</a> by <a href="{% url 'show-speaker' presentation.talk.speaker.id %}">{{presentation.talk.speaker.user}}, {{presentation.talk.speaker.title}}</a></div>
|
<div><a href="{% url 'show-talk' presentation.talk.id %}">{{presentation.talk.title}}</a> by <a href="{% url 'show-speaker' presentation.talk.speaker.id %}">{{presentation.talk.speaker}}</a></div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if not event.is_over %}
|
{% if not event.is_over %}
|
||||||
<a class="btn btn-primary btn-sm" href="{% url 'propose-event-talk' event.id %}">Propose a talk</a>
|
<a class="btn btn-primary btn-sm" href="{% url 'propose-event-talk' event.id %}">Propose a talk</a>
|
||||||
|
|
|
@ -10,9 +10,13 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<img src="{{speaker.headshot_url}}"/><hr/>
|
<img src="{{speaker.headshot_url}}"/>
|
||||||
|
{% if speaker.user == request.user.profile %}
|
||||||
|
<a href="{% url 'edit-speaker' speaker.id %}" class="btn btn-secondary btn-sm">Edit Bio</a>
|
||||||
|
{% endif %}
|
||||||
|
<hr/>
|
||||||
<h3>{{ speaker.user }}</h3>
|
<h3>{{ speaker.user }}</h3>
|
||||||
<h5 class="text-muted">{{ speaker.title }}</h5>
|
{% if speaker.title %}<h5 class="text-muted">{{ speaker.title }}</h5>{% endif %}
|
||||||
<p>
|
<p>
|
||||||
{{ speaker.bio|markdown }}
|
{{ speaker.bio|markdown }}
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Speaker:</b></td><td><a href="{% url 'show-speaker' talk.speaker.id %}">{{ talk.speaker.user }}, {{ talk.speaker.title }}</a></td>
|
<td><b>Speaker:</b></td><td><a href="{% url 'show-speaker' talk.speaker.id %}">{{ talk.speaker }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Category:</b></td><td>{{ talk.category }}</td>
|
<td><b>Category:</b></td><td>{{ talk.category }}</td>
|
||||||
|
|
Loading…
Reference in a new issue