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 2d30165..8f61f20 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 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 7faff22..052a856 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 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

-Members -Infoscreen -Admin + {% trans "Members" %} + {% trans "Infoscreen" %} + {% trans "Admin tools" %}
+{% 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):