diff --git a/classes/controller.php b/classes/controller.php index b9050328..95e69b96 100644 --- a/classes/controller.php +++ b/classes/controller.php @@ -151,7 +151,7 @@ class AdminController $this->admin->session()->invalidate()->start(); $this->admin->setMessage($l->translate('LOGGED_OUT'), 'info'); - $this->setRedirect('/'); + $this->setRedirect('/logout'); return true; } diff --git a/pages/admin/logout.md b/pages/admin/logout.md new file mode 100644 index 00000000..371ebd8c --- /dev/null +++ b/pages/admin/logout.md @@ -0,0 +1,14 @@ +--- +title: Dashboard Logout + +form: + fields: + - name: username + type: text + placeholder: Username + autofocus: true + + - name: password + type: password + placeholder: Password +--- diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index 78628fe1..8c9a0722 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -123,13 +123,14 @@ $(function () { $(this).attr('disabled','disabled').find('> .fa').removeClass('fa-cloud-download').addClass('fa-refresh fa-spin'); var url = $(this).data('maintenanceUpdate'); + var task = 'task' + GravAdmin.config.param_sep; GravAjax({ dataType: "json", url: url, toastErrors: true, success: function(result, status) { - if (url.indexOf('task:updategrav') !== -1) { + if (url.indexOf(task + 'updategrav') !== -1) { if (result.status == 'success') { $('[data-gpm-grav]').remove(); toastr.success(result.message + window.grav_available_version); @@ -181,6 +182,7 @@ $(function () { url: url, toastErrors: true, success: function(result, status) { + var task = 'task' + GravAdmin.config.param_sep; var toastrBackup = {}; if (result.toastr) { @@ -198,7 +200,7 @@ $(function () { } } - if (url.indexOf('task:backup') !== -1) { + if (url.indexOf(task + 'backup') !== -1) { //Reset backup days count $('.backups-chart .numeric').html("0 days"); @@ -255,13 +257,14 @@ $(function () { success: function (response) { var grav = response.payload.grav, installed = response.payload.installed, - resources = response.payload.resources; + resources = response.payload.resources, + task = 'task' + GravAdmin.config.param_sep; // grav updatable if (grav.isUpdatable) { var icon = ' '; content = 'Grav v{available} is now available! (Current: v{version}) ', - button = ''; + button = ''; if (grav.isSymlink) { button = ''; @@ -293,7 +296,7 @@ $(function () { var length, icon = '', content = '{updates} of your {type} have an update available', - button = 'Update {Type}', + button = 'Update {Type}', plugins = $('.grav-update.plugins'), themes = $('.grav-update.themes'), sidebar = {plugins: $('#admin-menu a[href$="/plugins"]'), themes: $('#admin-menu a[href$="/themes"]')}; diff --git a/themes/grav/js/mdeditor.js b/themes/grav/js/mdeditor.js index 7b9e4829..efe4c0dc 100644 --- a/themes/grav/js/mdeditor.js +++ b/themes/grav/js/mdeditor.js @@ -36,7 +36,8 @@ ].join(''); var MDEditor = function(editor, options){ - var tpl = template, $this = this; + var tpl = template, $this = this, + task = 'task' + GravAdmin.config.param_sep; this.defaults = { markdown : false, @@ -93,7 +94,7 @@ if ($(this).hasClass('grav-mdeditor-button-preview')) { GravAjax({ dataType: 'JSON', - url: $this.element.data('grav-urlpreview') + '/task:processmarkdown', + url: $this.element.data('grav-urlpreview') + '/' + task + 'processmarkdown', method: 'post', data: $this.element.parents('form').serialize(), toastErrors: true, diff --git a/themes/grav/js/pages-all.js b/themes/grav/js/pages-all.js index 98f54ea8..e85fb198 100644 --- a/themes/grav/js/pages-all.js +++ b/themes/grav/js/pages-all.js @@ -76,6 +76,7 @@ $(function(){ restoreStates(); var startFilterPages = function () { + var task = 'task' + GravAdmin.config.param_sep; $('input[name="page-search"]').focus(); var flags = $('input[name="page-filter"]').val(), @@ -89,7 +90,7 @@ $(function(){ GravAjax({ dataType: 'json', method: 'POST', - url: GravAdmin.config.base_url_relative + '/pages-filter.json/task:filterPages', + url: GravAdmin.config.base_url_relative + '/pages-filter.json/' + task + 'filterPages', data: { flags: flags, query: query diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index 0e1f2ebe..c21b57d8 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 3a96e7b2..11a67662 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 d8ef5071..947ff958 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 new file mode 100644 index 00000000..cf454adb --- /dev/null +++ b/themes/grav/templates/logout.html.twig @@ -0,0 +1,17 @@ +{% embed 'partials/login.html.twig' with {title:'Grav Logout'} %} + {% block head %} + {{ parent() }} + + {% endblock %} + + {% block page %} +
+

+ {{ title }} +

+ +
{{ '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 5dcd3b38..b46e88d3 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/javascript-config.html.twig b/themes/grav/templates/partials/javascript-config.html.twig index c5014e97..e1c1854f 100644 --- a/themes/grav/templates/partials/javascript-config.html.twig +++ b/themes/grav/templates/partials/javascript-config.html.twig @@ -1,6 +1,7 @@ \ No newline at end of file + diff --git a/themes/grav/templates/partials/nav.html.twig b/themes/grav/templates/partials/nav.html.twig index 08b29b6e..6a89b0e3 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 2ed26448..8e7bdf01 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 b0a80ddc..e30f6c9c 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 b168b0b5..18a7bfb1 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 87d38450..c2f0d78d 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 59b961de..34c6b4ff 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 %}