From 6a0f32900b395a84f8f6f256bfc03c23d7f1a3ad Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Sun, 12 Sep 2021 20:57:44 +0200 Subject: [PATCH] Bug fixes on UI --- bl-kernel/admin/views/content.php | 17 + bl-kernel/admin/views/editor.php | 13 +- bl-kernel/admin/views/editor/file-manager.php | 409 +++++++++--------- bl-kernel/admin/views/plugins.php | 261 ++++++----- bl-kernel/admin/views/settings.php | 6 + 5 files changed, 367 insertions(+), 339 deletions(-) diff --git a/bl-kernel/admin/views/content.php b/bl-kernel/admin/views/content.php index 90f0e6b1..04efed54 100644 --- a/bl-kernel/admin/views/content.php +++ b/bl-kernel/admin/views/content.php @@ -80,6 +80,7 @@ function table($type) global $scheduled; global $static; global $sticky; + global $unlisted; if ($type == 'published') { $list = $published; @@ -113,6 +114,14 @@ function table($type) echo '

'; return false; } + } elseif ($type == 'unlisted') { + $list = $unlisted; + if (empty($list)) { + echo '

'; + echo $L->g('There are no unlisted pages at this moment.'); + echo '

'; + return false; + } } elseif ($type == 'sticky') { $list = $sticky; if (empty($list)) { @@ -234,6 +243,9 @@ function table($type) } ?> + @@ -295,6 +307,11 @@ function table($type) + +
+ +
+
diff --git a/bl-kernel/admin/views/editor.php b/bl-kernel/admin/views/editor.php index ad210660..c87b1e0b 100644 --- a/bl-kernel/admin/views/editor.php +++ b/bl-kernel/admin/views/editor.php @@ -134,8 +134,11 @@ var args = { title: $('#title').val(), content: editorGetContent(), + coverImage: $('#coverImage').val(), category: $('#category option:selected').val(), - tags: $('#tags').val() + tags: $("#tags option:selected").map(function() { + return this.value + }).get().join(",") } savePage(args); disableBtnSave(); @@ -177,6 +180,7 @@ var args = { title: $('#title').val(), content: editorGetContent(), + coverImage: $('#coverImage').val(), category: $('#category option:selected').val(), tags: $("#tags option:selected").map(function() { return this.value @@ -288,7 +292,9 @@ // ------------------------------------------------------------------------ $('#btnSaveSeo').on('click', function() { var args = { - parent: $('#parent').val() + noindex: $('input[name="noindex"]').is(':checked'), + nofollow: $('input[name="nofollow"]').is(':checked'), + noarchive: $('input[name="noarchive"]').is(':checked') }; savePage(args); disableBtnSave(); @@ -594,7 +600,8 @@
p('Cover Image') ?>
- Cover image preview + + Cover image preview
diff --git a/bl-kernel/admin/views/editor/file-manager.php b/bl-kernel/admin/views/editor/file-manager.php index 7a7ef149..b22195da 100644 --- a/bl-kernel/admin/views/editor/file-manager.php +++ b/bl-kernel/admin/views/editor/file-manager.php @@ -1,224 +1,233 @@ \ No newline at end of file diff --git a/bl-kernel/admin/views/plugins.php b/bl-kernel/admin/views/plugins.php index b29d1a6b..7a3b8c8d 100644 --- a/bl-kernel/admin/views/plugins.php +++ b/bl-kernel/admin/views/plugins.php @@ -1,89 +1,89 @@
-

p('Plugins') ?>

- +

p('Plugins') ?>

+
'search', 'title' => $L->g('Search plugins'))); ?> @@ -92,85 +92,74 @@ 'check-square', 'title' => $L->g('Enabled plugins'))); +echo ''; -echo ' -
- -'; - -// Show installed plugins foreach ($pluginsInstalled as $plugin) { - echo ''; + echo ''; - echo ''; + + echo ''; + + echo ''; + + echo ''; - echo ''; - - echo ''; - - echo ''; - - echo ''; + echo ''; } - -echo ' - -
-
' . $plugin->name() . '
-
'; - if (method_exists($plugin, 'form')) { - echo '' . $L->g('Settings') . ''; - } - // You can not disable a plugin for an activated theme - if ($plugin->type()!='theme') { - echo '' . $L->g('Deactivate') . ''; - } - echo '
'; + echo '
'; + echo '
' . $plugin->name().'
'; + echo '
'; + if (method_exists($plugin, 'form')) { + echo '' . $L->g('Settings') . ''; + } + // You can not disable a plugin for theme which is active + if ($plugin->type() != 'theme') { + echo '' . $L->g('Deactivate') . ''; + } + echo '
'; + echo '
'; + echo '
' . $plugin->description() . '
'; + if (in_array($plugin->type(), array('dashboard','theme','editor'))) { + echo '
'.$L->g($plugin->type()).'
'; + } + echo '
'; + echo '' . $plugin->version() . ''; + echo ''; + echo '' . $plugin->author() . ''; echo ''; - echo $plugin->description(); - echo ''; - echo '' . $plugin->version() . ''; - echo ' - ' . $plugin->author() . ' -
-'; - -echo Bootstrap::formTitle(array('icon' => 'dash-square', 'title' => $L->g('Disabled plugins'))); - -echo ' - - -'; +echo '
'; // Plugins not installed +echo Bootstrap::formTitle(array('icon' => 'dash-square', 'title' => $L->g('Disabled plugins'))); +echo ''; + $pluginsNotInstalled = array_diff_key($plugins['all'], $pluginsInstalled); foreach ($pluginsNotInstalled as $plugin) { - echo ''; + echo ''; - echo ''; + echo ''; - echo ''; + + echo ''; + + echo ''; - echo ''; - - echo ''; - - echo ''; + echo ''; } -echo ' - -
-
' . $plugin->name() . '
-
- ' . $L->g('Activate') . ' -
-
'; + echo '
' . $plugin->name() . '
'; + echo '
' . $L->g('Activate') . '
'; + echo '
'; - echo $plugin->description(); + echo ''; + echo '
' . $plugin->description() . '
'; + if (in_array($plugin->type(), array('dashboard','theme','editor'))) { + echo '
'.$L->g($plugin->type()).'
'; + } + echo '
'; + echo '' . $plugin->version() . ''; + echo ''; + echo '' . $plugin->author() . ''; echo ''; - echo '' . $plugin->version() . ''; - echo ' - ' . $plugin->author() . ' -
-'; +echo ''; diff --git a/bl-kernel/admin/views/settings.php b/bl-kernel/admin/views/settings.php index 711d9b57..cb70af14 100644 --- a/bl-kernel/admin/views/settings.php +++ b/bl-kernel/admin/views/settings.php @@ -42,6 +42,12 @@ args[key] = value; }); + $('textarea[data-save="true"]').each(function() { + var key = $(this).attr('name'); + var value = $(this).val(); + args[key] = value; + }); + api.saveSettings(args).then(function(response) { if (response.status == 0) { logs('Settings saved.');