From 0340db5ced125d878afb0994f160dba6f8c6936a Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sun, 10 Sep 2017 00:53:08 +0200 Subject: [PATCH 1/5] Add portal/static_page.html --- .../templates/portal/static_page.html | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/static_page.html diff --git a/inyoka_theme_default/templates/portal/static_page.html b/inyoka_theme_default/templates/portal/static_page.html new file mode 100644 index 0000000..99fa258 --- /dev/null +++ b/inyoka_theme_default/templates/portal/static_page.html @@ -0,0 +1,34 @@ +{# + portal/static_page.html + ~~~~~~~~~~~~~~~~~~~~~~~ + + Used for static pages (imprint, licence etc.) + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'portal/base.html' %} + +{% block title %} + {{ title|e }} – {{ super() }} +{% endblock title %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(title|e, href('portal', key)) }} +{% endblock %} + +{% block sidebar %} + {% if USER.has_perm('portal.change_staticpage') %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('Delete'), page|url('delete'), 'fa_icon-trash') }} + {{ macros.sidebar_item(_('Edit'), page|url('edit'), 'fa_icon-pencil') }} + {% endcall %} + {% endif %} +{% endblock %} + +{% block content %} +

{{ title|e }}

+ {{ content }} +{% endblock %} From 0ff1c174ff7b65f6e43500d4bfa523c668f1619c Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sun, 10 Sep 2017 01:10:56 +0200 Subject: [PATCH 2/5] portal/static_page: Show breadcrumb-item for pages, if permissions --- inyoka_theme_default/templates/portal/static_page.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/inyoka_theme_default/templates/portal/static_page.html b/inyoka_theme_default/templates/portal/static_page.html index 99fa258..dd514a0 100644 --- a/inyoka_theme_default/templates/portal/static_page.html +++ b/inyoka_theme_default/templates/portal/static_page.html @@ -16,6 +16,9 @@ {% block breadcrumb %} {{ super() }} + {% if USER.has_perm('portal.change_staticpage') %} + {{ macros.breadcrumb_item(_('Static pages'), href('portal', 'pages')) }} + {% endif %} {{ macros.breadcrumb_item(title|e, href('portal', key)) }} {% endblock %} From df742bbece837d2fdd03e5e23570318308f5edf0 Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sun, 10 Sep 2017 01:21:56 +0200 Subject: [PATCH 3/5] Add portal/pages.html --- .../static/style/inyoka/portal.less | 9 +++ .../templates/portal/pages.html | 69 +++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/pages.html diff --git a/inyoka_theme_default/static/style/inyoka/portal.less b/inyoka_theme_default/static/style/inyoka/portal.less index 5c983ac..c04b72b 100644 --- a/inyoka_theme_default/static/style/inyoka/portal.less +++ b/inyoka_theme_default/static/style/inyoka/portal.less @@ -107,6 +107,15 @@ } } + &-static_pages { + &:extend(.table-responsive all); + + & > table { + &:extend(.table all); + &:extend(.table-striped all); + } + } + &-whoisonline.team { color: @team-member; } diff --git a/inyoka_theme_default/templates/portal/pages.html b/inyoka_theme_default/templates/portal/pages.html new file mode 100644 index 0000000..932b838 --- /dev/null +++ b/inyoka_theme_default/templates/portal/pages.html @@ -0,0 +1,69 @@ +{# + portal/pages.html + ~~~~~~~~~~~~~~~~~ + + This is the overview of the static pages configuration. + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'portal/base.html' %} + +{% block title %} + {% trans %}Static pages{% endtrans %} – {{ super() }} +{% endblock title %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(_('Static pages'), href('portal', 'pages')) }} +{% endblock %} + +{% block sidebar %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('Create new page'), href('portal', 'page', 'new')) }} + {% endcall %} +{% endblock %} + +{% block content %} +

{% trans %}Static pages{% endtrans %}

+ +
+ + + + + + + + + + {% for page in pages %} + + + + + + {% else %} + + + + {% endfor %} + +
{{ table.get_html('key', _('Key')) }}{{ table.get_html('title', _('Title')) }}{% trans %}Actions{% endtrans %}
+ {{ page.key }} + {{ page.title }} + + + {% trans %}Edit{% endtrans %} + +
+ + + {% trans %}Delete{% endtrans %} + +
+ {% trans %}There are no static pages, create the first one now!{% endtrans %} +
+
+{% endblock %} From 174260419ea6d30e3d7a86d0a05d956b3e3683eb Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sun, 10 Sep 2017 01:30:23 +0200 Subject: [PATCH 4/5] Add portal/page_edit.html --- .../templates/portal/page_edit.html | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/page_edit.html diff --git a/inyoka_theme_default/templates/portal/page_edit.html b/inyoka_theme_default/templates/portal/page_edit.html new file mode 100644 index 0000000..5b3d870 --- /dev/null +++ b/inyoka_theme_default/templates/portal/page_edit.html @@ -0,0 +1,38 @@ +{# + portal/pages_edit.html + ~~~~~~~~~~~~~~~~~~~~~ + + Formular for editing or writing a new page. + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'portal/pages.html' %} + +{% block title %} + {% trans %}Edit{% endtrans %} – {{ page.title|e }} – {{ super() }} +{% endblock title %} + +{% block breadcrumb %} + {{ super() }} + + {% if page %} + {{ macros.breadcrumb_item(page.title|e, page|url()) }} + {{ macros.breadcrumb_item(_('Edit'), page|url('edit')) }} + {% else %} + {{ macros.breadcrumb_item(_('Create new page'), href('portal', 'page', 'new')) }} + {% endif %} +{% endblock %} + +{% block content %} +

{{ page.title|e }}

+ + {% call macros.outer_form(csrf_token(), form) %} + + {% endcall %} + + {% if preview %} +

{% trans %}Preview{% endtrans %}

+
{{ preview }}
+ {% endif %} +{% endblock %} From 50102fee955ec3be80635b9ca46bb0ec853b2167 Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sun, 10 Sep 2017 01:33:11 +0200 Subject: [PATCH 5/5] portal/page_delete.html --- .../templates/portal/page_delete.html | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/page_delete.html diff --git a/inyoka_theme_default/templates/portal/page_delete.html b/inyoka_theme_default/templates/portal/page_delete.html new file mode 100644 index 0000000..c7765d1 --- /dev/null +++ b/inyoka_theme_default/templates/portal/page_delete.html @@ -0,0 +1,21 @@ +{# + portal/pages_delete.html + ~~~~~~~~~~~~~~~~~~~~~~~ + + This template is flashed to ensure that the user want to delete the selected page. + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +
+ {{ csrf_token() }} +

+ {% trans title=object.title|e %} + Do you really want to delete the page “{{ title }}”? + {% endtrans %} +

+

+ + +

+