Fix comment creation in archived articles

This commit is contained in:
Léo Serre 2019-01-30 21:09:43 +01:00
parent fa8f50a3d9
commit b41d768cca
1 changed files with 5 additions and 3 deletions

View File

@ -49,11 +49,13 @@
<!-- COMMENTS --> <!-- COMMENTS -->
<? if ($blogArticle->is_commentable == "t" && $blogArticle->is_archive == "f" && $blogArticle->is_public == "t") { ?> <? if ($blogArticle->is_commentable == "t") { ?>
<div id="new_comment"> <div id="new_comment">
<form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/new_comment" method="post"> <form class="form" action="<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/new_comment" method="post">
<div id="new_comment_label" <?=$user->rank=="visitor"?"class='sent' ":""?>> <div id="new_comment_label" <?=$user->rank=="visitor"?"class='sent' ":""?>>
<? if ($user->rankIsHigher("registered")) { ?> <? if ($blogArticle->is_archive == "t" || $blogArticle->is_public == "f") { ?>
<p>Impossible de commenter un article non publié</p>
<? } else if ($user->rankIsHigher("registered")) { ?>
<input name="submit" type="submit" value="Envoyer"> <input name="submit" type="submit" value="Envoyer">
<p>Ajouter un nouveau commentaire</p> <p>Ajouter un nouveau commentaire</p>
<? } else { ?> <? } else { ?>
@ -110,7 +112,7 @@ $( "#bloghistory" ).change(function() {
}); });
</script> </script>
<? } ?> <? } ?>
<? if($user->rankIsHigher("registered")) { ?> <? if($user->rankIsHigher("registered") && $blogArticle->is_archive == "f" && $blogArticle->is_public == "t") { ?>
<script type="text/javascript"> <script type="text/javascript">
$( "#new_comment_label" ).click(function() { $( "#new_comment_label" ).click(function() {
$( "#new_comment_form" ).show(400); $( "#new_comment_form" ).show(400);