Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Static pages #212

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions inyoka_theme_default/static/style/inyoka/portal.less
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@
}
}

&-static_pages {
&:extend(.table-responsive all);

& > table {
&:extend(.table all);
&:extend(.table-striped all);
}
}

&-whoisonline.team {
color: @team-member;
}
Expand Down
21 changes: 21 additions & 0 deletions inyoka_theme_default/templates/portal/page_delete.html
Original file line number Diff line number Diff line change
@@ -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.
#}
<form action="{{ object|url('delete')|e }}" method="post">
{{ csrf_token() }}
<p>
{% trans title=object.title|e %}
Do you really want to delete the page “{{ title }}”?
{% endtrans %}
</p>
<p>
<input type="submit" value="{% trans %}Delete{% endtrans %}" />
<input type="submit" name="cancel" value="{% trans %}Cancel{% endtrans %}" />
</p>
</form>
38 changes: 38 additions & 0 deletions inyoka_theme_default/templates/portal/page_edit.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1>{{ page.title|e }}</h1>

{% call macros.outer_form(csrf_token(), form) %}
<input type="submit" value="{% trans %}Preview{% endtrans %}" name="preview" />
{% endcall %}

{% if preview %}
<h2>{% trans %}Preview{% endtrans %}</h2>
<div class="preview">{{ preview }}</div>
{% endif %}
{% endblock %}
69 changes: 69 additions & 0 deletions inyoka_theme_default/templates/portal/pages.html
Original file line number Diff line number Diff line change
@@ -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 %}
<h1>{% trans %}Static pages{% endtrans %}</h1>

<div class="portal-static_pages">
<table>
<thead>
<tr>
<th>{{ table.get_html('key', _('Key')) }}</th>
<th>{{ table.get_html('title', _('Title')) }}</th>
<th>{% trans %}Actions{% endtrans %}</th>
</tr>
</thead>
<tbody>
{% for page in pages %}
<tr>
<td class="pagekey">
<a href="{{ page|url }}">{{ page.key }}</a>
</td>
<td class="title">{{ page.title }}</td>
<td class="actions">
<a href="{{ page|url('edit') }}">
<span class="fa_icon-pencil" aria-hidden="true"></span>
{% trans %}Edit{% endtrans %}
</a>
<br>
<a href="{{ page|url('delete') }}">
<span class="fa_icon-trash" aria-hidden="true"></span>
{% trans %}Delete{% endtrans %}
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">
{% trans %}There are no static pages, create the first one now!{% endtrans %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
37 changes: 37 additions & 0 deletions inyoka_theme_default/templates/portal/static_page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{#
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() }}

{% 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 %}

{% 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 %}
<h1>{{ title|e }}</h1>
{{ content }}
{% endblock %}