From 125378ec93b9a95c54ccdeef56da65d9f8072616 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sat, 11 Jul 2020 19:44:02 +0200 Subject: [PATCH] blog config layout + jquery --- module/blog/view/edit/edit.js.php | 34 ++++++++++++++++++++++++ module/blog/view/edit/edit.php | 43 ++++++++++++++++++------------- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/module/blog/view/edit/edit.js.php b/module/blog/view/edit/edit.js.php index 837db768..0b4cc432 100755 --- a/module/blog/view/edit/edit.js.php +++ b/module/blog/view/edit/edit.js.php @@ -28,4 +28,38 @@ $("#blogEditMailNotification").on("change", function() { $("#blogEditDraft").on("click", function() { $("#blogEditState").val(0); $("#blogEditForm").trigger("submit"); +}); + + +$("#blogEditCloseComment").on("change", function() { + if ($(this).is(':checked') ) { + $("#commentOptionsWrapper").slideUp(); + } else { + $("#commentOptionsWrapper").slideDown(); + } +}); + +$("#blogEditMailNotification").on("change", function() { + if ($(this).is(':checked') ) { + $("#blogEditGroupNotification").slideDown(); + } else { + $("#blogEditGroupNotification").slideUp(); + } +}); + + +$( document).ready(function() { + + if ($("#blogEditCloseComment").is(':checked') ) { + $("#commentOptionsWrapper").slideUp(); + } else { + $("#commentOptionsWrapper").slideDown(); + } + + if ($("#blogEditMailNotification").is(':checked') ) { + $("#blogEditGroupNotification").slideDown(); + } else { + $("#blogEditGroupNotification").slideUp(); + } + }); \ No newline at end of file diff --git a/module/blog/view/edit/edit.php b/module/blog/view/edit/edit.php index c4c25205..bd27ed4b 100755 --- a/module/blog/view/edit/edit.php +++ b/module/blog/view/edit/edit.php @@ -21,6 +21,7 @@ 'Publier' ]); ?> +
@@ -73,13 +74,18 @@ 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'content']) ]); ?>
-
+

Options de publication

+ 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, mise en forme html comprise.', + 'label' => 'Caractères par commentaire', + 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'maxlengthcomment']) + ]); ?> 'Auteur', 'selected' => $this->getUser('id'), - 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false + 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false ]); ?> 'L\'article n\'est visible qu\'après la date de publication prévue.', @@ -88,26 +94,27 @@ ]); ?>
-
+
-

Options avancées

- 'Choix du nombre maximum de caractères pour chaque commentaire de l\'article, caractères de mise en forme html inclus.', - 'label' => 'Nombre maximum de caractères pour chaque commentaire', - 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'maxlengthcomment']) - ]); ?> +

Options des commentaires

$this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment']) ]); ?> - $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']), - 'help' => 'Editeurs = éditeurs + administrateurs
Membres = membres + éditeurs + administrateurs' - - ]); ?> - '', - 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']) - ]); ?> +
+
+
+ $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']), + ]); ?> +
+
+ $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']), + 'help' => 'Editeurs = éditeurs + administrateurs
Membres = membres + éditeurs + administrateurs' + ]); ?> +
+
+