Skip to content

Commit

Permalink
Merge d4a9340 into 154dd0c
Browse files Browse the repository at this point in the history
  • Loading branch information
Rineee committed Apr 27, 2020
2 parents 154dd0c + d4a9340 commit f82f887
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions euth/communitydebate/phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class DebatePhase(phases.PhaseContent):

features = {
'crud': (models.Topic,),
'comment': (models.Topic,),
'rate': (models.Topic,),
}


Expand Down
15 changes: 14 additions & 1 deletion euth/communitydebate/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
is_context_member,
is_context_moderator, is_owner,
is_public_context)
from adhocracy4.phases.predicates import phase_allows_add, phase_allows_change
from adhocracy4.phases.predicates import (phase_allows_add,
phase_allows_change,
phase_allows_comment,
phase_allows_rate)

from .models import Topic

rules.add_perm('euth_communitydebate.comment_topic',
is_superuser | is_context_moderator | is_context_initiator |
(is_context_member & phase_allows_comment))


rules.add_perm('euth_communitydebate.modify_topic',
is_superuser | is_context_moderator | is_context_initiator |
(is_context_member & is_owner & phase_allows_change))
Expand All @@ -19,6 +27,11 @@
(is_context_member & phase_allows_add(Topic)))


rules.add_perm('euth_communitydebate.rate_topic',
is_superuser | is_context_moderator | is_context_initiator |
(is_context_member & phase_allows_rate))


rules.add_perm('euth_communitydebate.view_topic',
is_superuser | is_context_moderator | is_context_initiator |
is_context_member | is_public_context)
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1>{{ topic.name }}</h1>
</div>

<div class="mt-5">
{% react_comments_async topic %}
{% react_comments_async topic True %}
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions euth_wagtail/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,12 @@
('a4polls', 'poll')
)

A4_COMMENT_CATEGORIES = (
('sug', _('suggestion')),
('not', _('note')),
('que', _('question'))
)

A4_RATEABLES = (
('euth_communitydebate', 'topic'),
('euth_ideas', 'idea'),
Expand Down

0 comments on commit f82f887

Please sign in to comment.