From 255b3bfe83501c607bee35386b5744763ccadb65 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 12 Feb 2017 00:49:22 +0200 Subject: [PATCH] Add dummy SIKAdmin at /sikadmin --- .gitignore | 3 +- locale/en/LC_MESSAGES/django.mo | Bin 378 -> 378 bytes locale/en/LC_MESSAGES/django.po | 39 ++++++++++++- locale/fi/LC_MESSAGES/django.mo | Bin 2845 -> 3200 bytes locale/fi/LC_MESSAGES/django.po | 41 ++++++++++++- sikweb/urls.py | 2 + webapp/templates/admin_index.html | 8 +++ webapp/templates/admin_navigation.html | 12 ++++ webapp/templates/base.html | 45 +++++++++++++++ webapp/templates/main_index.html | 76 +++---------------------- webapp/templates/navigation.html | 36 ++++++++++++ webapp/views.py | 10 +++- 12 files changed, 196 insertions(+), 76 deletions(-) create mode 100644 webapp/templates/admin_index.html create mode 100644 webapp/templates/admin_navigation.html create mode 100644 webapp/templates/base.html create mode 100644 webapp/templates/navigation.html diff --git a/.gitignore b/.gitignore index 03098ab..24b8660 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,5 @@ infoscreen/migrations/* webapp/migrations/* .idea/ logs/ -logs/* static/ -static/* +node_modules/ diff --git a/locale/en/LC_MESSAGES/django.mo b/locale/en/LC_MESSAGES/django.mo index 2d301659bb54adb640f597967244ddca0996a301..8f61f20b5fa5a93ad99080787901d74e717c5488 100644 GIT binary patch delta 16 Ycmeyx^owc21U4fD0|P6QiPN3{05zuuN&o-= delta 16 Ycmeyx^owc21U3T&BSS00iPN3{05zQkNB{r; diff --git a/locale/en/LC_MESSAGES/django.po b/locale/en/LC_MESSAGES/django.po index d3769ac..7a4c335 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-10 21:16+0200\n" +"POT-Creation-Date: 2017-02-12 00:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -47,6 +47,7 @@ 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 @@ -55,6 +56,10 @@ msgstr "" msgid "Delete" msgstr "" +#: infoscreen/templates/infoscreen_admin.html:44 +msgid "Add" +msgstr "" + #: infoscreen/templates/infoscreen_admin.html:48 msgid "Create new item" msgstr "" @@ -225,3 +230,35 @@ msgstr "" #: templates/footer.html:11 msgid "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" msgstr "" + +#: webapp/templates/admin_index.html:6 +msgid "SIK Admin" +msgstr "" + +#: webapp/templates/main_index.html:7 +msgid "Members" +msgstr "" + +#: webapp/templates/main_index.html:8 +msgid "Infoscreen" +msgstr "" + +#: webapp/templates/main_index.html:9 +msgid "Admin tools" +msgstr "" + +#: webapp/templates/navigation.html:29 +msgid "Event calendar" +msgstr "" + +#: webapp/templates/navigation.html:30 +msgid "International" +msgstr "" + +#: webapp/templates/navigation.html:31 +msgid "Sössö" +msgstr "" + +#: webapp/templates/navigation.html:32 +msgid "Contact" +msgstr "" diff --git a/locale/fi/LC_MESSAGES/django.mo b/locale/fi/LC_MESSAGES/django.mo index 7faff22ec3fd2491a15d77a7b8f8d949c9d9ec5d..052a8562ad1be22090075a560095b3dfd7ac38b9 100644 GIT binary patch delta 1590 zcmYk6U2IHg7{}kzkC~#hilR8w_vfHmAL-HvZ5JU*q8kaPofF2)oMGlnWiFU<;X+(U z4i}qUH_{uCxRF!{5=NG6HX*y44GBUbB3!r;7b~*+``6pVlk{syRh z9m^$fHhzos_rXcTH+{S)Kmjgv3Kj4sjKaIN|B?0ofeQ2r*1>mB34ejAK!iaZ zs2)y*bD{S8!E!UK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s?_?dZA*3&P}O}h!dLaYTCrjdO`y$X+_(JErfQXmS`oEv@4Z_7N;XwP5Q*Q z6Z`A~jqe|U+@*}9v(ajI6MG4LPTB>Xol?sR{^!kxukn7TX6G*T(Z|2E4}Ge1qZxLu-AJRT=2$29p2|qIv965 z+7Gl(A1Z4Oc8d$BJDDC$ QkIYWGnW5o)!K4%BKW=Vxd;kCd diff --git a/locale/fi/LC_MESSAGES/django.po b/locale/fi/LC_MESSAGES/django.po index a773067..95dd028 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-10 21:16+0200\n" +"POT-Creation-Date: 2017-02-12 00:46+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -48,6 +48,7 @@ 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 @@ -56,6 +57,10 @@ msgstr "Lisää rotaatioon" msgid "Delete" msgstr "Poista" +#: infoscreen/templates/infoscreen_admin.html:44 +msgid "Add" +msgstr "Lisää" + #: infoscreen/templates/infoscreen_admin.html:48 msgid "Create new item" msgstr "Luo uusi dia" @@ -227,5 +232,35 @@ msgstr "suomi" msgid "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" msgstr "Copyright Aalto-yliopiston Sähköinsinöörikilta ry" -#~ msgid "Change language" -#~ msgstr "Vaihda kieli" +#: webapp/templates/admin_index.html:6 +msgid "SIK Admin" +msgstr "SIK Hallintapaneeli" + +#: webapp/templates/main_index.html:7 +#, fuzzy +msgid "Members" +msgstr "Jäsenlistaus" + +#: webapp/templates/main_index.html:8 +msgid "Infoscreen" +msgstr "Infonäyttö" + +#: webapp/templates/main_index.html:9 +msgid "Admin tools" +msgstr "Hallintatyökalut" + +#: webapp/templates/navigation.html:29 +msgid "Event calendar" +msgstr "Tapahtumakalenteri" + +#: webapp/templates/navigation.html:30 +msgid "International" +msgstr "International" + +#: webapp/templates/navigation.html:31 +msgid "Sössö" +msgstr "Sössö" + +#: webapp/templates/navigation.html:32 +msgid "Contact" +msgstr "Yhteystiedot" diff --git a/sikweb/urls.py b/sikweb/urls.py index 3f956cc..40e268b 100644 --- a/sikweb/urls.py +++ b/sikweb/urls.py @@ -24,6 +24,7 @@ from django.contrib.staticfiles import views as static_views # main from webapp.views import main_index +from webapp.views import admin_index # login from webapp.views import login_view from webapp.views import logout_view @@ -72,6 +73,7 @@ favicon_view = RedirectView.as_view(url='static/img/favicon.ico', permanent=True urlpatterns = [ # main url(r'^$', main_index), + url(r'^sikadmin$', admin_index), # admin url(r'^admin/', admin.site.urls), # login stuff diff --git a/webapp/templates/admin_index.html b/webapp/templates/admin_index.html new file mode 100644 index 0000000..704abbe --- /dev/null +++ b/webapp/templates/admin_index.html @@ -0,0 +1,8 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block content %} + +

{% trans "SIK Admin" %}

+ +{% endblock %} diff --git a/webapp/templates/admin_navigation.html b/webapp/templates/admin_navigation.html new file mode 100644 index 0000000..9e44ee5 --- /dev/null +++ b/webapp/templates/admin_navigation.html @@ -0,0 +1,12 @@ +{% load i18n %} + + diff --git a/webapp/templates/base.html b/webapp/templates/base.html new file mode 100644 index 0000000..8e86b50 --- /dev/null +++ b/webapp/templates/base.html @@ -0,0 +1,45 @@ +{% load i18n %} +{% load static %} +{% load staticfiles %} + + + + + + + + + + + Aalto-yliopiston Sähköinsinöörikilta ry + + + + + + + + + + + + + + + + + + + + + + +
+ {% include "navigation.html" %} + {% block content %} + {% endblock %} +
+ + {% include "footer.html" %} + + diff --git a/webapp/templates/main_index.html b/webapp/templates/main_index.html index 2a249ed..92b7a52 100644 --- a/webapp/templates/main_index.html +++ b/webapp/templates/main_index.html @@ -1,73 +1,11 @@ - - - - - - - - - Aalto-yliopiston Sähköinsinöörikilta ry - - - - - - - - - - - - - - - - - - {%load staticfiles %} - - - - - +{% extends "base.html" %} +{% load i18n %} +{% block content %}

HURDURR DUMMY SITE

+{% endblock %} diff --git a/webapp/templates/navigation.html b/webapp/templates/navigation.html new file mode 100644 index 0000000..92fbfcf --- /dev/null +++ b/webapp/templates/navigation.html @@ -0,0 +1,36 @@ +{% load i18n %} + diff --git a/webapp/views.py b/webapp/views.py index 7711971..0cbeab0 100644 --- a/webapp/views.py +++ b/webapp/views.py @@ -1,6 +1,8 @@ from django.shortcuts import render, redirect from django.contrib.auth import login, logout, authenticate from django.views.decorators.http import require_http_methods +from django.views.decorators.csrf import ensure_csrf_cookie +from django.contrib.auth.decorators import permission_required from django.conf import settings import logging @@ -10,7 +12,13 @@ logging.basicConfig(format='[%(levelname)s]%(asctime)s %(message)s', level=setti @require_http_methods(["GET"]) def main_index(request, *args, **kwargs): - return render(request, "main_index.html", {}) + return render(request, "main_index.html", {}) + +@require_http_methods(["GET", "POST"]) +@ensure_csrf_cookie +@permission_required('members.change_member', login_url='/login') +def admin_index(request, *args, **kwargs): + return render(request, "admin_index.html", {}) @require_http_methods(["GET", "POST"]) def login_view(request, *args, **kwargs):