diff --git a/infoscreen/models.py b/infoscreen/models.py index 25c1b25..3051a78 100644 --- a/infoscreen/models.py +++ b/infoscreen/models.py @@ -4,14 +4,16 @@ from django.utils import timezone from datetime import datetime from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType - +from django.utils.translation import ugettext as _ class InfoItem(models.Model): class __meta__: abstract = True + name = models.CharField(max_length=255) expire_date = models.DateTimeField(blank=True, null=True) # None means never expiring item + display_name = "Default item" def get_template_url(self): raise NotImplementedError("inheriting classes must implement get_template_url") @@ -69,6 +71,7 @@ class InfoItem(models.Model): class ABBInfoItem(InfoItem): + display_name = _("ABB jobs") def get_template_url(self): return "/static/html/abb.html" @@ -77,6 +80,7 @@ class ABBInfoItem(InfoItem): return "/static/html/abb_create.html" class CoffeeInfoItem(InfoItem): + display_name = _("Coffee display") def get_template_url(self): return "/static/html/coffee.html" @@ -85,6 +89,7 @@ class CoffeeInfoItem(InfoItem): return "/static/html/coffee_create.html" class SossoInfoItem(InfoItem): + display_name = _("Sössö articles") def get_template_url(self): return "/static/html/sosso.html" @@ -94,6 +99,7 @@ class SossoInfoItem(InfoItem): class ImageInfoItem(InfoItem): + display_name = _("Image upload") img = models.ImageField(upload_to="infoimages/") def get_template_url(self): @@ -111,6 +117,7 @@ class ImageInfoItem(InfoItem): class HslInfoItem(InfoItem): + display_name = _("HSL timetables") def get_template_url(self): return "/static/html/hsl.html" @@ -120,6 +127,7 @@ class HslInfoItem(InfoItem): class ExternalImageInfoItem(InfoItem): + display_name = _("External image") url = models.TextField() def get_template_url(self): diff --git a/infoscreen/views.py b/infoscreen/views.py index a1daf11..7ec3ee0 100644 --- a/infoscreen/views.py +++ b/infoscreen/views.py @@ -120,7 +120,7 @@ def info_types(request, *args, **kwargs): classes = InfoItem.get_subclasses() for c in classes: types.append({ - "name": c.__name__, + "name": c.display_name, "create_template_url": c.get_create_template_url(), }) return HttpResponse(json.dumps(types)) diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 8f61f20..5e957e9 100644 Binary files a/locale/en/LC_MESSAGES/django.mo and b/locale/en/LC_MESSAGES/django.mo differ diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index 7a4c335..e8ff6e1 100644 --- a/locale/en/LC_MESSAGES/django.po +++ b/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-12 00:46+0200\n" +"POT-Creation-Date: 2017-02-22 22:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,101 +17,125 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: infoscreen/templates/infoscreen_admin.html:20 -#: members/templates/members_base.html:67 +#: infoscreen/models.py:74 +msgid "ABB jobs" +msgstr "ABB jobs" + +#: infoscreen/models.py:83 +msgid "Coffee display" +msgstr "Coffee display" + +#: infoscreen/models.py:92 +msgid "Sössö articles" +msgstr "Sössö articles" + +#: infoscreen/models.py:102 +msgid "Image upload" +msgstr "Image upload" + +#: infoscreen/models.py:120 +msgid "HSL timetables" +msgstr "HSL timetables" + +#: infoscreen/models.py:130 +msgid "External image" +msgstr "External image" + +#: infoscreen/templates/infoscreen_admin.html:22 +#: members/templates/members_base.html:60 msgid "Log out" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:27 +#: infoscreen/templates/infoscreen_admin.html:29 msgid "Infoscreen Admin Pane" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:32 +#: infoscreen/templates/infoscreen_admin.html:34 msgid "Info items" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:33 +#: infoscreen/templates/infoscreen_admin.html:35 msgid "Infoitems available for rotations" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:36 +#: infoscreen/templates/infoscreen_admin.html:38 msgid "Item" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:37 +#: infoscreen/templates/infoscreen_admin.html:39 msgid "Set duration" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:38 +#: infoscreen/templates/infoscreen_admin.html:40 msgid "Add to rotation" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:39 -#: infoscreen/templates/infoscreen_admin.html:45 -#: infoscreen/templates/infoscreen_admin.html:72 -#: infoscreen/templates/infoscreen_admin.html:79 -#: infoscreen/templates/infoscreen_admin.html:96 -#: infoscreen/templates/infoscreen_admin.html:100 +#: infoscreen/templates/infoscreen_admin.html:41 +#: infoscreen/templates/infoscreen_admin.html:47 +#: infoscreen/templates/infoscreen_admin.html:74 +#: infoscreen/templates/infoscreen_admin.html:81 +#: infoscreen/templates/infoscreen_admin.html:98 +#: infoscreen/templates/infoscreen_admin.html:102 #: members/templates/member_list.html:63 msgid "Delete" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:44 +#: infoscreen/templates/infoscreen_admin.html:46 msgid "Add" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:48 +#: infoscreen/templates/infoscreen_admin.html:50 msgid "Create new item" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:51 +#: infoscreen/templates/infoscreen_admin.html:53 msgid "Item type" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:62 +#: infoscreen/templates/infoscreen_admin.html:64 msgid "Rotations" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:64 +#: infoscreen/templates/infoscreen_admin.html:66 msgid "Select rotation to edit" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:68 -#: infoscreen/templates/infoscreen_admin.html:90 +#: infoscreen/templates/infoscreen_admin.html:70 +#: infoscreen/templates/infoscreen_admin.html:92 msgid "Rotation" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:69 +#: infoscreen/templates/infoscreen_admin.html:71 msgid "id" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:70 -#: infoscreen/templates/infoscreen_admin.html:77 +#: infoscreen/templates/infoscreen_admin.html:72 +#: infoscreen/templates/infoscreen_admin.html:79 msgid "Select" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:71 -#: infoscreen/templates/infoscreen_admin.html:78 +#: infoscreen/templates/infoscreen_admin.html:73 +#: infoscreen/templates/infoscreen_admin.html:80 msgid "Preview" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:82 +#: infoscreen/templates/infoscreen_admin.html:84 msgid "Name" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:83 +#: infoscreen/templates/infoscreen_admin.html:85 msgid "Create new" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:91 +#: infoscreen/templates/infoscreen_admin.html:93 msgid "Instances in currently selected rotation" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:94 +#: infoscreen/templates/infoscreen_admin.html:96 msgid "Instance" msgstr "" -#: infoscreen/templates/infoscreen_admin.html:95 +#: infoscreen/templates/infoscreen_admin.html:97 msgid "Duration" msgstr "" @@ -199,31 +223,31 @@ msgstr "" msgid "Are you sure?" msgstr "" -#: members/templates/members_base.html:49 +#: members/templates/members_base.html:50 msgid "Member list" msgstr "" -#: members/templates/members_base.html:50 +#: members/templates/members_base.html:51 msgid "Add member" msgstr "" -#: members/templates/members_base.html:51 +#: members/templates/members_base.html:52 msgid "Add multiple" msgstr "" -#: members/templates/members_base.html:52 +#: members/templates/members_base.html:53 msgid "Member application" msgstr "" -#: members/templates/members_base.html:62 +#: members/templates/members_base.html:69 msgid "Member register of SIK ry" msgstr "" -#: sikweb/settings-sample.py:146 sikweb/settings.py:146 +#: sikweb/settings-sample.py:162 sikweb/settings.py:161 msgid "English" msgstr "" -#: sikweb/settings-sample.py:147 sikweb/settings.py:147 +#: sikweb/settings-sample.py:163 sikweb/settings.py:162 msgid "Finnish" msgstr "" diff --git a/locale/fi/LC_MESSAGES/django.mo b/locale/fi/LC_MESSAGES/django.mo index 052a856..ae1fa52 100644 Binary files a/locale/fi/LC_MESSAGES/django.mo and b/locale/fi/LC_MESSAGES/django.mo differ diff --git a/locale/fi/LC_MESSAGES/django.po b/locale/fi/LC_MESSAGES/django.po index 95dd028..5f31d7b 100644 --- a/locale/fi/LC_MESSAGES/django.po +++ b/locale/fi/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-02-12 00:46+0200\n" +"POT-Creation-Date: 2017-02-22 22:36+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,101 +18,125 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: infoscreen/templates/infoscreen_admin.html:20 -#: members/templates/members_base.html:67 +#: infoscreen/models.py:74 +msgid "ABB jobs" +msgstr "ABB-työpaikat" + +#: infoscreen/models.py:83 +msgid "Coffee display" +msgstr "Kahvinäyttö" + +#: infoscreen/models.py:92 +msgid "Sössö articles" +msgstr "Sössön artikkelit" + +#: infoscreen/models.py:102 +msgid "Image upload" +msgstr "Kuvan lataus" + +#: infoscreen/models.py:120 +msgid "HSL timetables" +msgstr "HSL-aikataulut" + +#: infoscreen/models.py:130 +msgid "External image" +msgstr "Ulkoinen kuva" + +#: infoscreen/templates/infoscreen_admin.html:22 +#: members/templates/members_base.html:60 msgid "Log out" msgstr "Kirjaudu ulos" -#: infoscreen/templates/infoscreen_admin.html:27 +#: infoscreen/templates/infoscreen_admin.html:29 msgid "Infoscreen Admin Pane" msgstr "Infonäyttöjen hallintapaneeli" -#: infoscreen/templates/infoscreen_admin.html:32 +#: infoscreen/templates/infoscreen_admin.html:34 msgid "Info items" msgstr "Diat" -#: infoscreen/templates/infoscreen_admin.html:33 +#: infoscreen/templates/infoscreen_admin.html:35 msgid "Infoitems available for rotations" msgstr "Rotaatioon lisättävät diat" -#: infoscreen/templates/infoscreen_admin.html:36 +#: infoscreen/templates/infoscreen_admin.html:38 msgid "Item" msgstr "Dia" -#: infoscreen/templates/infoscreen_admin.html:37 +#: infoscreen/templates/infoscreen_admin.html:39 msgid "Set duration" msgstr "Aseta kesto" -#: infoscreen/templates/infoscreen_admin.html:38 +#: infoscreen/templates/infoscreen_admin.html:40 msgid "Add to rotation" msgstr "Lisää rotaatioon" -#: infoscreen/templates/infoscreen_admin.html:39 -#: infoscreen/templates/infoscreen_admin.html:45 -#: infoscreen/templates/infoscreen_admin.html:72 -#: infoscreen/templates/infoscreen_admin.html:79 -#: infoscreen/templates/infoscreen_admin.html:96 -#: infoscreen/templates/infoscreen_admin.html:100 +#: infoscreen/templates/infoscreen_admin.html:41 +#: infoscreen/templates/infoscreen_admin.html:47 +#: infoscreen/templates/infoscreen_admin.html:74 +#: infoscreen/templates/infoscreen_admin.html:81 +#: infoscreen/templates/infoscreen_admin.html:98 +#: infoscreen/templates/infoscreen_admin.html:102 #: members/templates/member_list.html:63 msgid "Delete" msgstr "Poista" -#: infoscreen/templates/infoscreen_admin.html:44 +#: infoscreen/templates/infoscreen_admin.html:46 msgid "Add" msgstr "Lisää" -#: infoscreen/templates/infoscreen_admin.html:48 +#: infoscreen/templates/infoscreen_admin.html:50 msgid "Create new item" msgstr "Luo uusi dia" -#: infoscreen/templates/infoscreen_admin.html:51 +#: infoscreen/templates/infoscreen_admin.html:53 msgid "Item type" msgstr "Diatyyppi" -#: infoscreen/templates/infoscreen_admin.html:62 +#: infoscreen/templates/infoscreen_admin.html:64 msgid "Rotations" msgstr "Rotaatiot" -#: infoscreen/templates/infoscreen_admin.html:64 +#: infoscreen/templates/infoscreen_admin.html:66 msgid "Select rotation to edit" msgstr "Valitse muokattava rotaatio" -#: infoscreen/templates/infoscreen_admin.html:68 -#: infoscreen/templates/infoscreen_admin.html:90 +#: infoscreen/templates/infoscreen_admin.html:70 +#: infoscreen/templates/infoscreen_admin.html:92 msgid "Rotation" msgstr "Rotaatio" -#: infoscreen/templates/infoscreen_admin.html:69 +#: infoscreen/templates/infoscreen_admin.html:71 msgid "id" msgstr "id" -#: infoscreen/templates/infoscreen_admin.html:70 -#: infoscreen/templates/infoscreen_admin.html:77 +#: infoscreen/templates/infoscreen_admin.html:72 +#: infoscreen/templates/infoscreen_admin.html:79 msgid "Select" msgstr "Valitse" -#: infoscreen/templates/infoscreen_admin.html:71 -#: infoscreen/templates/infoscreen_admin.html:78 +#: infoscreen/templates/infoscreen_admin.html:73 +#: infoscreen/templates/infoscreen_admin.html:80 msgid "Preview" msgstr "Esikatsele" -#: infoscreen/templates/infoscreen_admin.html:82 +#: infoscreen/templates/infoscreen_admin.html:84 msgid "Name" msgstr "Nimi" -#: infoscreen/templates/infoscreen_admin.html:83 +#: infoscreen/templates/infoscreen_admin.html:85 msgid "Create new" msgstr "Luo uusi" -#: infoscreen/templates/infoscreen_admin.html:91 +#: infoscreen/templates/infoscreen_admin.html:93 msgid "Instances in currently selected rotation" msgstr "Nykyisen rotaation diat" -#: infoscreen/templates/infoscreen_admin.html:94 +#: infoscreen/templates/infoscreen_admin.html:96 msgid "Instance" msgstr "Dia" -#: infoscreen/templates/infoscreen_admin.html:95 +#: infoscreen/templates/infoscreen_admin.html:97 msgid "Duration" msgstr "Kesto" @@ -200,31 +224,31 @@ msgstr "Muokkaa" msgid "Are you sure?" msgstr "Oletko varma?" -#: members/templates/members_base.html:49 +#: members/templates/members_base.html:50 msgid "Member list" msgstr "Jäsenlistaus" -#: members/templates/members_base.html:50 +#: members/templates/members_base.html:51 msgid "Add member" msgstr "Lisää jäsen" -#: members/templates/members_base.html:51 +#: members/templates/members_base.html:52 msgid "Add multiple" msgstr "Lisää useita" -#: members/templates/members_base.html:52 +#: members/templates/members_base.html:53 msgid "Member application" msgstr "Jäsenhakemus" -#: members/templates/members_base.html:62 +#: members/templates/members_base.html:69 msgid "Member register of SIK ry" msgstr "Aalto-yliopiston Sähköinsinöörikilta ry:n jäsenrekisteri" -#: sikweb/settings-sample.py:146 sikweb/settings.py:146 +#: sikweb/settings-sample.py:162 sikweb/settings.py:161 msgid "English" msgstr "englanti" -#: sikweb/settings-sample.py:147 sikweb/settings.py:147 +#: sikweb/settings-sample.py:163 sikweb/settings.py:162 msgid "Finnish" msgstr "suomi"