From 52aa53dd73cf4b5888cc1a197f6d4d1f517d3a54 Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sat, 9 Sep 2017 17:36:04 +0200 Subject: [PATCH 1/3] Add portal/files.html --- .../static/style/inyoka/portal.less | 9 +++ .../templates/portal/files.html | 70 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/files.html diff --git a/inyoka_theme_default/static/style/inyoka/portal.less b/inyoka_theme_default/static/style/inyoka/portal.less index 60a4f74..339d986 100644 --- a/inyoka_theme_default/static/style/inyoka/portal.less +++ b/inyoka_theme_default/static/style/inyoka/portal.less @@ -96,4 +96,13 @@ margin-bottom:0; } } + + &-static_files { + &:extend(.table-responsive all); + + & > table { + &:extend(.table all); + &:extend(.table-striped all); + } + } } diff --git a/inyoka_theme_default/templates/portal/files.html b/inyoka_theme_default/templates/portal/files.html new file mode 100644 index 0000000..c0effbb --- /dev/null +++ b/inyoka_theme_default/templates/portal/files.html @@ -0,0 +1,70 @@ +{# + portal/files.html + ~~~~~~~~~~~~~~~~~ + + This is the overview of the ikhaya files. + + :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 files{% endtrans %} – {{ super() }} +{% endblock title %} + +{% block breadcrumb %} + {{ super() }} + + {{ macros.breadcrumb_item(_('Static files'), href('portal', 'files')) }} +{% endblock %} + +{% block sidebar %} + {% call macros.sidebar_admin() %} + {{ macros.sidebar_item(_('Create new static file'), href('portal', 'files', 'new')) }} + {% endcall%} +{% endblock %} + +{% block content %} +

{% trans %}Static files{% endtrans %}

+ +
+ + + + + + + + + + + {% for file in object_list %} + + + + + + {% else %} + + + + {% endfor %} + +
{{ table.get_html('identifier', _('Identifier')) }}{{ table.get_html('is_ikhaya_icon', _('Is Ikhaya-Icon')) }}{% trans %}Actions{% endtrans %}
+ {{ file.identifier|e }} + {{ file.is_ikhaya_icon and _('yes') or _('no') }} + + + {% trans %}Edit{% endtrans %} + +
+ + + {% trans %}Delete{% endtrans %} + +
+ {% trans %}There are no static files, create the first one now!{% endtrans %} +
+
+{% endblock %} From 913071efc1ed024046e09e956a107281f24d494e Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sat, 9 Sep 2017 17:36:25 +0200 Subject: [PATCH 2/3] Add portal/file_edit.html --- .../templates/portal/file_edit.html | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/file_edit.html diff --git a/inyoka_theme_default/templates/portal/file_edit.html b/inyoka_theme_default/templates/portal/file_edit.html new file mode 100644 index 0000000..c8b8663 --- /dev/null +++ b/inyoka_theme_default/templates/portal/file_edit.html @@ -0,0 +1,54 @@ +{# + portal/file_edit.html + ~~~~~~~~~~~~~~~~~~~~~ + + Template for editing or creating a static file. + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% extends 'portal/files.html' %} + +{% block title %} + {% if file %} + {{ file.identifier|e }} + {% else %} + {% trans %}Create{% endtrans %} + {% endif %} + + – {{ super() }} +{% endblock title %} + +{% block breadcrumb %} + {{ super() }} + + {% if file %} + {{ macros.breadcrumb_item(file.identifier|e, file|url('edit')) }} + {% else %} + {{ macros.breadcrumb_item(_('Create'), href('portal', 'files', 'new')) }} + {% endif %} +{% endblock %} + +{% block content %} +

+ {% if file %} + {{ file.identifier|e }} + {% else %} + {% trans %}Create new static file{% endtrans %} + {% endif %} +

+ + {% if file %} +

{% trans %}Usage:{% endtrans %}

+
+[[Bild("{{ file.identifier|e }}")]]
+[[Vorlage(Ikhayabild, "{{ file.identifier|e }}", Link oder Größe, "{% trans %}Description{% endtrans %}", left|right)]]
+
+ +
+ {% trans %}CAUTION: A change of the file destroys all links from articles to this file!{% endtrans %} +
+ {% endif %} + + {{ macros.outer_form(csrf_token(), form) }} +{% endblock %} From 5e271a7d3c136a6dcf23cb04f67a4d5653562eda Mon Sep 17 00:00:00 2001 From: Christoph Volkert Date: Sat, 9 Sep 2017 17:36:41 +0200 Subject: [PATCH 3/3] Add portal/files_delete.html --- .../templates/portal/files_delete.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 inyoka_theme_default/templates/portal/files_delete.html diff --git a/inyoka_theme_default/templates/portal/files_delete.html b/inyoka_theme_default/templates/portal/files_delete.html new file mode 100644 index 0000000..a9a0c12 --- /dev/null +++ b/inyoka_theme_default/templates/portal/files_delete.html @@ -0,0 +1,18 @@ +{# + portal/files_delete.html + ~~~~~~~~~~~~~~~~~~~~~~~~ + + This template is flashed to ensure that the user wants to delete the selected file. + + :copyright: (c) 2013-2017 by the Inyoka Team, see AUTHORS for more details. + :license: BSD, see LICENSE for more details. +#} +{% import 'macros.html' as macros %} + +{% call macros.outer_form(csrf_token(), form, action=object|url('delete')|e, submit_label=_('Delete')) %} +

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

+ + +{% endcall %}