Don’t add comment links when nobody is logged in.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 01:12:10 +0000 (03:12 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 23 Oct 2010 01:12:10 +0000 (03:12 +0200)
src/main/resources/static/javascript/sone.js
src/main/resources/templates/include/viewPost.html

index cd27cc3..9bb379c 100644 (file)
@@ -46,6 +46,9 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o
 
 /* hide all the “create reply” forms until a link is clicked. */
 function addCommentLinks() {
+       if (!isOnline()) {
+               return;
+       }
        $("#sone .post").each(function() {
                postId = $(this).attr("id");
                commentElement = (function(postId) {
index 1f0020c..c3ad07a 100644 (file)
                                </div>
                        </div>
                <%/foreach>
-               <div class="create-reply">
-                       <form method="post" action="createReply.html">
-                               <input type="hidden" name="formPassword" value="<% formPassword|html>" />
-                               <input type="hidden" name="returnPage" value="<% request.uri|html>" />
-                               <input type="hidden" name="post" value="<% post.id|html>" />
-                               <input type="text" class="reply-input" name="text" value="" />
-                               <button type="submit"><%= View.Post.SendReply|l10n|html></button>
-                       </form>
-               </div>
+               <%ifnull ! currentSone>
+                       <div class="create-reply">
+                               <form method="post" action="createReply.html">
+                                       <input type="hidden" name="formPassword" value="<% formPassword|html>" />
+                                       <input type="hidden" name="returnPage" value="<% request.uri|html>" />
+                                       <input type="hidden" name="post" value="<% post.id|html>" />
+                                       <input type="text" class="reply-input" name="text" value="" />
+                                       <button type="submit"><%= View.Post.SendReply|l10n|html></button>
+                               </form>
+                       </div>
+               <%/if>
        </div>
 </div>