Commit 117ec566 authored by Jelle Besseling's avatar Jelle Besseling

Merge branch 'partners-page-local' into 'master'

Add local partner to partners page

Closes #892

See merge request !1295
parents 24bd7f4a c9995018
This diff was suppressed by a .gitattributes entry.
......@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-06-07 14:29+0200\n"
"PO-Revision-Date: 2019-06-07 15:04+0200\n"
"POT-Creation-Date: 2019-06-20 16:40+0200\n"
"PO-Revision-Date: 2019-06-20 16:41+0200\n"
"Last-Translator: Sébastiaan Versteeg <se_bastiaan@outlook.com>\n"
"Language-Team: \n"
"Language: nl\n"
......@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.2.1\n"
"X-Generator: Poedit 2.2.3\n"
#: apps.py templates/partners/index.html templates/partners/partner.html
msgid "Partners"
......@@ -128,14 +128,18 @@ msgstr ""
"\">samenwerking@thalia.nu</a>."
#: templates/partners/index.html
msgid "Main Partner"
msgstr "Hoofdpartner"
msgid "our main partner"
msgstr "onze hoofdpartner"
#: templates/partners/index.html templates/partners/partner.html
#: templates/partners/vacancies.html templates/partners/vacancy_card.html
msgid "Learn more"
msgstr "Lees meer"
#: templates/partners/index.html
msgid "our local partner"
msgstr "onze localpartner"
#: templates/partners/partner.html
msgid "Address"
msgstr "Adres"
......
......@@ -21,15 +21,31 @@
</p>
<div class="row mt-4">
<div class="col-12 col-md-4 d-flex align-items-center">
<div class="col-12 col-md-6">
<div class="text-center">
<img src="{% thumbnail main_partner.logo THUMBNAIL_SIZE_MEDIUM fit=False %}"/>
</div>
<div class="col-12 col-md-8 mt-3 mt-md-0">
<h2>{% trans "Main Partner" %}</h2>
<div class="mt-3">
<h2>{% trans "our main partner"|capfirst %}</h2>
<h3>{{ main_partner.name }}</h3>
<p>{{ main_partner.company_profile|striptags|bleach|truncatechars:425 }}</p>
<a href="{{ main_partner.get_absolute_url }}" class="btn btn-secondary">{% trans "Learn more" %}</a>
<a href="{{ main_partner.get_absolute_url }}" class="btn btn-primary">{% trans "Learn more" %}</a>
</div>
</div>
<div class="col-12 col-md-6">
<div class="text-center">
<img src="{% thumbnail local_partner.logo THUMBNAIL_SIZE_MEDIUM fit=False %}"/>
</div>
<div class="mt-3">
<h2>{% trans "our local partner"|capfirst %}</h2>
<h3>{{ local_partner.name }}</h3>
<p>{{ local_partner.company_profile|striptags|bleach|truncatechars:425 }}</p>
<a href="{{ local_partner.get_absolute_url }}" class="btn btn-primary">{% trans "Learn more" %}</a>
</div>
</div>
</div>
<div class="row mt-4">
</div>
<div class="row mt-4">
......
......@@ -8,17 +8,17 @@ from partners.models import Partner, Vacancy, VacancyCategory
def index(request):
"""View to show overview page of partners."""
partners = Partner.objects.filter(is_active=True, is_main_partner=False)
try:
main_partner = Partner.objects.get(
is_active=True,
is_main_partner=True
)
except Partner.DoesNotExist:
main_partner = None
partners = Partner.objects.filter(
is_active=True,
is_main_partner=False,
is_local_partner=False
)
main_partner = Partner.objects.filter(is_main_partner=True).first()
local_partner = Partner.objects.filter(is_local_partner=True).first()
context = {
'main_partner': main_partner,
'local_partner': local_partner,
'partners': sorted(partners, key=lambda x: random()),
}
return render(request, 'partners/index.html', context)
......
Markdown is supported
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