Unverified Commit 47128457 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'release/1.0.0'

parents c0e1e9bc 96acee11
...@@ -10,7 +10,7 @@ class CommitteeAdmin(TranslatedModelAdmin): ...@@ -10,7 +10,7 @@ class CommitteeAdmin(TranslatedModelAdmin):
list_filter = ('until',) list_filter = ('until',)
fields = ('name', 'description', 'photo', 'permissions', fields = ('name', 'description', 'photo', 'permissions',
'since', 'until', 'contact_email', 'wiki_namespace',) 'since', 'until', 'contact_email', 'wiki_namespace', 'active')
def get_queryset(self, request): def get_queryset(self, request):
qs = super().get_queryset(request) qs = super().get_queryset(request)
...@@ -21,7 +21,7 @@ class CommitteeAdmin(TranslatedModelAdmin): ...@@ -21,7 +21,7 @@ class CommitteeAdmin(TranslatedModelAdmin):
class BoardAdmin(TranslatedModelAdmin): class BoardAdmin(TranslatedModelAdmin):
exclude = ('is_board',) exclude = ('is_board',)
fields = ('name', 'description', 'photo', 'permissions', fields = ('name', 'photo', 'permissions',
'since', 'until',) 'since', 'until',)
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n static bleach_tags%} {% load i18n static bleach_tags thumbnail %}
{% block title %}{{ event.title }} — {% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %} {% block title %}{{ event.title }} — {% trans "Calendar"|capfirst %} — {{ block.super }}{% endblock %}
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
<a href="#"> <a href="#">
<div class="post-inner"> <div class="post-inner">
<div class="inner-img"> <div class="inner-img">
<img src="{% static "members/images/default-avatar.jpg" %}"> <img alt="{{ registration.name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
</div> </div>
<div class="post-overlay"> <div class="post-overlay">
<div class="post-overlay-meta"> <div class="post-overlay-meta">
...@@ -196,7 +196,11 @@ ...@@ -196,7 +196,11 @@
<a href="{% url 'members:profile' pk=registration.member.pk %}"> <a href="{% url 'members:profile' pk=registration.member.pk %}">
<div class="post-inner"> <div class="post-inner">
<div class="inner-img"> <div class="inner-img">
<img src="{% if not registration.member.photo %}{% static "members/images/default-avatar.jpg" %}{% else %}{{ registration.member.photo.url }}{% endif %}" alt="{{ registration.member.display_name }}" /> {% if not registration.member.photo %}
<img alt="{{ member.display_name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
{% else %}
<img alt="{{ member.display_name }}" src="{% thumbnail registration.member.photo '220x220' %}" width="220" height="220" />
{% endif %}
</div> </div>
<div class="post-overlay"> <div class="post-overlay">
<div class="post-overlay-meta"> <div class="post-overlay-meta">
......
...@@ -232,7 +232,9 @@ def registration(request, event_id, action=None): ...@@ -232,7 +232,9 @@ def registration(request, event_id, action=None):
elif action == 'cancel': elif action == 'cancel':
if (obj is not None and if (obj is not None and
obj.date_cancelled is None): obj.date_cancelled is None):
if event.max_participants is not None: if (event.max_participants is not None and
Registration.objects.filter(event=event).count() >=
event.max_participants):
# Prepare email to send to the first person on the waiting # Prepare email to send to the first person on the waiting
# list # list
first_waiting = (Registration.objects first_waiting = (Registration.objects
......
...@@ -17,8 +17,12 @@ from members.models import Member, Membership ...@@ -17,8 +17,12 @@ from members.models import Member, Membership
def imagefield_from_url(imagefield, url): def imagefield_from_url(imagefield, url):
basename = os.path.basename(url)
if '?' in basename:
basename = '?'.join(basename.split('?')[:-1])
file = ContentFile(requests.get(url).content) file = ContentFile(requests.get(url).content)
imagefield.save(os.path.basename(url), file) imagefield.save(basename, file)
class Command(BaseCommand): class Command(BaseCommand):
...@@ -69,6 +73,8 @@ class Command(BaseCommand): ...@@ -69,6 +73,8 @@ class Command(BaseCommand):
obj, cr = Committee.objects.get_or_create( obj, cr = Committee.objects.get_or_create(
name_nl=committee['name']) name_nl=committee['name'])
obj.name_en = committee['name'] obj.name_en = committee['name']
# Committees are active by default
obj.active = True
print(obj.name_en) print(obj.name_en)
groups[committee['gID']] = obj groups[committee['gID']] = obj
obj.save() obj.save()
...@@ -106,7 +112,9 @@ class Command(BaseCommand): ...@@ -106,7 +112,9 @@ class Command(BaseCommand):
'': None, '': None,
}[member['study']] }[member['study']]
if member['student_number']: if member['student_number']:
user.member.student_number = 's'+member['student_number'] if not len(member['student_number']) == 8:
member['student_number'] = 's' + member['student_number']
user.member.student_number = member['student_number']
if member['member_since']: if member['member_since']:
# This is as best as we can do, although this may be incorrect # This is as best as we can do, although this may be incorrect
user.member.starting_year = member['member_since'] user.member.starting_year = member['member_since']
......
...@@ -313,13 +313,15 @@ class Member(models.Model): ...@@ -313,13 +313,15 @@ class Member(models.Model):
def display_name(self): def display_name(self):
pref = self.display_name_preference pref = self.display_name_preference
if pref == 'nickname': if pref == 'nickname' and self.nickname is not None:
return self.nickname return self.nickname
if pref == 'firstname': if pref == 'firstname':
return self.user.first_name return self.user.first_name
elif pref == 'initials': elif pref == 'initials':
return '{} {}'.format(self.initials, self.user.last_name) if self.initials:
elif pref == 'fullnick': return '{} {}'.format(self.initials, self.user.last_name)
return self.user.last_name
elif pref == 'fullnick' and self.nickname is not None:
return "{} '{}' {}".format(self.user.first_name, return "{} '{}' {}".format(self.user.first_name,
self.nickname, self.nickname,
self.user.last_name) self.user.last_name)
...@@ -332,10 +334,13 @@ class Member(models.Model): ...@@ -332,10 +334,13 @@ class Member(models.Model):
def short_display_name(self): def short_display_name(self):
pref = self.display_name_preference pref = self.display_name_preference
if pref == 'nickname' or pref == 'nicklast': if (self.nickname is not None and
(pref == 'nickname' or pref == 'nicklast')):
return self.nickname return self.nickname
elif pref == 'initials': elif pref == 'initials':
return '{} {}'.format(self.initials, self.user.last_name) if self.initials:
return '{} {}'.format(self.initials, self.user.last_name)
return self.user.last_name
else: else:
return self.user.first_name return self.user.first_name
return return
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% load thumbnail %}
{% block title %}{% trans "members"|capfirst %} — {{ block.super }}{% endblock %} {% block title %}{% trans "members"|capfirst %} — {{ block.super }}{% endblock %}
...@@ -54,7 +55,11 @@ ...@@ -54,7 +55,11 @@
<a href="{% url 'members:profile' pk=member.pk %}"> <a href="{% url 'members:profile' pk=member.pk %}">
<div class="post-inner"> <div class="post-inner">
<div class="inner-img"> <div class="inner-img">
<img src="{% if not member.photo %}{% static "members/images/default-avatar.jpg" %}{% else %}{{ member.photo.url }}{% endif %}" alt="{{ member.username }}" /> {% if not member.photo %}
<img alt="{{ member.display_name }}" src="{% static 'members/images/default-avatar.jpg' %}" height="220" width="220" />
{% else %}
<img alt="{{ member.display_name }}" src="{% thumbnail member.photo '220x220' %}" width="220" height="220" />
{% endif %}
</div> </div>
<div class="post-overlay"> <div class="post-overlay">
<div class="post-overlay-meta"> <div class="post-overlay-meta">
...@@ -102,4 +107,4 @@ ...@@ -102,4 +107,4 @@
</ul> </ul>
</div> </div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
{% if period.chair %} {% if period.chair %}
<span style="text-transform:inherit;">Voorzitter: </span> <span style="text-transform:inherit;">Voorzitter: </span>
{% endif %} {% endif %}
<i>{{ period.since }} - {% if period.until %}{{ period.until }}{% else %}{% trans "today" %}{% endif %}</i> <i>{% if period.since|date:'Y m d' == '1970 01 01' %}?{% else %}{{ period.since }}{% endif %} - {% if period.until %}{{ period.until }}{% else %}{% trans "today" %}{% endif %}</i>
<br> <br>
{% endfor %} {% endfor %}
</li> </li>
...@@ -68,4 +68,4 @@ ...@@ -68,4 +68,4 @@
</div> </div>
<!-- /portfolio single content --> <!-- /portfolio single content -->
</div> </div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -38,7 +38,7 @@ def index(request): ...@@ -38,7 +38,7 @@ def index(request):
query_filter == 'old'): query_filter == 'old'):
members_query &= Q(starting_year=int(query_filter)) members_query &= Q(starting_year=int(query_filter))
elif query_filter == 'old': elif query_filter == 'old':
memberships_query &= Q(starting_year__lt=start_year) members_query &= Q(starting_year__lt=start_year)
elif query_filter == 'ex': elif query_filter == 'ex':
memberships = models.Membership.objects.filter(memberships_query) memberships = models.Membership.objects.filter(memberships_query)
members_query &= ~Q(user__in=memberships.values('user')) members_query &= ~Q(user__in=memberships.values('user'))
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
{% load staticfiles %} {% load staticfiles %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Merchandise" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Merchandise" %}</h1> <h1>{% trans "Merchandise" %}</h1>
......
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Partners" %} — {% trans "Career" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Our partners" %}</h1> <h1>{% trans "Our partners" %}</h1>
...@@ -73,4 +75,4 @@ ...@@ -73,4 +75,4 @@
</div> </div>
</div> </div>
{% endblock body %} {% endblock body %}
\ No newline at end of file
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n bleach_tags %} {% load i18n bleach_tags %}
{% block title %}{{ partner.name }} — {% trans "Partners" %} — {% trans "Career" %} — {{ block.super }}{% endblock %}
{% block header_image %}{% spaceless %} {% block header_image %}{% spaceless %}
{% if partner.site_header %} {% if partner.site_header %}
{{ partner.site_header.url }} {{ partner.site_header.url }}
......
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n bleach_tags %} {% load i18n bleach_tags %}
{% block title %}{% trans "Vacancies" %} — {% trans "Career" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Vacancies" %}</h1> <h1>{% trans "Vacancies" %}</h1>
<p class="tcenter"> <p class="tcenter">
......
...@@ -21,7 +21,7 @@ class Command(BaseCommand): ...@@ -21,7 +21,7 @@ class Command(BaseCommand):
raise Exception("You must specify a directory to import") raise Exception("You must specify a directory to import")
foldername = os.path.relpath(options['folder']) foldername = os.path.relpath(options['folder'])
album, date, title = foldername.split('_') album, date, title = foldername.split('_', maxsplit=2)
date = parse_date('{}-{}-{}'.format(date[:4], date[4:6], date[6:])) date = parse_date('{}-{}-{}'.format(date[:4], date[4:6], date[6:]))
slug = slugify('-'.join([str(date), title])) slug = slugify('-'.join([str(date), title]))
......
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n thumbnail %} {% load i18n thumbnail %}
{% block title %}{% trans "Thabloid" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Thabloid" %}</h1>
<div class="portfolio portfolio-isotope"> <div class="portfolio portfolio-isotope">
<div class="portfolio-filter tabs-wrapper tabs-centered clearfix"> <div class="portfolio-filter tabs-wrapper tabs-centered clearfix">
<ul class="tabs"> <ul class="tabs">
...@@ -58,4 +62,4 @@ ...@@ -58,4 +62,4 @@
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -8,7 +8,7 @@ msgstr "" ...@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-10-26 20:26+0200\n" "POT-Creation-Date: 2016-10-26 20:26+0200\n"
"PO-Revision-Date: 2016-10-23 00:28+0200\n" "PO-Revision-Date: 2016-12-06 20:15+0100\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 1.8.10\n" "X-Generator: Poedit 1.8.11\n"
#: thaliawebsite/admin.py:4 #: thaliawebsite/admin.py:4
msgid "Thalia administration" msgid "Thalia administration"
...@@ -103,7 +103,7 @@ msgstr "Carrière" ...@@ -103,7 +103,7 @@ msgstr "Carrière"
#: thaliawebsite/menus.py:25 #: thaliawebsite/menus.py:25
msgid "Partners" msgid "Partners"
msgstr "Sponsoren" msgstr "Partners"
#: thaliawebsite/menus.py:26 #: thaliawebsite/menus.py:26
msgid "Vacancies" msgid "Vacancies"
......
...@@ -4613,7 +4613,7 @@ li.backLava:before { ...@@ -4613,7 +4613,7 @@ li.backLava:before {
/*Bootstrap being overwriten by tags*/ /*Bootstrap being overwriten by tags*/
.thimbus-page { .thimbus-page {
.portfolio, .blog, .gallery { .portfolio, .blog, .gallery, .member-directory {
.row { .row {
margin-left: -20px; margin-left: -20px;
} }
......
...@@ -824,11 +824,3 @@ jQuery(document).ready(function() { ...@@ -824,11 +824,3 @@ jQuery(document).ready(function() {
padding: 0 padding: 0
}); });
}); });
jQuery(document).ready(function() {
$('.member-item img').on('error', function(e) {
if (e.target.src.indexOf('gravatarmissing.png') == -1) {
e.target.src = '/packages/theme_thimbus/themes/thimbus/assets/images/gravatarmissing.png';
}
});
});
\ No newline at end of file
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Association" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Thalia, the study association of Computer Science and Information Science"|upper %}</h1> <h1>{% trans "Thalia, the study association of Computer Science and Information Science"|upper %}</h1>
......
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans "Become a Member" %} — {{ block.super }}{% endblock %}
{% block body %} {% block body %}
<h1>{% trans "Become a Member" %}</h1> <h1>{% trans "Become a Member" %}</h1>
......
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