From 4a0b6cd440899facd89b20378324f04e6933e4e5 Mon Sep 17 00:00:00 2001 From: Benny Date: Mon, 7 Sep 2015 21:12:43 +0200 Subject: [PATCH 1/6] Fix missing translation in Array field This PR fixes a missing translation in the array field form, when this field is initialized with existing data. --- themes/grav/templates/forms/fields/array/array.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/grav/templates/forms/fields/array/array.html.twig b/themes/grav/templates/forms/fields/array/array.html.twig index 44de8244..9c102f09 100644 --- a/themes/grav/templates/forms/fields/array/array.html.twig +++ b/themes/grav/templates/forms/fields/array/array.html.twig @@ -15,7 +15,7 @@ {% if field.value_only != true %} {% endif %} - + From 8688eb84290e2e1dd9f98aeb2f3c85035fed5195 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Mon, 7 Sep 2015 21:54:44 +0200 Subject: [PATCH 2/6] Fix page title visualization in the admin page, if it's not set in the header --- themes/grav/templates/pages.html.twig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/themes/grav/templates/pages.html.twig b/themes/grav/templates/pages.html.twig index ae53065f..e8d2826f 100644 --- a/themes/grav/templates/pages.html.twig +++ b/themes/grav/templates/pages.html.twig @@ -11,7 +11,7 @@ {% if context.exists %} {% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %} {% set exists = true %} - {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ context.header.title %} + {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %} {% else %} {% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %} {% endif %} @@ -319,4 +319,3 @@ {% endblock %} - From ae29c38f19ef0875447057084f5874ab8679aaa2 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:06:07 -0700 Subject: [PATCH 3/6] Maintain cursor position while cleaning up the folder name value (fixes #144) --- themes/grav/js/pages-all.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/themes/grav/js/pages-all.js b/themes/grav/js/pages-all.js index 69172579..acf0e7b4 100644 --- a/themes/grav/js/pages-all.js +++ b/themes/grav/js/pages-all.js @@ -163,8 +163,14 @@ $(function(){ $('input[name="folder"]').on('input', function(e){ + var start = this.selectionStart, + end = this.selectionEnd; + value = $(this).val().toLowerCase().replace(/\s/g, '-').replace(/[^a-z0-9_\-]/g, ''); $(this).val(value); + + // restore cursor position + this.setSelectionRange(start, end); }); childrenToggles.on('click', function () { From 55bad8dd0ba4e13fa3b008d77831120f9024306d Mon Sep 17 00:00:00 2001 From: Benny Date: Mon, 7 Sep 2015 22:07:22 +0200 Subject: [PATCH 4/6] Reduce complexity of Install/Uninstall gpm action This PR reduces the complexity of checking the visibility status of the GPM action "Install/Uninstall". This action field is only hidden on those plugins with a `enabled.type: hidden` field and shown otherwise. This PR especially accounts for plugins which have an `enabled: true` property, but their `enabled` option in the blueprint is located elsewhere (e.g. wrapped in a section field). --- themes/grav/templates/partials/plugins-list.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/grav/templates/partials/plugins-list.html.twig b/themes/grav/templates/partials/plugins-list.html.twig index 7a52dab0..42476fed 100644 --- a/themes/grav/templates/partials/plugins-list.html.twig +++ b/themes/grav/templates/partials/plugins-list.html.twig @@ -23,7 +23,7 @@ v{{ plugin.version }} - {% if (not installing and plugin.form.fields.enabled and (plugin.form.fields.enabled.type != 'hidden')) %} + {% if (not installing and (plugin.form.fields.enabled.type != 'hidden')) %} From 68774774c25835c21d55db04acdc3c6747b6ed92 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:07:33 -0700 Subject: [PATCH 5/6] Added input fields to the exclusion list of draggable elements in Collections (fixes #142) --- themes/grav/js/admin-all.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index cc389de0..856c9542 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -436,10 +436,13 @@ $(function () { template = el.find('[data-collection-template="new"]').html(); // make sortable - new Sortable(holder[0], { onUpdate: function () { - if (isArray) - reIndex(el); - } }); + new Sortable(holder[0], { + filter: '.form-input-wrapper', + onUpdate: function () { + if (isArray) + reIndex(el); + } + }); // hook up delete el.on('click', '[data-action="delete"]', function (e) { From 8381795f31ce90e619b13fa750c272a6303a2865 Mon Sep 17 00:00:00 2001 From: Djamil Legato Date: Mon, 7 Sep 2015 13:44:12 -0700 Subject: [PATCH 6/6] Fixed Chartist issue with Firefox (fixes #138) --- themes/grav/js/admin-all.js | 5 ++++- themes/grav/templates/dashboard.html.twig | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/themes/grav/js/admin-all.js b/themes/grav/js/admin-all.js index 856c9542..96ee77c8 100644 --- a/themes/grav/js/admin-all.js +++ b/themes/grav/js/admin-all.js @@ -18,6 +18,8 @@ var bytesToSize = function(bytes) { return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i]; }; +var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; + $(function () { jQuery.substitute = function(str, sub) { return str.replace(/\{(.+?)\}/g, function($0, $1) { @@ -71,7 +73,8 @@ $(function () { startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; UpdatesChart = Chartist.Pie('.updates-chart .ct-chart', data, options); diff --git a/themes/grav/templates/dashboard.html.twig b/themes/grav/templates/dashboard.html.twig index 544c6d0d..013cb5e4 100644 --- a/themes/grav/templates/dashboard.html.twig +++ b/themes/grav/templates/dashboard.html.twig @@ -52,7 +52,8 @@ startAngle: 0, total: 100, showLabel: false, - height: 150 + height: 150, + chartPadding: !isFirefox ? 5 : 10 }; Chartist.Pie('.backups-chart .ct-chart', data, options); @@ -80,7 +81,7 @@ }; var options = { height: 164, - chartPadding:5, + chartPadding: !isFirefox ? 5 : 25, axisX: { showGrid: false,