Commit e253efce authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '307-prominenter-in-beeld-brengen-van-huidig-bestuur' into 'master'

Changes board page to show older boards below

Closes #307

See merge request !375
parents 6ef7c2b7 e0040dd1
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-30 18:53+0100\n"
"POT-Creation-Date: 2017-03-13 21:12+0100\n"
"PO-Revision-Date: 2017-01-30 18:54+0100\n"
"Last-Translator: Joost Rijneveld <joost@joostrijneveld.nl>\n"
"Language-Team: \n"
......@@ -143,14 +143,13 @@ msgstr "{name} mentor in {year}"
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_detail.html:8
#: templates/activemembers/board_index.html:32
#: templates/activemembers/board_index.html:37
#: templates/activemembers/board_index.html:45
#: templates/activemembers/board_index.html:50
msgid "Board"
msgstr "Besturen"
msgstr "Bestuur"
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_index.html:3
#: templates/activemembers/board_index.html:6
msgid "Boards"
msgstr "Besturen"
......@@ -167,6 +166,10 @@ msgstr "Voorzitter"
msgid "This board doesn't have any members?"
msgstr "Dit bestuur heeft geen leden?"
#: templates/activemembers/board_index.html:6
msgid "The board"
msgstr "Het bestuur"
#: templates/activemembers/board_index.html:9
msgid ""
"Thalia's board makes sure all operations during the academic year are taken "
......@@ -180,14 +183,18 @@ msgstr ""
"schermen. Bij vragen en opmerkingen kun je ze altijd persoonlijk aanspreken "
"of <a href=\"mailto:info@thalia.nu\">mailen</a>."
#: templates/activemembers/board_index.html:24
#: templates/activemembers/board_index.html:27
msgid "Old boards"
msgstr "Oude besturen"
#: templates/activemembers/board_index.html:37
#: templates/activemembers/committee_detail.html:18
#: templates/activemembers/committee_detail.html:20
#, python-format
msgid "Photo of %(name)s"
msgstr "Foto van %(name)s"
#: templates/activemembers/board_index.html:44
#: templates/activemembers/board_index.html:57
msgid "There are no boards!"
msgstr "Er zijn geen besturen!"
......@@ -221,12 +228,3 @@ msgstr "Deze commissie heeft geen leden?"
#: templates/activemembers/committee_index.html:39
msgid "There are no committees!"
msgstr "Er zijn geen commissies!"
#~ msgid "Membership expiration date can't be in the future: '{}'"
#~ msgstr "Een lidmaatschap kan niet verlopen in de toekomst: '{}'"
#~ msgid "This member is already in the committee"
#~ msgstr "Deze persoon is al lid van deze commissie"
#~ msgid "Mentors {year}-{year_to}"
#~ msgstr "Mentoren {year}-{year_to}"
......@@ -4,7 +4,7 @@
{% block opengraph_title %}{% trans 'Boards' %} — {{ block.super }}{% endblock %}
{% block body %}
<h1>{% trans 'Boards' %}</h1>
<h1>{% trans 'The board' %}</h1>
<p style="text-align: center;">
{% blocktrans trimmed %}
......@@ -13,38 +13,53 @@
</p>
<div class="clearfix portfolio">
<div id="committees">
<ul class="row committees">
{% for board in boards %}
<li class="post member-item span3 has-overlay">
<a href="{{ board.get_absolute_url }}">
<div class="post-inner">
<div class="inner-img">
{% if board.photo %}
<img src="{% thumbnail board.photo '220x220' fit=False %}" alt="{% blocktrans with name=board.name %}Photo of {{ name }}{% endblocktrans %}">
{% else %}
<img height="220" width="220" src="{% static 'activemembers/images/placeholder.png' %}">
{% endif %}
</div>
<div class="post-overlay">
<div class="post-overlay-meta">
<h2>{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }}</h2>
<div id="committee-div">
<a href="{{ board.get_absolute_url }}">
<div class="row">
{% if board.photo %}
<img alt="{{ board.name }}" class="span12" src="{% thumbnail board.photo '1024x683' fit=False %}">
{% else %}
<img alt="{{ board.name }}" class="span12" src="{% static 'activemembers/images/placeholder.png' %}">
{% endif %}
</div>
</a>
<div class="clearfix">
<h1 class="midhead">{% trans 'Old boards' %}</h1>
<div id="committees">
<ul class="row committees">
{% for board in old_boards %}
<li class="post member-item span3 has-overlay">
<a href="{{ board.get_absolute_url }}">
<div class="post-inner">
<div class="inner-img">
{% if board.photo %}
<img src="{% thumbnail board.photo '220x220' fit=False %}" alt="{% blocktrans with name=board.name %}Photo of {{ name }}{% endblocktrans %}">
{% else %}
<img height="220" width="220" src="{% static 'activemembers/images/placeholder.png' %}">
{% endif %}
</div>
<div class="post-overlay">
<div class="post-overlay-meta">
<h2>{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }}</h2>
</div>
</div>
<div class="post-body avatar-subtitle">
{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }}
</div>
</div>
</div>
<div class="post-body avatar-subtitle">
{% trans "Board" %} {{ board.since.year }}-{{ board.until.year }}
</div>
</div>
</a>
</li>
{% empty %}
{% trans 'There are no boards!' %}
{% endfor %}
</ul>
</a>
</li>
{% empty %}
{% trans 'There are no boards!' %}
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
{% endblock %}
......@@ -15,5 +15,4 @@ urlpatterns = [
url(r'^boards/$', views.board_index, name='boards'),
url(r'^board/(?P<since>\d{4})$', views.board_detail, name='board'),
url(r'^board/(?P<since>\d{4})-(?P<until>\d{4})$', views.board_detail, name='board'),
url(r'^board$', views.current_board, name='current-board'),
]
from django.shortcuts import get_object_or_404, render, redirect, reverse
import datetime
from utils.snippets import datetime_to_lectureyear
from utils.translation import localize_attr_name
from .models import Board, Committee, CommitteeMembership
......@@ -37,11 +38,15 @@ def committee_detail(request, id):
def board_index(request):
boards = Board.objects.all()
current_year = datetime_to_lectureyear(datetime.date.today())
board = get_object_or_404(
Board, since__year=current_year, until__year=current_year+1)
old_boards = Board.objects.all().exclude(pk=board.pk)
return render(request,
'activemembers/board_index.html',
{'boards': boards})
{'old_boards': old_boards,
'board': board
})
def board_detail(request, since, until=None):
......@@ -66,11 +71,3 @@ def board_detail(request, since, until=None):
return render(request, 'activemembers/board_detail.html',
{'board': board,
'members': members})
def current_board(request):
try:
board = Board.objects.order_by('-since')[0]
except IndexError:
return redirect(reverse('activemembers:boards'))
return redirect(board.get_absolute_url())
......@@ -3,7 +3,7 @@ from django.utils.translation import ugettext_lazy as _
main = [
{'title': _('Home'), 'name': 'index'},
{'title': _('Association'), 'name': 'association', 'submenu': [
{'title': _('Board'), 'name': 'activemembers:current-board'},
{'title': _('Board'), 'name': 'activemembers:boards'},
{'title': _('Committees'), 'name': 'activemembers:committees'},
{'title': _('Documents'), 'name': 'documents:index'},
{'title': _('Merchandise'), 'name': 'merchandise:index'},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment