Przeglądaj źródła

Fix comment creation in archived articles

Léo Serre 8 miesięcy temu
rodzic
commit
b41d768cca
1 zmienionych plików z 5 dodań i 3 usunięć
  1. 5
    3
      views/d.blog.view.html

+ 5
- 3
views/d.blog.view.html Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz