From 0165f53d4436db687f2e69485a9e612514d0f3b4 Mon Sep 17 00:00:00 2001 From: Sommerregen Date: Sat, 8 Aug 2015 11:16:04 +0200 Subject: [PATCH] Fixes #30, added logout page --- admin.php | 2 +- classes/controller.php | 2 +- themes/grav/templates/dashboard.html.twig | 14 +++++----- themes/grav/templates/denied.html.twig | 2 +- .../forms/fields/uploads/uploads.html.twig | 8 +++--- themes/grav/templates/logout.html.twig | 28 +++++++++---------- themes/grav/templates/pages.html.twig | 10 +++---- themes/grav/templates/partials/nav.html.twig | 2 +- .../partials/plugins-details.html.twig | 4 +-- .../templates/partials/plugins-list.html.twig | 4 +-- .../partials/themes-details.html.twig | 4 +-- .../templates/partials/themes-list.html.twig | 6 ++-- .../grav/templates/partials/toolbar.html.twig | 2 +- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/admin.php b/admin.php index 64810d834..41fe95d22 100644 --- a/admin.php +++ b/admin.php @@ -180,7 +180,7 @@ public function onPagesInitialized() // Replace page service with admin. $this->grav['page'] = function () use ($self) { $page = new Page; - $page->init(new \SplFileInfo(str_ireplace('task:', '',__DIR__ . "/pages/admin/{$self->template}.md"))); + $page->init(new \SplFileInfo(__DIR__ . "/pages/admin/{$self->template}.md")); $page->slug(basename($self->template)); return $page; }; diff --git a/classes/controller.php b/classes/controller.php index b9050328d..95e69b967 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -151,7 +151,7 @@ protected function taskLogout() $this->admin->session()->invalidate()->start(); $this->admin->setMessage($l->translate('LOGGED_OUT'), 'info'); - $this->setRedirect('/'); + $this->setRedirect('/logout'); return true; } diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index 0e1f2ebe4..c21b57d8c 100644 --- a/themes/grav/templates/dashboard.html.twig +++ b/themes/grav/templates/dashboard.html.twig @@ -3,15 +3,15 @@ {% block titlebar %}
@@ -62,8 +62,8 @@
- - + +
diff --git a/themes/grav/templates/denied.html.twig b/themes/grav/templates/denied.html.twig index 3a96e7b2b..11a67662e 100644 --- a/themes/grav/templates/denied.html.twig +++ b/themes/grav/templates/denied.html.twig @@ -8,7 +8,7 @@ {% include 'partials/messages.html.twig' %} -

{{ admin.user.fullname }}, your account does not have administrator permissions. Logout

+

{{ admin.user.fullname }}, your account does not have administrator permissions. Logout

{% endblock %} diff --git a/themes/grav/templates/forms/fields/uploads/uploads.html.twig b/themes/grav/templates/forms/fields/uploads/uploads.html.twig index d8ef5071b..947ff958e 100644 --- a/themes/grav/templates/forms/fields/uploads/uploads.html.twig +++ b/themes/grav/templates/forms/fields/uploads/uploads.html.twig @@ -60,7 +60,7 @@ previewTemplate: "
\n
\n
\n
\n \n
\n
\n
\n
\n
\nDelete\nInsert\n
", init: function() { thisDropzone = this; - $.get(URI + '/task:listmedia', function(data) { + $.get(URI + '/task{{ config.system.param_sep }}listmedia', function(data) { $.proxy(modalError, this, { data: data, @@ -106,7 +106,7 @@ this.on('removedfile', function(file) { if (!file.accepted || file.rejected) return; thisDropzone = this; - $.post(URI + '/task:delmedia', {filename: file.name}, function(data){ + $.post(URI + '/task{{ config.system.param_sep }}delmedia', {filename: file.name}, function(data){ $.proxy(modalError, thisDropzone, { file: file, data: data, @@ -118,7 +118,7 @@ } }; - var dropzone = new Dropzone("#gravDropzone", { url: URI + '/task:addmedia', createImageThumbnails: { thumbnailWidth: 150} }); + var dropzone = new Dropzone("#gravDropzone", { url: URI + '/task{{ config.system.param_sep }}addmedia', createImageThumbnails: { thumbnailWidth: 150} }); $("#gravDropzone").delegate('.dz-preview', 'dragstart', function(e){ var uri = $(this).find('.dz-filename').text(), shortcode = '![](' + encodeURI(uri) + ')'; @@ -146,4 +146,4 @@ -{% endif %} \ No newline at end of file +{% endif %} diff --git a/themes/grav/templates/logout.html.twig b/themes/grav/templates/logout.html.twig index 38a935300..cf454adb3 100644 --- a/themes/grav/templates/logout.html.twig +++ b/themes/grav/templates/logout.html.twig @@ -1,17 +1,17 @@ -{% extends 'partials/base.html.twig' %} - -{% block head %} +{% embed 'partials/login.html.twig' with {title:'Grav Logout'} %} + {% block head %} {{ parent() }} - -{% endblock %} + + {% endblock %} -{% block page %} -
-

- {{ title }} -

+ {% block page %} +
+

+ {{ title }} +

-
{{ 'LOGGED_OUT'|t }}
- {% include 'partials/messages.html.twig' %} -
-{% endblock %} +
{{ 'LOGGED_OUT'|t }}
+ {% include 'partials/messages.html.twig' %} +
+ {% endblock %} +{% endembed %} diff --git a/themes/grav/templates/pages.html.twig b/themes/grav/templates/pages.html.twig index 5dcd3b38f..b46e88d30 100644 --- a/themes/grav/templates/pages.html.twig +++ b/themes/grav/templates/pages.html.twig @@ -54,9 +54,9 @@ {{ p.home ? '' }} {% if warn %} - + {% else %} - + {% endif %}

{{ p.route }}

@@ -81,12 +81,12 @@ {% elseif mode == 'edit' %} Back {% if exists %} - Copy + Copy Move {% if warn %} - Delete + Delete {% else %} - + {% endif %} {% endif %} diff --git a/themes/grav/templates/partials/nav.html.twig b/themes/grav/templates/partials/nav.html.twig index 08b29b6e7..6a89b0e3e 100644 --- a/themes/grav/templates/partials/nav.html.twig +++ b/themes/grav/templates/partials/nav.html.twig @@ -62,7 +62,7 @@ -->
  • - Logout + Logout
  • diff --git a/themes/grav/templates/partials/plugins-details.html.twig b/themes/grav/templates/partials/plugins-details.html.twig index 2ed264489..8e7bdf014 100644 --- a/themes/grav/templates/partials/plugins-details.html.twig +++ b/themes/grav/templates/partials/plugins-details.html.twig @@ -35,10 +35,10 @@
    - Remove Plugin + Remove Plugin
    {% else %}
    - Install Plugin + Install Plugin
    {% endif %} diff --git a/themes/grav/templates/partials/plugins-list.html.twig b/themes/grav/templates/partials/plugins-list.html.twig index b0a80ddcb..e30f6c9ca 100644 --- a/themes/grav/templates/partials/plugins-list.html.twig +++ b/themes/grav/templates/partials/plugins-list.html.twig @@ -25,11 +25,11 @@ {% if (not installing and plugin.form.fields.enabled and (plugin.form.fields.enabled.type != 'hidden')) %} - + {% elseif (installing) %} - Install + Install {% endif %} diff --git a/themes/grav/templates/partials/themes-details.html.twig b/themes/grav/templates/partials/themes-details.html.twig index b168b0b55..18a7bfb19 100644 --- a/themes/grav/templates/partials/themes-details.html.twig +++ b/themes/grav/templates/partials/themes-details.html.twig @@ -102,12 +102,12 @@ {% if (config.get('system.pages.theme') != admin.route) %}
    - Remove Theme + Remove Theme
    {% endif %} {% else %}
    - Install Theme + Install Theme
    {% endif %} diff --git a/themes/grav/templates/partials/themes-list.html.twig b/themes/grav/templates/partials/themes-list.html.twig index 87d384508..c2f0d78df 100644 --- a/themes/grav/templates/partials/themes-list.html.twig +++ b/themes/grav/templates/partials/themes-list.html.twig @@ -31,15 +31,15 @@ {% if (state == 'installing') %}
    - Install + Install
    {% elseif state == 'active' %}
    Active Theme
    {% else %} - - {# #} + + {# #} Activate {% endif %} diff --git a/themes/grav/templates/partials/toolbar.html.twig b/themes/grav/templates/partials/toolbar.html.twig index 59b961de8..34c6b4ff8 100644 --- a/themes/grav/templates/partials/toolbar.html.twig +++ b/themes/grav/templates/partials/toolbar.html.twig @@ -10,6 +10,6 @@ {% if admin.authorise %} -6Hi, {{ admin.user.fullname }} Logout +6Hi, {{ admin.user.fullname }} Logout {% endif %}