Add show-speaker page
This commit is contained in:
parent
a81c9fddf7
commit
fa4c0fd132
6 changed files with 79 additions and 2 deletions
|
@ -13,6 +13,9 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<h2>Manage talks for: {{event.name}}</h2>
|
||||||
|
{% if pending_talks %}
|
||||||
|
<hr/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{% for presentation in pending_talks %}
|
{% for presentation in pending_talks %}
|
||||||
<form action="{% url 'schedule-event-talks' event.id %}" method="POST">
|
<form action="{% url 'schedule-event-talks' event.id %}" method="POST">
|
||||||
|
@ -35,6 +38,7 @@
|
||||||
</form>
|
</form>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if accepted_talks %}
|
{% if accepted_talks %}
|
||||||
<hr/>
|
<hr/>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -152,7 +152,7 @@
|
||||||
<td width="120px"><b>Presentations:</b></td>
|
<td width="120px"><b>Presentations:</b></td>
|
||||||
<td>
|
<td>
|
||||||
{% 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-profile' presentation.talk.speaker.user.id %}">{{presentation.talk.speaker.user}}</a>, {{presentation.talk.speaker.title}}</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.user}}, {{presentation.talk.speaker.title}}</a></div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<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>
|
||||||
{% if pending_presentations %}
|
{% if pending_presentations %}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
{% extends "get_together/base.html" %}
|
||||||
|
{% load markup static %}
|
||||||
|
|
||||||
|
{% block styles %}
|
||||||
|
<link href="{% static 'css/bootstrap-album.css' %}" rel="stylesheet"/>
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-9">
|
||||||
|
<img src="{{speaker.headshot.url}}"/><hr/>
|
||||||
|
<h3>{{ speaker.user }}</h3>
|
||||||
|
<h5 class="text-muted">{{ speaker.title }}</h5>
|
||||||
|
<p>
|
||||||
|
{{ speaker.bio|markdown }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{% if talks %}
|
||||||
|
<br/>
|
||||||
|
<h4>Talks</h4>
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
{% for talk in talks %}
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card box-shadow" >
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-title"><strong><a href="{% url 'show-talk' talk.id %}">{{talk.title}}</a></strong></p>
|
||||||
|
<div class="card-text">
|
||||||
|
<small class="text-muted mb-1">{{ talk.speaker }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col"><h4>Events ({{presentations.count}})</h4><hr/></div>
|
||||||
|
</div>
|
||||||
|
{% for presentation in presentations %}
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="col">
|
||||||
|
<h6 class="mt-2 mb-0"><a href="{{presentation.event.get_absolute_url}}">{{presentation.event.name}}</a></h6>
|
||||||
|
<small>{{ presentation.event.team }}</small><br/>
|
||||||
|
<small class="text-muted">{{ presentation.event.local_start_time }}</small>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Speaker:</b></td><td>{{ talk.speaker }}</td>
|
<td><b>Speaker:</b></td><td><a href="{% url 'show-speaker' talk.speaker.id %}">{{ talk.speaker.user }}, {{ talk.speaker.title }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><b>Category:</b></td><td>{{ talk.category }}</td>
|
<td><b>Category:</b></td><td>{{ talk.category }}</td>
|
||||||
|
@ -38,6 +38,7 @@
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<h6 class="mt-2 mb-0"><a href="{{presentation.event.get_absolute_url}}">{{presentation.event.name}}</a></h6>
|
<h6 class="mt-2 mb-0"><a href="{{presentation.event.get_absolute_url}}">{{presentation.event.name}}</a></h6>
|
||||||
|
<small>{{ presentation.event.team }}</small><br/>
|
||||||
<small class="text-muted">{{ presentation.event.local_start_time }}</small>
|
<small class="text-muted">{{ presentation.event.local_start_time }}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -50,6 +50,7 @@ urlpatterns = [
|
||||||
path('profile/<str:account_secret>.ics', feeds.UserEventsCalendar(), name='user-event-ical'),
|
path('profile/<str:account_secret>.ics', feeds.UserEventsCalendar(), name='user-event-ical'),
|
||||||
|
|
||||||
path('profile/+add-speaker', views.add_speaker, name='add-speaker'),
|
path('profile/+add-speaker', views.add_speaker, name='add-speaker'),
|
||||||
|
path('speaker/<int:speaker_id>/', views.show_speaker, name='show-speaker'),
|
||||||
path('speaker/<int:speaker_id>/+edit', views.edit_speaker, name='edit-speaker'),
|
path('speaker/<int:speaker_id>/+edit', views.edit_speaker, name='edit-speaker'),
|
||||||
path('speaker/<int:speaker_id>/+delete', views.delete_speaker, name='delete-speaker'),
|
path('speaker/<int:speaker_id>/+delete', views.delete_speaker, name='delete-speaker'),
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,16 @@ def list_user_talks(request):
|
||||||
}
|
}
|
||||||
return render(request, 'get_together/speakers/list_user_talks.html', context)
|
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):
|
def add_speaker(request):
|
||||||
new_speaker = Speaker(user=request.user.profile)
|
new_speaker = Speaker(user=request.user.profile)
|
||||||
if request.method == 'GET':
|
if request.method == 'GET':
|
||||||
|
|
Loading…
Reference in a new issue