Skip to content
This repository was archived by the owner on May 19, 2021. It is now read-only.

Commit 1900e93

Browse files
committed
topic.html: Adde more sidebar-options
includes more permission-checks
1 parent f556a89 commit 1900e93

1 file changed

Lines changed: 45 additions & 17 deletions

File tree

inyoka_theme_default/templates/forum/topic.html

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,51 @@
3434
{% endblock %}
3535

3636
{% block sidebar %}
37-
{% call macros.sidebar() %}
38-
{{ macros.sidebar_item(_('Reply'), topic|url('reply'), 'fa_icon-comments-o') }}
39-
40-
{% if is_subscribed %}
41-
{{ macros.sidebar_item(_('Unsubscribe'), topic|url('unsubscribe')) }}
42-
{% else %}
43-
{{ macros.sidebar_item(_('Subscribe'), topic|url('subscribe')) }}
44-
{% endif %}
45-
46-
{% if topic.solved %}
47-
{{ macros.sidebar_item(_('Mark as unsolved'), topic|url('unsolve'), 'fa_icon-remove') }}
48-
{% else %}
49-
{{ macros.sidebar_item(_('Mark as solved'), topic|url('solve'), 'fa_icon-check') }}
50-
{% endif %}
51-
52-
{{ macros.sidebar_item(_('Report'), topic|url('report'), 'fa_icon-exclamation-triangle') }}
53-
{% endcall %}
37+
38+
{% if USER.is_authenticated() %}
39+
{% call macros.sidebar() %}
40+
{% if (can_reply and not topic.locked) or can_moderate %}
41+
{{ macros.sidebar_item(_('Reply'), topic|url('reply'), 'fa_icon-comments-o') }}
42+
{% endif %}
43+
44+
{% if is_subscribed %}
45+
{{ macros.sidebar_item(_('Unsubscribe'), topic|url('unsubscribe'), 'fa_icon-bell-slash') }}
46+
{% else %}
47+
{{ macros.sidebar_item(_('Subscribe'), topic|url('subscribe'), 'fa_icon-bell') }}
48+
{% endif %}
49+
50+
{% if topic.solved %}
51+
{{ macros.sidebar_item(_('Mark as unsolved'), topic|url('unsolve'), 'fa_icon-remove') }}
52+
{% else %}
53+
{{ macros.sidebar_item(_('Mark as solved'), topic|url('solve'), 'fa_icon-check') }}
54+
{% endif %}
55+
56+
{{ macros.sidebar_item(_('Report'), topic|url('report'), 'fa_icon-exclamation-triangle') }}
57+
{% endcall %}
58+
{% endif %}
59+
60+
{% if can_moderate %}
61+
{% call macros.sidebar_admin() %}
62+
{{ macros.sidebar_item(_('Move'), topic|url('move'), 'fa_icon-arrow-circle-right') }}
63+
64+
{{ macros.sidebar_item(_('Split'), topic|url('split'), 'fa_icon-scissors') }}
65+
66+
{% if topic.locked %}
67+
{{ macros.sidebar_item(_('Unlock'), topic|url('unlock'), 'fa_icon-unlock') }}
68+
{% else %}
69+
{{ macros.sidebar_item(_('Lock'), topic|url('lock'), 'fa_icon-lock') }}
70+
{% endif %}
71+
72+
{% if topic.hidden %}
73+
{{ macros.sidebar_item(_('Restore'), topic|url('restore'), 'fa_icon-eye') }}
74+
{{ macros.sidebar_item(_('Delete'), topic|url('delete'), 'fa_icon-trash') }}
75+
{{ macros.sidebar_item(_('Mark ham'), topic.first_post|url('ham'), 'fa_icon-recycle') }}
76+
{% else %}
77+
{{ macros.sidebar_item(_('Hide'), topic|url('hide'), 'fa_icon-eye-slash') }}
78+
{{ macros.sidebar_item(_('Mark spam'), topic.first_post|url('spam'), 'fa_icon-fire') }}
79+
{% endif %}
80+
{% endcall %}
81+
{% endif %}
5482
{% endblock %}
5583

5684
{% block content %}

0 commit comments

Comments
 (0)