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

Add local partner to partners page

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