blog config layout + jquery

This commit is contained in:
Fred Tempez 2020-07-11 19:44:02 +02:00
parent a94d0b4433
commit 125378ec93
2 changed files with 59 additions and 18 deletions

View File

@ -28,4 +28,38 @@ $("#blogEditMailNotification").on("change", function() {
$("#blogEditDraft").on("click", function() { $("#blogEditDraft").on("click", function() {
$("#blogEditState").val(0); $("#blogEditState").val(0);
$("#blogEditForm").trigger("submit"); $("#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();
}
}); });

View File

@ -21,6 +21,7 @@
<?php echo template::submit('blogEditSubmit', [ <?php echo template::submit('blogEditSubmit', [
'value' => 'Publier' 'value' => 'Publier'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
@ -73,13 +74,18 @@
'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'content']) 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'content'])
]); ?> ]); ?>
<div class="row"> <div class="row">
<div class="col6"> <div class="col4">
<div class="block"> <div class="block">
<h4>Options de publication</h4> <h4>Options de publication</h4>
<?php echo template::select('blogEditlength', $module::$longueur_comment,[
'help' => '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'])
]); ?>
<?php echo template::select('blogEditUserId', $module::$users, [ <?php echo template::select('blogEditUserId', $module::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
]); ?> ]); ?>
<?php echo template::date('blogEditPublishedOn', [ <?php echo template::date('blogEditPublishedOn', [
'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.', 'help' => 'L\'article n\'est visible qu\'après la date de publication prévue.',
@ -88,26 +94,27 @@
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="col6"> <div class="col8">
<div class="block"> <div class="block">
<h4>Options avancées</h4> <h4>Options des commentaires</h4>
<?php echo template::select('blogEditlength', $module::$longueur_comment,[
'help' => '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'])
]); ?>
<?php echo template::checkbox('blogEditCloseComment', true, 'Fermer les commentaires', [ <?php echo template::checkbox('blogEditCloseComment', true, 'Fermer les commentaires', [
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment']) 'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'closeComment'])
]); ?> ]); ?>
<?php echo template::checkbox('blogEditMailNotification', true, 'Notifier le commentaire aux groupes à partir de :', [ <div id="commentOptionsWrapper">
'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']), <div class="row">
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs' <div class="col7">
<?php echo template::checkbox('blogEditMailNotification', true, 'Notification des nouveaux commentaires par mail aux groupes', [
]); ?> 'checked' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'mailNotification']),
<?php echo template::select('blogEditGroupNotification', $module::$groupNews, [ ]); ?>
'label' => '', </div>
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']) <div class="col5">
]); ?> <?php echo template::select('blogEditGroupNotification', $module::$groupNews, [
'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'groupNotification']),
'help' => 'Editeurs = éditeurs + administrateurs<br/> Membres = membres + éditeurs + administrateurs'
]); ?>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>