Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

instance option to disable voting #459

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion adhocracy_client/static/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,12 @@ li.content_box .proposal_title {
li.content_box .proposal_info {
margin-left:125px;
}
li.content_box .proposal_title_disvote {
margin-left:25px;
}
li.content_box .proposal_info_disvote {
margin-left:25px;
}
li.content_box .comment_count {
display: block;
float: right;
Expand Down Expand Up @@ -397,7 +403,7 @@ div #user_menu {
.comment .comment_content :last-child {
margin-bottom:9px
}
.comment .comment_content {margin-left:35px;}
.comment .comment_content {margin-left:0px;}
.comment .comment_content .floatbox {float: right;}
.comment .comment_content li {margin-left: 20px;}
.comment h5 {margin-top: 0;}
Expand Down
3 changes: 3 additions & 0 deletions adhocracy_client/templates/comment/tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ <h3><a href="${h.entity_url(comment)}">${_("Comment") if h.comment.wording() els
%>

<div id="c${comment.id}" class="comment">

%if not c.instance.voting_disabled:
<div class="vote_comment">
${tiles.poll.widget(comment.poll)}
</div>
%endif

<div class="comment_content">
## comment title (username / pro/con / deleted)
Expand Down
2 changes: 2 additions & 0 deletions adhocracy_client/templates/instance/settings_voting.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ <h2>${c.settings_menu.current['label']}</h2>
</div>

${forms.checkbox(_("Enable vote delegation"), 'allow_delegate', 15)}

${forms.checkbox(_("Disable voting"), 'voting_disabled', 20)}

%if c.votedetail_all_userbadges is not None:
<h4>${_('Break down Voting Result by Badge')}</h4>
Expand Down
2 changes: 2 additions & 0 deletions adhocracy_client/templates/poll/tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
con = tile.widget_action_attrs(model.Vote.NO)
%>
<div class="vote_wrapper">
%if not c.instance.voting_disabled:
<div id="${tile.html_id}" class="${tile.widget_class}">
%if tile.can_vote or tile.can_show:
<a href="${pro['url']}"
Expand Down Expand Up @@ -62,6 +63,7 @@
%endif
%endif
</div>
%endif

%if delegate_url:
<span class="or">${_('or:')}</span>
Expand Down
2 changes: 2 additions & 0 deletions adhocracy_client/templates/proposal/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,11 @@ <h6>${_('Last Activity')}</h6>

<% tally = c.proposal.rate_poll.tally %>

%if not c.instance.voting_disabled:
${sidebar_defs.votes(c.proposal.rate_poll)}

${sidebar_defs.votedetail(c.votedetail)}
%endif

%if c.proposal.category:
<h6>${_('Category')}</h6>
Expand Down
12 changes: 10 additions & 2 deletions adhocracy_client/templates/proposal/tiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@
'votes': tally.num_for + tally.num_against
}
%>

<li class="content_box ${'fresh' if tile.fresh else ''}">
<h3><a class="link" href="${h.entity_url(proposal)}"><div class="vote vote_preview" title="${tooltip}"><span class="vote_for">${str(proposal.rate_poll.tally.num_for)}</span><span class="vote_against">${str(proposal.rate_poll.tally.num_against)}</span></div><div class="proposal_title">${proposal.title}</div></a>

<h3><a class="link" href="${h.entity_url(proposal)}">

%if not c.instance.voting_disabled:
<div class="vote vote_preview" title="${tooltip}"><span class="vote_for">${str(proposal.rate_poll.tally.num_for)}</span><span class="vote_against">${str(proposal.rate_poll.tally.num_against)}</span></div>
%endif

<div class="${'proposal_title_disvote' if c.instance.voting_disabled else 'proposal_title'}">${proposal.title}</div></a>
<span id="badges_${proposal.id}" class="badges"
data-id="${proposal.id}">
${tiles.badge.badges(proposal.badges + proposal.categories)}
</span>
</h3>
<div class="proposal_info"><span class="author">${h.user.link(proposal.creator)|n}</span><a href="${h.entity_url(proposal, anchor="discussions")}" class="comment_count">${'' if proposal.comment_count() == 0 else _('%s Comments') % proposal.comment_count()}</a></div>
<div class="${'proposal_info_disvote' if c.instance.voting_disabled else 'proposal_info'}"><span class="author">${h.user.link(proposal.creator)|n}</span><a href="${h.entity_url(proposal, anchor="discussions")}" class="comment_count">${'' if proposal.comment_count() == 0 else _('%s Comments') % proposal.comment_count()}</a></div>
</li>
</%def>

Expand Down