Sort kaehmys in the correct order

This commit is contained in:
Jan Tuomi
2017-10-18 11:16:20 +03:00
parent 89bb68d222
commit cd94c0d0f4
7 changed files with 164 additions and 75 deletions
Binary file not shown.
+60 -50
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-17 19:55+0300\n" "POT-Creation-Date: 2017-10-18 11:11+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -192,11 +192,9 @@ msgid "English"
msgstr "English" msgstr "English"
#: infoscreen/templates/infoscreen_admin.html:166 #: infoscreen/templates/infoscreen_admin.html:166
#: members/templates/settings.html:23 webapp/templates/kaehmy.html:65 #: members/templates/settings.html:23 webapp/templates/kaehmy.html:77
#, fuzzy
#| msgid "Submitted"
msgid "Submit" msgid "Submit"
msgstr "Submitted" msgstr "Submit"
#: members/forms.py:115 members/tables.py:32 #: members/forms.py:115 members/tables.py:32
msgid "Member" msgid "Member"
@@ -551,16 +549,12 @@ msgid "Phone number (not public)"
msgstr "" msgstr ""
#: webapp/forms.py:44 #: webapp/forms.py:44
#, fuzzy
#| msgid "Total challenges:"
msgid "Custom roles" msgid "Custom roles"
msgstr "Total challenges:" msgstr ""
#: webapp/forms.py:52 webapp/templates/kaehmy.html:41 #: webapp/forms.py:52 webapp/templates/kaehmy.html:41
#, fuzzy
#| msgid "Total challenges:"
msgid "Preset roles" msgid "Preset roles"
msgstr "Total challenges:" msgstr ""
#: webapp/forms.py:76 #: webapp/forms.py:76
msgid "Invalid phone number" msgid "Invalid phone number"
@@ -599,38 +593,28 @@ msgid "Feeds"
msgstr "" msgstr ""
#: webapp/models.py:68 #: webapp/models.py:68
#, fuzzy
#| msgid "Events"
msgid "Event: {}" msgid "Event: {}"
msgstr "Events" msgstr ""
#: webapp/models.py:71 #: webapp/models.py:71
#, fuzzy
#| msgid "Events"
msgid "Event" msgid "Event"
msgstr "Events" msgstr ""
#: webapp/models.py:83 #: webapp/models.py:83
msgid "Registration: {}" msgid "Registration: {}"
msgstr "" msgstr ""
#: webapp/models.py:86 #: webapp/models.py:86
#, fuzzy
#| msgid "Rotation"
msgid "Registration" msgid "Registration"
msgstr "Rotation" msgstr ""
#: webapp/models.py:87 #: webapp/models.py:87
#, fuzzy
#| msgid "Rotations"
msgid "Registrations" msgid "Registrations"
msgstr "Rotations" msgstr ""
#: webapp/models.py:94 #: webapp/models.py:94
#, fuzzy
#| msgid "Corporate"
msgid "Corporate affairs" msgid "Corporate affairs"
msgstr "Corporate" msgstr ""
#: webapp/models.py:95 webapp/templates/freshmen.html:7 #: webapp/models.py:95 webapp/templates/freshmen.html:7
#: webapp/templates/navigation.html:16 #: webapp/templates/navigation.html:16
@@ -643,10 +627,8 @@ msgid "International"
msgstr "International" msgstr "International"
#: webapp/models.py:97 #: webapp/models.py:97
#, fuzzy
#| msgid "External image"
msgid "External affairs" msgid "External affairs"
msgstr "External image" msgstr ""
#: webapp/models.py:98 #: webapp/models.py:98
msgid "Media" msgid "Media"
@@ -692,7 +674,7 @@ msgstr "Applications"
msgid "Others" msgid "Others"
msgstr "" msgstr ""
#: webapp/models.py:111 webapp/models.py:184 #: webapp/models.py:111 webapp/models.py:192
#, fuzzy #, fuzzy
#| msgid "Add member" #| msgid "Add member"
msgid "Board member" msgid "Board member"
@@ -742,60 +724,92 @@ msgstr "Total challenges:"
msgid "Custom kaehmy roles" msgid "Custom kaehmy roles"
msgstr "Total challenges:" msgstr "Total challenges:"
#: webapp/models.py:158 #: webapp/models.py:146
msgid "Message"
msgstr ""
#: webapp/models.py:160
msgid "Timestamp" msgid "Timestamp"
msgstr "" msgstr ""
#: webapp/models.py:178 webapp/models.py:249 #: webapp/models.py:160
msgid "Kaehmykommentti"
msgstr "Kaehmy comment"
#: webapp/models.py:161
msgid "Kaehmykommentit"
msgstr "Kaehmy comments"
#: webapp/models.py:163
msgid "Message"
msgstr ""
#: webapp/models.py:182 webapp/templates/kaehmy.html:12
msgid "Kaehmylomake"
msgstr "Kaehmy application"
#: webapp/models.py:183
msgid "Kaehmylomakkeet"
msgstr "Kaehmy applications"
#: webapp/models.py:186 webapp/models.py:259
msgid "Phone number" msgid "Phone number"
msgstr "" msgstr ""
#: webapp/models.py:179 #: webapp/models.py:187
msgid "Year" msgid "Year"
msgstr "" msgstr ""
#: webapp/models.py:180 #: webapp/models.py:188
msgid "Text" msgid "Text"
msgstr "" msgstr ""
#: webapp/models.py:182 #: webapp/models.py:190
msgid "Custom role name" msgid "Custom role name"
msgstr "" msgstr ""
#: webapp/models.py:192 #: webapp/models.py:200
#, fuzzy #, fuzzy
#| msgid "Member applications" #| msgid "Member applications"
msgid "Kaehmy application: {}" msgid "Kaehmy application: {}"
msgstr "Member applications" msgstr "Member applications"
#: webapp/models.py:214 #: webapp/models.py:222
msgid "Board: {}" msgid "Board: {}"
msgstr "" msgstr ""
#: webapp/models.py:220 #: webapp/models.py:228
msgid "Official: {}" msgid "Official: {}"
msgstr "" msgstr ""
#: webapp/models.py:234 #: webapp/models.py:242
msgid "Role" msgid "Role"
msgstr "" msgstr ""
#: webapp/models.py:236 #: webapp/models.py:243
msgid "Roles"
msgstr ""
#: webapp/models.py:245
msgid "Start date" msgid "Start date"
msgstr "" msgstr ""
#: webapp/models.py:237 #: webapp/models.py:246
msgid "End date" msgid "End date"
msgstr "" msgstr ""
#: webapp/models.py:247 #: webapp/models.py:256
msgid "Official" msgid "Official"
msgstr "" msgstr ""
#: webapp/models.py:257
msgid "Officials"
msgstr ""
#: webapp/models.py:285
msgid "Telegram channel"
msgstr ""
#: webapp/models.py:286
msgid "Telegram channels"
msgstr ""
#: webapp/templates/admin_index.html:6 #: webapp/templates/admin_index.html:6
msgid "SIK Admin" msgid "SIK Admin"
msgstr "SIK Admin" msgstr "SIK Admin"
@@ -820,10 +834,6 @@ msgstr "Guild"
msgid "Jobs" msgid "Jobs"
msgstr "Jobs" msgstr "Jobs"
#: webapp/templates/kaehmy.html:12
msgid "Kaehmylomake"
msgstr "Kaehmy application"
#: webapp/templates/kaehmy.html:16 #: webapp/templates/kaehmy.html:16
msgid "" msgid ""
"Kaehmykoneella voit ilmaista kiinnostuksesi toimia killassa ensi vuonna.\n" "Kaehmykoneella voit ilmaista kiinnostuksesi toimia killassa ensi vuonna.\n"
Binary file not shown.
+51 -23
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-10-17 19:55+0300\n" "POT-Creation-Date: 2017-10-18 11:11+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -193,7 +193,7 @@ msgid "English"
msgstr "englanti" msgstr "englanti"
#: infoscreen/templates/infoscreen_admin.html:166 #: infoscreen/templates/infoscreen_admin.html:166
#: members/templates/settings.html:23 webapp/templates/kaehmy.html:65 #: members/templates/settings.html:23 webapp/templates/kaehmy.html:77
msgid "Submit" msgid "Submit"
msgstr "Lisää" msgstr "Lisää"
@@ -673,7 +673,7 @@ msgstr "Alumnisuhteet"
msgid "Others" msgid "Others"
msgstr "Muut" msgstr "Muut"
#: webapp/models.py:111 webapp/models.py:184 #: webapp/models.py:111 webapp/models.py:192
msgid "Board member" msgid "Board member"
msgstr "Hallituksen jäsen" msgstr "Hallituksen jäsen"
@@ -709,58 +709,90 @@ msgstr "Uusi virka"
msgid "Custom kaehmy roles" msgid "Custom kaehmy roles"
msgstr "Uudet kaehmyvirat" msgstr "Uudet kaehmyvirat"
#: webapp/models.py:158 #: webapp/models.py:146
msgid "Message"
msgstr "Viesti"
#: webapp/models.py:160
msgid "Timestamp" msgid "Timestamp"
msgstr "Aikaleima" msgstr "Aikaleima"
#: webapp/models.py:178 webapp/models.py:249 #: webapp/models.py:160
msgid "Kaehmykommentti"
msgstr ""
#: webapp/models.py:161
msgid "Kaehmykommentit"
msgstr ""
#: webapp/models.py:163
msgid "Message"
msgstr "Viesti"
#: webapp/models.py:182 webapp/templates/kaehmy.html:12
msgid "Kaehmylomake"
msgstr "Kaehmylomake"
#: webapp/models.py:183
msgid "Kaehmylomakkeet"
msgstr ""
#: webapp/models.py:186 webapp/models.py:259
msgid "Phone number" msgid "Phone number"
msgstr "Puhelinnumero" msgstr "Puhelinnumero"
#: webapp/models.py:179 #: webapp/models.py:187
msgid "Year" msgid "Year"
msgstr "Vuosi" msgstr "Vuosi"
#: webapp/models.py:180 #: webapp/models.py:188
msgid "Text" msgid "Text"
msgstr "Teksti" msgstr "Teksti"
#: webapp/models.py:182 #: webapp/models.py:190
msgid "Custom role name" msgid "Custom role name"
msgstr "Uusi virka" msgstr "Uusi virka"
#: webapp/models.py:192 #: webapp/models.py:200
msgid "Kaehmy application: {}" msgid "Kaehmy application: {}"
msgstr "Kaehmy: {}" msgstr "Kaehmy: {}"
#: webapp/models.py:214 #: webapp/models.py:222
msgid "Board: {}" msgid "Board: {}"
msgstr "Hallitus: {}" msgstr "Hallitus: {}"
#: webapp/models.py:220 #: webapp/models.py:228
msgid "Official: {}" msgid "Official: {}"
msgstr "Toimari: {}" msgstr "Toimari: {}"
#: webapp/models.py:234 #: webapp/models.py:242
msgid "Role" msgid "Role"
msgstr "Rooli" msgstr "Rooli"
#: webapp/models.py:236 #: webapp/models.py:243
msgid "Roles"
msgstr "Roolit"
#: webapp/models.py:245
msgid "Start date" msgid "Start date"
msgstr "Alkupäivämäärä" msgstr "Alkupäivämäärä"
#: webapp/models.py:237 #: webapp/models.py:246
msgid "End date" msgid "End date"
msgstr "Loppupäivämäärä" msgstr "Loppupäivämäärä"
#: webapp/models.py:247 #: webapp/models.py:256
msgid "Official" msgid "Official"
msgstr "Toimihenkilö" msgstr "Toimihenkilö"
#: webapp/models.py:257
msgid "Officials"
msgstr "Toimihenkilöt"
#: webapp/models.py:285
msgid "Telegram channel"
msgstr "Telegram-kanava"
#: webapp/models.py:286
msgid "Telegram channels"
msgstr "Telegram-kanavat"
#: webapp/templates/admin_index.html:6 #: webapp/templates/admin_index.html:6
msgid "SIK Admin" msgid "SIK Admin"
msgstr "SIK Hallintapaneeli" msgstr "SIK Hallintapaneeli"
@@ -785,10 +817,6 @@ msgstr "Kilta"
msgid "Jobs" msgid "Jobs"
msgstr "Työpaikat" msgstr "Työpaikat"
#: webapp/templates/kaehmy.html:12
msgid "Kaehmylomake"
msgstr "Kaehmylomake"
#: webapp/templates/kaehmy.html:16 #: webapp/templates/kaehmy.html:16
msgid "" msgid ""
"Kaehmykoneella voit ilmaista kiinnostuksesi toimia killassa ensi vuonna.\n" "Kaehmykoneella voit ilmaista kiinnostuksesi toimia killassa ensi vuonna.\n"
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-18 07:17
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('webapp', '0033_telegramchannel_name'),
]
operations = [
migrations.AlterModelOptions(
name='kaehmyform',
options={'verbose_name': 'Kaehmylomake', 'verbose_name_plural': 'Kaehmylomakkeet'},
),
migrations.AlterModelOptions(
name='kaehmymessage',
options={'verbose_name': 'Kaehmykommentti', 'verbose_name_plural': 'Kaehmykommentit'},
),
migrations.AlterModelOptions(
name='telegramchannel',
options={'verbose_name': 'Telegram channel', 'verbose_name_plural': 'Telegram channels'},
),
migrations.RemoveField(
model_name='kaehmymessage',
name='timestamp',
),
migrations.AddField(
model_name='messageparent',
name='timestamp',
field=models.DateTimeField(default=django.utils.timezone.now, verbose_name='Timestamp'),
),
]
+15 -1
View File
@@ -143,6 +143,7 @@ class MessageParent(models.Model):
name = models.CharField(_('Name'), max_length=255, default='') name = models.CharField(_('Name'), max_length=255, default='')
email = models.EmailField(_('Email'), default='') email = models.EmailField(_('Email'), default='')
timestamp = models.DateTimeField(_('Timestamp'), default=timezone.now)
def __str__(self): def __str__(self):
return 'Message parent #{}'.format(self.id) return 'Message parent #{}'.format(self.id)
@@ -155,9 +156,12 @@ class KaehmyMessage(MessageParent):
Every message relates to certain kaehmyform or parent message. Every message relates to certain kaehmyform or parent message.
""" """
class Meta:
verbose_name = _('Kaehmykommentti')
verbose_name_plural = _('Kaehmykommentit')
message = models.TextField(_('Message')) message = models.TextField(_('Message'))
parent = models.ForeignKey('MessageParent', related_name='messages') parent = models.ForeignKey('MessageParent', related_name='messages')
timestamp = models.DateTimeField(_('Timestamp'), default=timezone.now)
class KaehmyForm(MessageParent): class KaehmyForm(MessageParent):
@@ -173,6 +177,10 @@ class KaehmyForm(MessageParent):
(4, '4'), (4, '4'),
(5, 'N'), (5, 'N'),
) )
class Meta:
verbose_name = _('Kaehmylomake')
verbose_name_plural = _('Kaehmylomakkeet')
phone_number = models.CharField( phone_number = models.CharField(
_('Phone number'), max_length=10, default="") _('Phone number'), max_length=10, default="")
@@ -232,6 +240,7 @@ class Role(PresetRole):
"""Meta class for Role model.""" """Meta class for Role model."""
verbose_name = _('Role') verbose_name = _('Role')
verbose_name_plural = _('Roles')
start_date = models.DateField(_('Start date')) start_date = models.DateField(_('Start date'))
end_date = models.DateField(_('End date')) end_date = models.DateField(_('End date'))
@@ -245,6 +254,7 @@ class Official(User):
"""Meta class for Official class.""" """Meta class for Official class."""
verbose_name = _('Official') verbose_name = _('Official')
verbose_name_plural = _('Officials')
phone_number = PhoneNumberField(_('Phone number')) phone_number = PhoneNumberField(_('Phone number'))
@@ -271,6 +281,10 @@ class OhlhafvChallenge(models.Model):
class TelegramChannel(models.Model): class TelegramChannel(models.Model):
"""Model containing the channel id of a Telegram chat""" """Model containing the channel id of a Telegram chat"""
class Meta:
verbose_name = _('Telegram channel')
verbose_name_plural = _('Telegram channels')
name = models.CharField(max_length=255) name = models.CharField(max_length=255)
channel_id = models.CharField(max_length=255, unique=True) channel_id = models.CharField(max_length=255, unique=True)
+1 -1
View File
@@ -226,7 +226,7 @@ def ohlhafv_list(request, *args, **kwargs):
def kaehmy_list_view(request, *args, **kwargs): def kaehmy_list_view(request, *args, **kwargs):
"""Kaehmy application list""" """Kaehmy application list"""
applications = KaehmyForm.objects.all() applications = KaehmyForm.objects.order_by('-timestamp')
context = { context = {
'applications': applications, 'applications': applications,