Affichage correct des commentaires liés aux profils

This commit is contained in:
Fred Tempez 2023-07-07 19:03:41 +02:00
parent 690f8f1739
commit 5e2687bd44
2 changed files with 33 additions and 20 deletions

View File

@ -14,7 +14,9 @@
$(document).ready(function () { $(document).ready(function () {
$(".userEditGroupProfil").hide(); $(".userEditGroupProfil").hide();
$(".userCommentProfil").hide();
$("#userEditGroupProfil" + $("#userEditGroup").val()).show(); $("#userEditGroupProfil" + $("#userEditGroup").val()).show();
$("#userCommentProfil" + $("#userEditGroup").val()).show();
$("#userEditGroup").on("change", function () { $("#userEditGroup").on("change", function () {
$(".userEditGroupProfil").hide(); $(".userEditGroupProfil").hide();

View File

@ -110,7 +110,7 @@
'disabled' => ($this->getUrl(2) === $this->getUser('id')), 'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe', 'label' => 'Groupe',
'selected' => $this->getData(['user', $this->getUrl(2), 'group']) 'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
]); ?> ]); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -119,36 +119,47 @@
id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>"> id="userEditGroupProfil<?php echo self::GROUP_MEMBER; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [ <?php echo template::select('userEditProfil' . self::GROUP_MEMBER, $module::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']) 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?> ]); ?>
</div> </div>
<div class="userEditGroupProfil displayNone" <div class="userEditGroupProfil displayNone"
id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>"> id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [ <?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']) 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]); ?> ]); ?>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>" class="col12 displayNone userCommentProfil"> <div class="col12">
<?php echo template::textarea('useraddProfilComment' . self::GROUP_MEMBER, [ <div id="userCommentProfil<?php echo self::GROUP_MEMBER; ?>"
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MEMBER]) class="col12 userCommentProfil">
]); <?php echo template::textarea('userEditProfilComment' . self::GROUP_MEMBER, [
?> "value" => implode("\n", $module::$userProfilsComments[self::GROUP_MEMBER]),
</div> 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
<div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 displayNone userCommentProfil"> ]);
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [ ?>
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR]) </div>
]); <div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>"
?> class="col12 userCommentProfil">
</div> <?php echo template::textarea('userEditProfilComment' . self::GROUP_EDITOR, [
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>" class="col12 displayNone userCommentProfil"> "value" => implode("\n", $module::$userProfilsComments[self::GROUP_EDITOR]),
<?php echo template::textarea('useraddProfilComment' . self::GROUP_ADMIN, [ 'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_ADMIN]) ]);
]); ?>
?> </div>
<div id="userCommentProfil<?php echo self::GROUP_ADMIN; ?>"
class="col12 userCommentProfil">
<?php echo template::textarea('userEditProfilComment' . self::GROUP_ADMIN, [
'label' => 'Commentaire',
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_ADMIN]),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
]);
?>
</div>
</div> </div>
</div> </div>
</div> </div>