Skip to content

Commit

Permalink
Merge pull request #371 from CTPUG/feature/add-section-around-speakers
Browse files Browse the repository at this point in the history
Add suitably marked section around speakers to allow styling the page.
  • Loading branch information
hodgestar committed Aug 23, 2017
2 parents 43a74d0 + 4e361d6 commit e5f6d29
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 27 deletions.
41 changes: 23 additions & 18 deletions wafer/talks/templates/wafer.talks/speakers.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@
{% load i18n %}
{% block title %}{% trans "Speakers" %} - {{ WAFER_CONFERENCE_NAME }}{% endblock %}
{% block content %}
<div class="container">
{% for row in speaker_rows %}
<div class="row">
{% for user_profile in row %}
<div class="col-md-3">
<a href="{% url 'wafer_user_profile' username=user_profile.user.username %}">
<img class="thumbnail mx-auto" src="{{ user_profile.avatar_url }}">
</a>
<a href="{% url 'wafer_user_profile' username=user_profile.user.username %}">
<h3 class="text-center">
{{ user_profile.display_name }}
</h3>
</a>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
<section class="wafer wafer-speakers">
<h1>{% trans 'Speakers' %}</h1>
<div class="container">
{% for row in speaker_rows %}
<div class="row">
{% for user_profile in row %}
<div class="col-md-3">
<div class="wafer-speakers-logo">
<a href="{% url 'wafer_user_profile' username=user_profile.user.username %}">
<img class="thumbnail mx-auto" src="{{ user_profile.avatar_url }}">
</a>
</div>
<div class="wafer-speakers-name">
<a href="{% url 'wafer_user_profile' username=user_profile.user.username %}">
{{ user_profile.display_name }}
</a>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</section>
{% endblock %}
25 changes: 16 additions & 9 deletions wafer/talks/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,18 +375,25 @@ def test_view_one_speaker(self):
reverse('wafer_talks_speakers'))
self.assertEqual(response.status_code, 200)
self.assertContains(response, "\n".join([
'<div class="container">',
'<div class="row">',
'<section class="wafer wafer-speakers">',
'<h1>Speakers</h1>'
'<div class="container">'
' <div class="row">',
' <div class="col-md-3">',
' <a href="/users/%s/">' % username,
' <img class="thumbnail mx-auto" src="%s">' % img,
' </a>',
' <a href="/users/%s/">' % username,
' <h3 class="text-center">author_a</h3>',
' </a>',
' <div class="wafer-speakers-logo">',
' <a href="/users/%s/">' % username,
' <img class="thumbnail mx-auto" src="%s">' % img,
' </a>',
' </div>',
' <div class="wafer-speakers-name">',
' <a href="/users/%s/">' % username,
' author_a',
' </a>',
' </div>',
' </div>',
' </div>',
'</div>',
'</div>',
'</section>',
]), html=True)

def check_n_speakers(self, n, expected_rows):
Expand Down

0 comments on commit e5f6d29

Please sign in to comment.