summaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2018-09-23 19:13:19 +0200
committerIgor Scheller <igor.scheller@igorshp.de>2018-09-23 20:11:37 +0200
commit66038eda14d5d4e624b6636a6156570e3e940e49 (patch)
tree6e4b7557b7d91786ef47f22f7ddef85eed1dfb42 /resources/views
parent590adffa9316b98544cb8d67b03b80e44ba9c8b7 (diff)
parent9d34f371cb9c5ab0d60bd3158678b9cc9da6cc80 (diff)
Merge branch 'twig-templates'
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/layouts/app.twig60
-rw-r--r--resources/views/layouts/parts/footer.twig36
-rw-r--r--resources/views/layouts/parts/navbar.twig74
-rw-r--r--resources/views/pages/credits.html36
-rw-r--r--resources/views/pages/credits.twig42
-rw-r--r--resources/views/pages/user-shifts.html10
6 files changed, 175 insertions, 83 deletions
diff --git a/resources/views/layouts/app.twig b/resources/views/layouts/app.twig
index aa45484d..d8f8d10f 100644
--- a/resources/views/layouts/app.twig
+++ b/resources/views/layouts/app.twig
@@ -11,8 +11,12 @@
<link rel="stylesheet" type="text/css" href="{{ asset('assets/theme' ~ theme ~ '.css') }}"/>
<script type="text/javascript" src="{{ asset('assets/vendor.js') }}"></script>
- {% if atom_feed -%}
- <link href="{{ url('atom', atom_feed) }}" type="application/atom+xml" rel="alternate" title="Atom Feed">
+ {% if page() in ['news', 'user-meetings', '/'] and is_user() -%}
+ {% set parameters = {'key': user.api_key} -%}
+ {% if page() == 'user-meetings' -%}
+ {% set parameters = parameters|merge({'meetings': 1}) -%}
+ {% endif %}
+ <link href="{{ url('atom', parameters) }}" type="application/atom+xml" rel="alternate" title="Atom Feed">
{% endif %}
{% endblock %}
@@ -20,54 +24,24 @@
<body>
{% block body %}
- <div class="navbar navbar-default navbar-fixed-top">
- {% block header %}
- <div class="container-fluid">
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed"
- data-toggle="collapse" data-target="#navbar-collapse-1">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="{{ url('/') }}">
- <span class="icon-icon_angel"></span> <strong class="visible-lg-inline">ENGELSYSTEM</strong>
- </a>
- </div>
-
- {% block navbar %}
- <div class="collapse navbar-collapse" id="navbar-collapse-1">
- {{ menu|raw }}
- {{ header_toolbar|raw }}
- </div>
- {% endblock %}
- </div>
- {% endblock %}
- </div>
+ {% block header %}
+ {% include "layouts/parts/navbar.twig" %}
+ {% endblock %}
<div class="container-fluid">
- <div class="row">{% block content %}{{ content|raw }}{% endblock %}</div>
+ <div class="row" id="content">
+ {% block content %}
+ {{ content|raw }}
+ {% endblock %}
+ </div>
<div class="row" id="footer">
{% block footer %}
- <div class="col-md-12">
- <hr/>
- <div class="text-center footer" style="margin-bottom: 10px;">
- {% block eventinfo %}
- {{ event_info|raw }}
- {% endblock %}
- <a href="{{ config('faq_url') }}">FAQ</a>
- · <a href="{{ config('contact_email') }}">
- <span class="glyphicon glyphicon-envelope"></span>Contact
- </a>
- · <a href="https://github.com/engelsystem/engelsystem/issues">Bugs / Features</a>
- · <a href="https://github.com/engelsystem/engelsystem/">Development Platform</a>
- · <a href="{{ url('credits') }}">Credits</a>
- </div>
- </div>
+ {% include "layouts/parts/footer.twig" %}
{% endblock %}
</div>
</div>
+
+ {% block scripts %}{% endblock %}
{% endblock %}
</body>
diff --git a/resources/views/layouts/parts/footer.twig b/resources/views/layouts/parts/footer.twig
new file mode 100644
index 00000000..e986963a
--- /dev/null
+++ b/resources/views/layouts/parts/footer.twig
@@ -0,0 +1,36 @@
+<div class="col-md-12">
+ <hr/>
+ <div class="text-center footer" style="margin-bottom: 10px;">
+ {% block eventinfo %}
+ {% if event_config.event_name %}
+ {% if event_config.event_start_date and event_config.event_end_date %}
+ {{ __('%s, from %s to %s', [
+ event_config.event_name,
+ date(event_config.event_start_date).format(__('Y-m-d')),
+ date(event_config.event_end_date).format(__('Y-m-d'))
+ ]) }}
+ {% elseif event_config.event_start_date %}
+ {{ __('%s, starting %s', [
+ event_config.event_name,
+ date(event_config.event_start_date).format(__('Y-m-d'))
+ ]) }}
+ {% else %}
+ {{ event_config.event_name }}
+ {% endif %} <br>
+ {% elseif event_config.event_start_date and event_config.event_end_date %}
+ {{ __('Event from %s to %s', [
+ date(event_config.event_start_date).format(__('Y-m-d')),
+ date(event_config.event_end_date).format(__('Y-m-d'))
+ ]) }} <br>
+ {% endif %}
+ {% endblock %}
+
+ <a href="{{ config('faq_url') }}">{{ __('FAQ') }}</a>
+ · <a href="{{ config('contact_email') }}">
+ <span class="glyphicon glyphicon-envelope"></span> {{ __('Contact') }}
+ </a>
+ · <a href="https://github.com/engelsystem/engelsystem/issues">{{ __('Bugs / Features') }}</a>
+ · <a href="https://github.com/engelsystem/engelsystem/">{{ __('Development Platform') }}</a>
+ · <a href="{{ url('credits') }}">{{ __('Credits') }}</a>
+ </div>
+</div>
diff --git a/resources/views/layouts/parts/navbar.twig b/resources/views/layouts/parts/navbar.twig
new file mode 100644
index 00000000..a718fc48
--- /dev/null
+++ b/resources/views/layouts/parts/navbar.twig
@@ -0,0 +1,74 @@
+{% import _self as elements %}
+
+{% macro toolbar_item(label, link, active_page, icon) %}
+ <li{% if page() == active_page %} class="active"{% endif %}>
+ <a href="{{ link }}">
+ {% if icon %}<span class="glyphicon {{ icon }}"></span>{% endif %}
+ {{ label|raw }}
+ </a>
+ </li>
+{% endmacro %}
+
+<div class="navbar navbar-default navbar-fixed-top">
+ <div class="container-fluid">
+ {% block navbar %}
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed"
+ data-toggle="collapse" data-target="#navbar-collapse-1">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="{{ url('/') }}">
+ <span class="icon-icon_angel"></span> <strong class="visible-lg-inline">ENGELSYSTEM</strong>
+ </a>
+ </div>
+
+ {% block menu %}
+ <div class="collapse navbar-collapse" id="navbar-collapse-1">
+ {% block menu_items %}
+ {{ menu() }}
+ {% endblock %}
+
+ {% block menu_toolbar %}
+ <ul class="nav navbar-nav navbar-right">
+
+ {% if is_user() %}
+ {{ elements.toolbar_item(menuUserShiftState(user), url('shifts', {'action': 'next'}), '', 'glyphicon-time') }}
+ {% elseif has_permission_to('register') and config('registration_enabled') %}
+ {{ elements.toolbar_item(__('Register'), url('register'), 'register', 'glyphicon-plus') }}
+ {% endif %}
+
+ {% if has_permission_to('login') %}
+ {{ elements.toolbar_item(__('Login'), url('login'), 'login', 'glyphicon-log-in') }}
+ {% endif %}
+
+ {% if is_user() and has_permission_to('user_messages') %}
+ {{ elements.toolbar_item(menuUserMessages(), url('user-messages'), 'user-messages', 'glyphicon-envelope') }}
+ {% endif %}
+
+ {{ menuUserHints() }}
+
+ {% if has_permission_to('user_myshifts') %}
+ {{ elements.toolbar_item(user.Nick, url('users', {'action': 'view'}), 'users', 'icon-icon_angel') }}
+ {% endif %}
+
+ {% if has_permission_to('user_settings') or has_permission_to('logout') %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+ <span class="caret"></span>
+ </a>
+ <ul class="dropdown-menu" role="menu">
+ {{ menuUserSubmenu()|join(" ")|raw }}
+ </ul>
+ </li>
+ {% endif %}
+
+ </ul>
+ {% endblock %}
+ </div>
+ {% endblock %}
+ {% endblock %}
+ </div>
+</div>
diff --git a/resources/views/pages/credits.html b/resources/views/pages/credits.html
deleted file mode 100644
index 4e247113..00000000
--- a/resources/views/pages/credits.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<div class="container">
- <h1>Credits</h1>
- <div class="row">
- <div class="col-md-4">
- <h2>Source code</h2>
- <p>
- The original system was written by <a href="https://github.com/cookieBerlin/engelsystem">cookie</a>.
- It was then completely rewritten and enhanced by
- <a href="https://notrademark.de">msquare</a> (maintainer),
- <a href="https://myigel.name">MyIgel</a>,
- <a href="https://mortzu.de">mortzu</a>,
- <a href="https://jplitza.de">jplitza</a> and
- <a href="https://github.com/gnomus">gnomus</a>.
- </p>
- <p>
- Please look at the <a href="https://github.com/engelsystem/engelsystem/graphs/contributors">
- contributor list on github</a> for a more complete version.
- </p>
- </div>
- <div class="col-md-4">
- <h2>Hosting</h2>
- <p>
- Webspace, development platform and domain on <a href="https://engelsystem.de">engelsystem.de</a>
- is currently provided by <a href="https://www.wybt.net/">would you buy this?</a> (ichdasich)
- and adminstrated by <a href="https://mortzu.de">mortzu</a>,
- <a href="http://derf.homelinux.org">derf</a> and ichdasich.
- </p>
- </div>
- <div class="col-md-4">
- <h2>Translation</h2>
- <p>
- Many thanks for the german translation: <a href="http://e7p.de">e7p</a>
- </p>
- </div>
- </div>
-</div>
diff --git a/resources/views/pages/credits.twig b/resources/views/pages/credits.twig
new file mode 100644
index 00000000..ff2bf873
--- /dev/null
+++ b/resources/views/pages/credits.twig
@@ -0,0 +1,42 @@
+{% extends "layouts/app.twig" %}
+
+{% block title %}{{ __('Credits') }}{% endblock %}
+
+{% block content %}
+ <div class="container">
+ <h1>Credits</h1>
+ <div class="row">
+ <div class="col-md-4">
+ <h2>Source code</h2>
+ <p>
+ The original system was written by <a href="https://github.com/cookieBerlin/engelsystem">cookie</a>.
+ It was then completely rewritten and enhanced by
+ <a href="https://notrademark.de">msquare</a> (maintainer),
+ <a href="https://myigel.name">MyIgel</a>,
+ <a href="https://mortzu.de">mortzu</a>,
+ <a href="https://jplitza.de">jplitza</a> and
+ <a href="https://github.com/gnomus">gnomus</a>.
+ </p>
+ <p>
+ Please look at the <a href="https://github.com/engelsystem/engelsystem/graphs/contributors">
+ contributor list on github</a> for a more complete version.
+ </p>
+ </div>
+ <div class="col-md-4">
+ <h2>Hosting</h2>
+ <p>
+ Webspace, development platform and domain on <a href="https://engelsystem.de">engelsystem.de</a>
+ is currently provided by <a href="https://www.wybt.net/">would you buy this?</a> (ichdasich)
+ and adminstrated by <a href="https://mortzu.de">mortzu</a>,
+ <a href="http://derf.homelinux.org">derf</a> and ichdasich.
+ </p>
+ </div>
+ <div class="col-md-4">
+ <h2>Translation</h2>
+ <p>
+ Many thanks for the german translation: <a href="http://e7p.de">e7p</a>
+ </p>
+ </div>
+ </div>
+ </div>
+{% endblock %}
diff --git a/resources/views/pages/user-shifts.html b/resources/views/pages/user-shifts.html
index b1b7ac1a..2278cc07 100644
--- a/resources/views/pages/user-shifts.html
+++ b/resources/views/pages/user-shifts.html
@@ -61,21 +61,23 @@
</div>
</div>
<div class="col-md-6">
- <button class="btn btn-info btn-sm" style="margin-top: 20px; margin-bottom:10px" type="button" data-toggle="collapse"
- data-target="#collapseRoomSelect" aria-expanded="false"
- aria-controls="collapseRoomSelect">
+ <button class="btn btn-info btn-sm" style="margin-top: 20px; margin-bottom:10px" type="button"
+ data-toggle="collapse"
+ data-target="#collapseRoomSelect" aria-expanded="false"
+ aria-controls="collapseRoomSelect"
+ >
collapse/show filters
</button>
<div class="collapse in row" id="collapseRoomSelect">
<div class="col-xs-4 col-xxs-12">%room_select%</div>
<div class="col-xs-4 col-xxs-12">%type_select%</div>
<div class="col-xs-4 col-xxs-12">%filled_select%</div>
- <div class="col-sm-12"><p>%task_notice%</p></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
+ <div><p>%task_notice%</p></div>
<input class="btn btn-primary" type="submit" style="width:75%; margin-bottom: 20px" value="%filter%">
</div>
</div>