Don’t show distrust button when trust is assigned. Fixes #55.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 14:18:29 +0000 (15:18 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 16 Jan 2011 14:18:29 +0000 (15:18 +0100)
src/main/resources/static/javascript/sone.js
src/main/resources/templates/include/viewPost.html
src/main/resources/templates/include/viewReply.html

index 7fe842b..e790e9e 100644 (file)
@@ -457,14 +457,14 @@ function updateTrustControls(soneId, trustValue) {
        $("#sone .post").each(function() {
                if (getPostAuthor(this) == soneId) {
                        getPostElement(this).find(".post-trust").toggleClass("hidden", trustValue != null);
-                       getPostElement(this).find(".post-distrust").toggleClass("hidden", (trustValue != null) && (trustValue < 0));
+                       getPostElement(this).find(".post-distrust").toggleClass("hidden", trustValue != null);
                        getPostElement(this).find(".post-untrust").toggleClass("hidden", trustValue == null);
                }
        });
        $("#sone .reply").each(function() {
                if (getReplyAuthor(this) == soneId) {
                        getReplyElement(this).find(".reply-trust").toggleClass("hidden", trustValue != null);
-                       getReplyElement(this).find(".reply-distrust").toggleClass("hidden", (trustValue != null) && (trustValue < 0));
+                       getReplyElement(this).find(".reply-distrust").toggleClass("hidden", trustValue != null);
                        getReplyElement(this).find(".reply-untrust").toggleClass("hidden", trustValue == null);
                }
        });
index 6d96840..64fddea 100644 (file)
@@ -48,7 +48,7 @@
                                                <input type="hidden" name="sone" value="<% post.sone.id|html>" />
                                                <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
                                        </form>
-                                       <form class="distrust post-distrust" action="distrust.html" method="post">
+                                       <form class="distrust post-distrust<%if post.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
                                                <input type="hidden" name="formPassword" value="<% formPassword|html>" />
                                                <input type="hidden" name="returnPage" value="<% request.uri|html>" />
                                                <input type="hidden" name="sone" value="<% post.sone.id|html>" />
index 2fbca43..4daf302 100644 (file)
@@ -40,7 +40,7 @@
                                                <input type="hidden" name="sone" value="<% reply.sone.id|html>" />
                                                <button type="submit" title="<%= View.Trust.Tooltip.Trust|l10n|html>">✓</button>
                                        </form>
-                                       <form class="distrust reply-distrust" action="distrust.html" method="post">
+                                       <form class="distrust reply-distrust<%if reply.sone.trust.assigned> hidden<%/if>" action="distrust.html" method="post">
                                                <input type="hidden" name="formPassword" value="<% formPassword|html>" />
                                                <input type="hidden" name="returnPage" value="<% request.uri|html>" />
                                                <input type="hidden" name="sone" value="<% reply.sone.id|html>" />