aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorhubzilla <git@macgirvin.com>2016-08-14 21:24:24 +1000
committerGitHub <noreply@github.com>2016-08-14 21:24:24 +1000
commitd1cb925b5902e01eb1580921260faf3362279249 (patch)
tree36b38379936da4c70d300443fb8176e2fe48ec50 /view
parent993b182f811a6e7f3287c9554b00abd72517954d (diff)
parent229cc2ac431cdcef80cc45a42178fe7a1e4233e4 (diff)
downloadvolse-hubzilla-d1cb925b5902e01eb1580921260faf3362279249.tar.gz
volse-hubzilla-d1cb925b5902e01eb1580921260faf3362279249.tar.bz2
volse-hubzilla-d1cb925b5902e01eb1580921260faf3362279249.zip
Merge pull request #482 from anaqreon/nocomment
Added an optional post editor button to toggle comments
Diffstat (limited to 'view')
-rwxr-xr-xview/tpl/jot-header.tpl13
-rwxr-xr-xview/tpl/jot.tpl9
2 files changed, 22 insertions, 0 deletions
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index fc87c14d7..3d38df0f0 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -371,6 +371,19 @@ function enableOnUser(){
}
}
+ function toggleNoComment() {
+ if($('#jot-nocomment').val() > 0) {
+ $('#jot-nocomment').val(0);
+ $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments-o').addClass('fa-comments');
+ $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_enabled}}');
+ }
+ else {
+ $('#jot-nocomment').val(1);
+ $('#profile-nocomment, #profile-nocomment-sub').removeClass('fa-comments').addClass('fa-comments-o');
+ $('#profile-nocomment-wrapper').attr('title', '{{$nocomment_disabled}}');
+ }
+ }
+
function jotReact(id,icon) {
if(id && icon) {
$.get('{{$baseurl}}/react?f=&postid=' + id + '&emoji=' + icon);
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index 692cf129d..20357b66f 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -23,6 +23,7 @@
<input type="hidden" name="webpage" value="{{$webpage}}" />
<input type="hidden" name="preview" id="jot-preview" value="0" />
<input type="hidden" id="jot-consensus" name="consensus" value="{{if $consensus}}{{$consensus}}{{else}}0{{/if}}" />
+ <input type="hidden" id="jot-nocomment" name="nocomment" value="{{if $nocomment}}{{$nocomment}}{{else}}0{{/if}}" />
{{if $webpage}}
<div id="jot-pagetitle-wrap" class="jothidden">
@@ -118,6 +119,11 @@
<i id="profile-voting" class="fa fa-square-o jot-icons"></i>
</button>
{{/if}}
+ {{if $feature_nocomment}}
+ <button id="profile-nocomment-wrapper" class="btn btn-default btn-sm" title="{{$nocommenttitle}}" onclick="toggleNoComment();return false;">
+ <i id="profile-nocomment" class="fa fa-comments jot-icons"></i>
+ </button>
+ {{/if}}
</div>
{{if $writefiles || $weblink || $setloc || $clearloc || $feature_expire || $feature_encrypt || $feature_voting}}
<div class="btn-group visible-xs visible-sm">
@@ -151,6 +157,9 @@
{{if $feature_voting}}
<li><a href="#" onclick="toggleVoting(); return false;"><i id="profile-voting-sub" class="fa fa-square-o"></i>&nbsp;{{$voting}}</a></li>
{{/if}}
+ {{if $feature_nocomment}}
+ <li><a href="#" onclick="toggleNoComment(); return false;"><i id="profile-nocomment-sub" class="fa fa-comments"></i>&nbsp;{{$nocommenttitlesub}}</a></li>
+ {{/if}}
</ul>
</div>
{{/if}}