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

Merge branch 'master' into feature/events-multilingual

parents 12901ca8 d1325947
FROM python:3.5-alpine
MAINTAINER Thom Wiggers <thom@thomwiggers.nl>
LABEL version=1.0
LABEL description="Contains the Thaliawebsite Django application"
# Try to keep static operation on top to maximise Docker cache utilisation
# Disable output buffering
ENV DJANGO_PRODUCTION 1
ENV PYTHONUNBUFFERED 1
# Create log dir
RUN mkdir /log/
RUN touch /log/uwsgi.log
# Create app directory
RUN mkdir -p /usr/src/app
# Create entry points
WORKDIR /usr/local/bin
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY resources/entrypoint_production.sh /usr/local/bin/entrypoint_production.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint_production.sh
# Install dependencies
RUN apk add --no-cache \
gettext \
bash \
postgresql-client \
libwebp \
tiff \
zlib \
freetype \
uwsgi \
lcms2 \
libjpeg-turbo \
nodejs
# Install build deps
RUN apk add --no-cache --virtual .builddeps \
build-base \
tiff-dev \
libjpeg-turbo-dev \
zlib-dev \
freetype-dev \
lcms2-dev \
libwebp-dev \
postgresql-dev
WORKDIR /usr/src/app
# install python requirements
COPY requirements.txt /usr/src/app/
COPY production-requirements.txt /usr/src/app/
RUN pip install --no-cache-dir \
-r requirements.txt \
-r production-requirements.txt
# Install nodejs-less
RUN npm install -g less mkdirp
RUN apk del .builddeps
# copy app source
COPY website /usr/src/app/
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["--help"]
......@@ -36,7 +36,7 @@ Pillow dependencies
For Ubuntu 16.04, use:
apt-get install python-dev gettext gcc build-essential libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
apt-get install python3-dev gettext gcc build-essential libtiff5-dev libjpeg62-turbo-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev
Or try:
......
version: '2'
services:
postgres:
image: postgres
environment: &postgresvars
POSTGRES_DB: thalia
web:
build: .
command: runserver 0.0.0.0:8000
ports:
- 8000:8000
depends_on:
- postgres
volumes:
- ./website:/usr/src/app
environment:
<<: *postgresvars
DJANGO_DEBUG: 'True'
DJANGO_POSTGRES_HOST: postgres
......@@ -7,4 +7,5 @@ django-template-check>=0.3.0 # This should be in dev-requirements somehow
bleach==1.4.3
django-tinymce==2.3.0
pytz
rcssmin
djangorestframework==3.4.4
#!/bin/bash
set -e
until psql -h "$DJANGO_POSTGRES_HOST" -U "postgres" -c '\l'; do
>&2 echo "PostgreSQL is unavailable: Sleeping"
sleep 5
done
>&2 echo "PostgreSQL is up"
cd /usr/src/app
>&2 echo "Running ./manage.py $@"
./manage.py $@
#!/bin/bash
set -e
until psql -h "$DJANGO_POSTGRES_HOST" -U "postgres" -c '\l'; do
>&2 echo "PostgreSQL is unavailable: Sleeping"
sleep 5
done
>&2 echo "PostgreSQL is up"
cd /usr/src/app
>&2 echo "Running site with uwsgi"
uwsgi --chdir /usr/src/app \
--socket :8000 \
--threads 2 \
--processes 4 \
--module thaliawebsite.wsgi:application \
--lazy-app \
--harakiri 20 \
--max-requests 5000 \
--vacuum \
--logto '/log/uwsgi.log'
from django.contrib import admin
from utils.translation import TranslatedModelAdmin
from . import models
@admin.register(models.Committee)
class CommitteeAdmin(admin.ModelAdmin):
class CommitteeAdmin(TranslatedModelAdmin):
list_filter = ('until',)
fields = ('name', 'description', 'photo', 'permissions',
'since', 'until',)
def get_queryset(self, request):
qs = super().get_queryset(request)
return qs.exclude(board__is_board=True)
@admin.register(models.Board)
class BoardAdmin(admin.ModelAdmin):
class BoardAdmin(TranslatedModelAdmin):
exclude = ('is_board',)
fields = ('name', 'description', 'photo', 'permissions',
'since', 'until',)
@admin.register(models.CommitteeMembership)
class CommitteeMembershipAdmin(admin.ModelAdmin):
class CommitteeMembershipAdmin(TranslatedModelAdmin):
pass
@admin.register(models.Mentorship)
class MentorsAdmin(admin.ModelAdmin):
pass
from django.apps import AppConfig
class ActiveMembersConfig(AppConfig):
name = 'activemembers'
[
{
"model": "committees.committee",
"model": "activemembers.committee",
"pk": 1,
"fields": {
"name": "testcie1",
"description": "Test",
"name_nl": "testcie1",
"name_en": "testcie1",
"description_nl": "Test",
"description_en": "Test",
"photo": "Thom_Wiggers.jpg",
"permissions": [
25,
......@@ -14,11 +16,13 @@
}
},
{
"model": "committees.committee",
"model": "activemembers.committee",
"pk": 2,
"fields": {
"name": "testcie2",
"description": "testdesc2",
"name_nl": "testcie2",
"name_en": "testcie2",
"description_nl": "testdesc2",
"description_en": "testdesc2",
"photo": "Thom_Wiggers_4YRoxV3.jpg",
"permissions": []
}
......
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-11 14:27+0200\n"
"PO-Revision-Date: 2016-09-11 14:29+0200\n"
"Last-Translator: Joost Rijneveld <joost@joostrijneveld.nl>\n"
"Language-Team: \n"
"Language: nl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 1.8.8\n"
#: models.py:41
msgid "Committee name"
msgstr "Commissienaam"
#: models.py:46
msgid "Description"
msgstr "Beschrijving"
#: models.py:50
msgid "Image"
msgstr "Afbeelding"
#: models.py:63
msgid "permissions"
msgstr "permissies"
#: models.py:68
msgid "founded in"
msgstr "opgericht in"
#: models.py:74
msgid "existed until"
msgstr "bestond tot"
#: models.py:79
msgid "contact email address"
msgstr "contact e-mailadres"
#: models.py:88
msgid "committee"
msgstr "commissie"
#: models.py:89 templates/activemembers/committee_index.html:6
msgid "committees"
msgstr "commissies"
#: models.py:101
msgid "Is this a board"
msgstr "Is dit een bestuur"
#: models.py:123
msgid "Member"
msgstr "Lid"
#: models.py:129
msgid "Committee"
msgstr "Commissie"
#: models.py:133
msgid "Committee member since"
msgstr "Commissielid sinds"
#: models.py:134
msgid "The date this member joined the committee in this role"
msgstr "De datum waarop deze persoon lid werd deze commissie in deze rol"
#: models.py:139
msgid "Committee member until"
msgstr "Commissielid tot"
#: models.py:140
msgid "A member of this committee until this time (can't be in the future)."
msgstr ""
"De datum waarop deze persoon de commissie verliet (kan niet in de toekomst "
"liggen)"
#: models.py:147
msgid "Chair of the committee"
msgstr "Voorzitter van de commissie"
#: models.py:148
msgid "There can only be one chair at a time!"
msgstr "Er kan maar één voorzitter tegelijkertijd zijn!"
#: models.py:153
msgid "role"
msgstr "rol"
#: models.py:154
msgid "The role of this member"
msgstr "De rol van dit lid binnen de commissie"
#: models.py:177
msgid "Membership expiration date can't be in the future: '{}'"
msgstr "Een lidmaatschap kan niet verlopen in de toekomst: ‘{]’"
#: models.py:183
msgid "End date can't be before start date"
msgstr "De einddatum kan niet voor de startdatum liggen"
#: models.py:197
msgid "This committee already has a chair"
msgstr "Deze commissie heeft al een voorzitter"
#: models.py:214
msgid "This member is already in the committee"
msgstr "Deze persoon is al lid van deze commissie"
#: models.py:217
msgid "This member is already in the committee for this period"
msgstr "Deze persoon is al lid van deze commissie in de aangegeven periode"
#: models.py:251
msgid "committee membership"
msgstr "commissielidmaatschap"
#: models.py:252
msgid "committee memberships"
msgstr "commissielidmaatschappen"
#: models.py:260
#, python-brace-format
msgid "Mentor introduction {year}"
msgstr "Mentor introductie {year}"
#: templates/activemembers/board_detail.html:4
#: templates/activemembers/board_index.html:3
#: templates/activemembers/board_index.html:6
msgid "Boards"
msgstr "Besturen"
#: templates/activemembers/board_detail.html:8
#: templates/activemembers/board_index.html:33
#: templates/activemembers/board_index.html:38
msgid "Board"
msgstr "Besturen"
#: templates/activemembers/board_detail.html:26
msgid "Board members"
msgstr "Bestuursleden"
#: templates/activemembers/board_detail.html:42
#: templates/activemembers/committee_detail.html:44
msgid "Chair"
msgstr "Voorzitter"
#: templates/activemembers/board_detail.html:59
msgid "This board doesn't have any members?"
msgstr "Dit bestuur heeft geen leden?"
#: templates/activemembers/board_index.html:10
#, python-format
msgid ""
"Thalia's board makes sure all operations during the academic year are taken "
"care of, in front or behind the scenes. If you have any questions then you "
"can address them during the day or, if you're not always on the campus, "
"you're always welcome to <a href=\"mailto:info@thalia.nu\">send them an "
"email</a>."
msgstr ""
"Het gehele Thaliabestuur zet zich gedurende een collegejaar in om alle "
"activiteiten van Thalia in goede banen te leiden, voor of achter de "
"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:25
#: 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:45
msgid "There are no boards!"
msgstr "Er zijn geen besturen!"
#: templates/activemembers/committee_detail.html:3
#: templates/activemembers/committee_index.html:3
msgid "Committees"
msgstr "Commissies"
#: templates/activemembers/committee_detail.html:24
#, python-format
msgid "About the %(name)s"
msgstr "Over de %(name)s"
#: templates/activemembers/committee_detail.html:28
msgid "Committee members"
msgstr "Commissieleden"
#: templates/activemembers/committee_detail.html:51
#, python-format
msgid "Committee member since: %(since)s"
msgstr "Commissielid sinds: %(since)s"
#: templates/activemembers/committee_detail.html:61
msgid "This committee doesn't have any members?"
msgstr "Deze commissie heeft geen leden?"
#: templates/activemembers/committee_index.html:39
msgid "There are no committees!"
msgstr "Er zijn geen commissies!"
#~ msgid "Mentors {year}-{year_to}"
#~ msgstr "Mentoren {year}-{year_to}"
......@@ -9,7 +9,7 @@ import django.db.models.manager
class Migration(migrations.Migration):
replaces = [('committees', '0001_initial'), ('committees', '0002_committee_permissions'), ('committees', '0003_auto_20160707_1356'), ('committees', '0004_auto_20160707_1357'), ('committees', '0005_auto_20160707_1512'), ('committees', '0006_auto_20160707_1700')]
replaces = [('activemembers', '0001_initial'), ('activemembers', '0002_committee_permissions'), ('activemembers', '0003_auto_20160707_1356'), ('activemembers', '0004_auto_20160707_1357'), ('activemembers', '0005_auto_20160707_1512'), ('activemembers', '0006_auto_20160707_1700')]
initial = True
......@@ -35,7 +35,7 @@ class Migration(migrations.Migration):
('since', models.DateField(auto_now_add=True)),
('until', models.DateField()),
('chair', models.BooleanField()),
('committee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='committees.Committee')),
('committee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activemembers.Committee')),
('member', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.Member')),
],
managers=[
......@@ -45,7 +45,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='committee',
name='members',
field=models.ManyToManyField(through='committees.CommitteeMembership', to='members.Member'),
field=models.ManyToManyField(through='activemembers.CommitteeMembership', to='members.Member'),
),
migrations.AddField(
model_name='committee',
......@@ -68,7 +68,7 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='committeemembership',
name='committee',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='committees.Committee', verbose_name='Committee'),
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activemembers.Committee', verbose_name='Committee'),
),
migrations.AlterField(
model_name='committeemembership',
......
......@@ -10,7 +10,7 @@ import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
('committees', '0001_squashed_0006_auto_20160707_1700'),
('activemembers', '0001_squashed_0006_auto_20160707_1700'),
]
operations = [
......
......@@ -9,17 +9,17 @@ import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('committees', '0002_auto_20160713_1558'),
('activemembers', '0002_auto_20160713_1558'),
]
operations = [
migrations.CreateModel(
name='Board',
fields=[
('committee_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='committees.Committee')),
('committee_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='activemembers.Committee')),
('is_board', models.BooleanField(default=True, verbose_name='Is this a board')),
],
bases=('committees.committee',),
bases=('activemembers.committee',),
),
migrations.AddField(
model_name='committeemembership',
......
......@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('committees', '0003_auto_20160713_1700'),
('activemembers', '0003_auto_20160713_1700'),
]
operations = [
......
......@@ -8,7 +8,7 @@ from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('committees', '0004_auto_20160727_2253'),
('activemembers', '0004_auto_20160727_2253'),
]
operations = [
......
......@@ -8,7 +8,7 @@ from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('committees', '0005_auto_20160813_2203'),
('activemembers', '0005_auto_20160813_2203'),
]
operations = [
......
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