From d7a8f23a9a0e7e26186435daef18fa1d112de28b Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 27 Jul 2016 21:20:39 +0200 Subject: [PATCH 1/5] Committee overview page --- website/committees/models.py | 5 +++ .../templates/committees/index.html | 41 +++++++++++++++++++ website/committees/urls.py | 12 ++++++ website/committees/views.py | 21 +++++++++- website/thaliawebsite/menus.py | 2 +- website/thaliawebsite/settings/settings.py | 2 + website/thaliawebsite/templates/base.html | 2 + website/thaliawebsite/urls.py | 10 ++++- 8 files changed, 90 insertions(+), 5 deletions(-) create mode 100644 website/committees/templates/committees/index.html create mode 100644 website/committees/urls.py diff --git a/website/committees/models.py b/website/committees/models.py index 78367dbd..63b34bd7 100644 --- a/website/committees/models.py +++ b/website/committees/models.py @@ -2,6 +2,7 @@ import datetime import logging from django.core.exceptions import ValidationError, NON_FIELD_ERRORS +from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django.db import models from django.utils import timezone @@ -45,6 +46,7 @@ class Committee(models.Model): photo = models.ImageField( verbose_name=_('Image'), + upload_to='public/committeephotos/', ) members = models.ManyToManyField( @@ -75,6 +77,9 @@ class Committee(models.Model): def __str__(self): return self.name + def get_absolute_url(self): + return reverse('committees:details', args=[str(self.pk)]) + class Meta: verbose_name = _('committee') verbose_name_plural = _('committees') diff --git a/website/committees/templates/committees/index.html b/website/committees/templates/committees/index.html new file mode 100644 index 00000000..6648dc43 --- /dev/null +++ b/website/committees/templates/committees/index.html @@ -0,0 +1,41 @@ +{% extends "base.html" %} +{% load i18n %} +{% block title %}{% trans 'Committees' %} — {{ block.super }}{% endblock %} +{% block page_title %}{% trans 'Committees' %}{% endblock %} + +{% block body %} +

{% trans 'Committees' %}

+ +
+
+ +
+
+{% endblock %} diff --git a/website/committees/urls.py b/website/committees/urls.py new file mode 100644 index 00000000..4a46fb58 --- /dev/null +++ b/website/committees/urls.py @@ -0,0 +1,12 @@ +""" +Committees URL Configuration +""" + +from django.conf.urls import url + +from . import views + +urlpatterns = [ + url(r'^$', views.index, name='index'), + url(r'^details/(?P\d)/$', views.details, name='details'), +] diff --git a/website/committees/views.py b/website/committees/views.py index fd0e0449..60c66b75 100644 --- a/website/committees/views.py +++ b/website/committees/views.py @@ -1,3 +1,20 @@ -# from django.shortcuts import render +from django.shortcuts import render, get_object_or_404 -# Create your views here. +from .models import Committee + + +def index(request): + """Overview of committees""" + committees = Committee.objects.all() + + return render(request, + 'committees/index.html', + {'committees': committees}) + + +def details(request, committee_id): + """View the details of a committee""" + committee = get_object_or_404(Committee, pk=committee_id) + + return render(request, 'committee/details.html', + {'committee': committee}) diff --git a/website/thaliawebsite/menus.py b/website/thaliawebsite/menus.py index 9572f730..dd61e580 100644 --- a/website/thaliawebsite/menus.py +++ b/website/thaliawebsite/menus.py @@ -4,7 +4,7 @@ main = [ {'title': _('Home'), 'name': 'index'}, {'title': _('Association'), 'name': '#', 'submenu': [ {'title': _('Board'), 'name': '#'}, - {'title': _('Committees'), 'name': '#'}, + {'title': _('Committees'), 'name': 'committees:index'}, {'title': _('Members'), 'name': '#'}, {'title': _('Documents'), 'name': 'documents:index'}, {'title': _('Members'), 'name': '#'}, diff --git a/website/thaliawebsite/settings/settings.py b/website/thaliawebsite/settings/settings.py index 823fb2ba..0d04375e 100644 --- a/website/thaliawebsite/settings/settings.py +++ b/website/thaliawebsite/settings/settings.py @@ -71,6 +71,7 @@ TEMPLATES = [ 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', + 'django.template.context_processors.media', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], @@ -146,6 +147,7 @@ LOCALE_PATHS = ('locale',) # Where to store uploaded files MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_URL = '/media/public/' SENDFILE_BACKEND = 'sendfile.backends.development' diff --git a/website/thaliawebsite/templates/base.html b/website/thaliawebsite/templates/base.html index a103d625..2b838ad3 100644 --- a/website/thaliawebsite/templates/base.html +++ b/website/thaliawebsite/templates/base.html @@ -6,6 +6,8 @@ +{% block title %}{% trans "Study Association Thalia" %}{% endblock %} + diff --git a/website/thaliawebsite/urls.py b/website/thaliawebsite/urls.py index 12dc953f..80363d81 100644 --- a/website/thaliawebsite/urls.py +++ b/website/thaliawebsite/urls.py @@ -13,7 +13,11 @@ Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ +import os.path + +from django.conf import settings from django.conf.urls import url, include +from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView @@ -23,8 +27,9 @@ urlpatterns = [ url(r'^members/', include('members.urls')), url(r'^nyi$', TemplateView.as_view(template_name='status/nyi.html'), name='#'), url(r'^association/', include([ - url(r'^sister-associations', TemplateView.as_view(template_name='singlepages/sister_associations.html'), name='sister-associations'), + url(r'^committees/', include('committees.urls', namespace='committees')), url(r'^documents/', include('documents.urls', namespace='documents')), + url(r'^sister-associations', TemplateView.as_view(template_name='singlepages/sister_associations.html'), name='sister-associations'), ])), url(r'^for-members/', include([ url(r'^become-active', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'), @@ -33,4 +38,5 @@ urlpatterns = [ # Default login helpers url(r'^', include('django.contrib.auth.urls')), url(r'^i18n/', include('django.conf.urls.i18n')), -] +] + static(settings.MEDIA_URL, + document_root=os.path.join(settings.MEDIA_ROOT, 'public')) -- GitLab From f77fec519056fc06f003eeb8bbcce4427b69b1c8 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 27 Jul 2016 22:15:42 +0200 Subject: [PATCH 2/5] Implement details page --- .../templates/committees/details.html | 60 +++++++++++++++++++ website/committees/views.py | 17 +++++- 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 website/committees/templates/committees/details.html diff --git a/website/committees/templates/committees/details.html b/website/committees/templates/committees/details.html new file mode 100644 index 00000000..5bdc008a --- /dev/null +++ b/website/committees/templates/committees/details.html @@ -0,0 +1,60 @@ +{% extends "base.html" %} +{% load i18n %} +{% block title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %} +{% block page_title %}{% trans 'Committees' %}{% endblock %} + +{% block body %} +

{{ committee.name }} + + + + + +

+
+
+
+
+ {{ committee.name }} +
+
+

{% blocktrans with name=committee.name %}About the {{ name }}{% endblocktrans %}

+

{{ committee.description }}

+
+ +
+
+{% endblock %} diff --git a/website/committees/views.py b/website/committees/views.py index 60c66b75..8aea1b1d 100644 --- a/website/committees/views.py +++ b/website/committees/views.py @@ -1,6 +1,6 @@ from django.shortcuts import render, get_object_or_404 -from .models import Committee +from .models import Committee, CommitteeMembership def index(request): @@ -16,5 +16,16 @@ def details(request, committee_id): """View the details of a committee""" committee = get_object_or_404(Committee, pk=committee_id) - return render(request, 'committee/details.html', - {'committee': committee}) + members = [] + memberships = (CommitteeMembership + .active_memberships + .filter(committee=committee)) + for membership in memberships: + member = membership.member + member.chair = membership.chair + member.committee_since = membership.since + members.append(member) # list comprehension would be more pythonic? + + return render(request, 'committees/details.html', + {'committee': committee, + 'members': members}) -- GitLab From 03d3cdb98b024b35ae51d8f3ca50dcf0742c1623 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 27 Jul 2016 22:46:13 +0200 Subject: [PATCH 3/5] Display avatars on committee page See #13 --- .../templates/committees/details.html | 8 +++++-- .../members/migrations/0002_member_photo.py | 20 ++++++++++++++++++ website/members/models.py | 7 ++++++ .../static/members/images/default-avatar.jpg | Bin 0 -> 11399 bytes website/thaliawebsite/settings/settings.py | 2 +- website/thaliawebsite/urls.py | 2 +- 6 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 website/members/migrations/0002_member_photo.py create mode 100644 website/members/static/members/images/default-avatar.jpg diff --git a/website/committees/templates/committees/details.html b/website/committees/templates/committees/details.html index 5bdc008a..e7e789c2 100644 --- a/website/committees/templates/committees/details.html +++ b/website/committees/templates/committees/details.html @@ -1,5 +1,5 @@ {% extends "base.html" %} -{% load i18n %} +{% load i18n static %} {% block title %}{{ committee.name }} — {% trans 'Committees' %} — {{ block.super }}{% endblock %} {% block page_title %}{% trans 'Committees' %}{% endblock %} @@ -29,7 +29,11 @@
- {{ member.display_name }} + {% if not member.photo %} + {% trans + {% else %} + {{ member.display_name }} + {% endif %}
{% if member.chair %}
diff --git a/website/members/migrations/0002_member_photo.py b/website/members/migrations/0002_member_photo.py new file mode 100644 index 00000000..9efb4edd --- /dev/null +++ b/website/members/migrations/0002_member_photo.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10rc1 on 2016-07-27 20:21 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('members', '0001_squashed_0002_auto_20160707_1512'), + ] + + operations = [ + migrations.AddField( + model_name='member', + name='photo', + field=models.ImageField(blank=True, null=True, upload_to='public/avatars/', verbose_name='Foto'), + ), + ] diff --git a/website/members/models.py b/website/members/models.py index 67a0cfb8..7d23b32b 100644 --- a/website/members/models.py +++ b/website/members/models.py @@ -176,6 +176,13 @@ class Member(models.Model): default='full', ) + photo = models.ImageField( + verbose_name=_('Foto'), + upload_to='public/avatars/', + null=True, + blank=True, + ) + # --- Communication preference ---- language = models.CharField( diff --git a/website/members/static/members/images/default-avatar.jpg b/website/members/static/members/images/default-avatar.jpg new file mode 100644 index 0000000000000000000000000000000000000000..118dcb4e907d548c36beea6058b2afc933ec55d4 GIT binary patch literal 11399 zcmbVy30#a@{P#06E!r0oMVlq25>i=Olx51)#mu1G5I50OwzSGkk>wgGDqC)hnZ{mO zCb`I#?5P?UYkF*^>(VP(x7PKzVoaO0Z?#X6)m`6^Y zWI4_}G~$mnLE)RsUCgIVRPU=GW)UJ6qF7#L{k3^g1=H`J#a(9t9m8vI5{Sxs44jjpAkMgM>P*LR!H z8$?}0T|=XcB&d26njWR^9$^MdDpT-3LjI3J1sYXU2dSxRz<^v`f=Z#$s7f?MHH?mh z_k@z3vi=C$87hN0f2fWOrBB+r|HPnCGcVpT;7XfE+xc(Yrlvk*sG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84G`tj+t^Z3>SZ2TE+=Am7gNDa^jGrDU{JVCgf42ICspf4bOVIHcd1wOnA=yXe z4poLW2w-Cu4u14osX^l{&G6z2(f-qnBJ&H3be;=(bKeh%{8<0R(CyLwyS=M#?tPxM zBO_5a+if;2owx{P0-79!5p){rN4pp$tH{RSs01V~xUG|p5?N?)*^pD^9ji_ z?Yaj04PQPdxa@BGZ`b2b|1tWvtJAOM{Cz6glY(L4fs{n62d0_cF9;jzzE<44P0z!~IW%GjCttkLA2B^A$mrRyMaFP4p>{K4`jbGV zskA3yXRxDDCjb`|#h($ literal 0 HcmV?d00001 diff --git a/website/thaliawebsite/settings/settings.py b/website/thaliawebsite/settings/settings.py index 0d04375e..85825f40 100644 --- a/website/thaliawebsite/settings/settings.py +++ b/website/thaliawebsite/settings/settings.py @@ -147,7 +147,7 @@ LOCALE_PATHS = ('locale',) # Where to store uploaded files MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -MEDIA_URL = '/media/public/' +MEDIA_URL = '/media/' # Public is included by the db fields SENDFILE_BACKEND = 'sendfile.backends.development' diff --git a/website/thaliawebsite/urls.py b/website/thaliawebsite/urls.py index 80363d81..37ace8f8 100644 --- a/website/thaliawebsite/urls.py +++ b/website/thaliawebsite/urls.py @@ -38,5 +38,5 @@ urlpatterns = [ # Default login helpers url(r'^', include('django.contrib.auth.urls')), url(r'^i18n/', include('django.conf.urls.i18n')), -] + static(settings.MEDIA_URL, +] + static(settings.MEDIA_URL + 'public/', document_root=os.path.join(settings.MEDIA_ROOT, 'public')) -- GitLab From d5d794122aa562f05ea99d20e95a4a5b22f5c6bd Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 27 Jul 2016 22:55:47 +0200 Subject: [PATCH 4/5] Include missing migration --- .../migrations/0004_auto_20160727_2253.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 website/committees/migrations/0004_auto_20160727_2253.py diff --git a/website/committees/migrations/0004_auto_20160727_2253.py b/website/committees/migrations/0004_auto_20160727_2253.py new file mode 100644 index 00000000..2685c386 --- /dev/null +++ b/website/committees/migrations/0004_auto_20160727_2253.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10rc1 on 2016-07-27 20:53 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('committees', '0003_auto_20160713_1700'), + ] + + operations = [ + migrations.AlterField( + model_name='committee', + name='photo', + field=models.ImageField(upload_to='public/committeephotos/', verbose_name='Image'), + ), + ] -- GitLab From 176ec92a8464a2fbf1850de39462a0635f5579ad Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Wed, 27 Jul 2016 22:59:26 +0200 Subject: [PATCH 5/5] Silence deprecationerror --- website/committees/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/committees/models.py b/website/committees/models.py index 63b34bd7..a91ffb9e 100644 --- a/website/committees/models.py +++ b/website/committees/models.py @@ -2,9 +2,9 @@ import datetime import logging from django.core.exceptions import ValidationError, NON_FIELD_ERRORS -from django.core.urlresolvers import reverse from django.contrib.auth.models import Permission from django.db import models +from django.urls import reverse from django.utils import timezone from django.utils.translation import ugettext_lazy as _ -- GitLab