Skip to content

Commit 3c0c0b5

Browse files
committed
WIP: Ticketing - Forum functionality done
1 parent a229222 commit 3c0c0b5

File tree

3 files changed

+41
-9
lines changed

3 files changed

+41
-9
lines changed

inyoka_theme_ubuntuusers/templates/overall.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ <h1><a href="/"><span>{{ SETTINGS.BASE_DOMAIN_NAME }}</span></a></h1>
122122
{% endif %}
123123
</ul>{# .navi_global #}
124124
{% endif %}
125-
{% if USER.has_perm('forum.manage_reported_topic') or USER.has_perm('ikhaya.change_article') or USER.has_perm('portal.change_event') %}
125+
{% if USER.has_perm('forum.manage_tickets_forum') or USER.has_perm('ikhaya.change_article') or USER.has_perm('portal.change_event') %}
126126
<div id="admin_menu">
127127
<div class="bar">
128-
{% if USER.has_perm('forum.manage_reported_topic') %}
129-
{{ macros.render_modnavi_li(_('Reported topics'), href('forum', 'reported_topics'), href('static', 'img/admin/report.png'), report_count) }}
128+
{% if USER.has_perm('forum.manage_tickets_forum') %}
129+
{{ macros.render_modnavi_li(_('Tickets'), href('portal', 'tickets', 'list'), href('static', 'img/admin/report.png'), ticket_count) }}
130130
{% endif %}
131131
{% if USER.has_perm('ikhaya.change_article') %}
132132
{% set label = _('Article suggestions') %}

inyoka_theme_ubuntuusers/templates/portal/ticketlist.html

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#}
1010

1111
{%- extends 'portal/overall.html' %}
12+
{% from 'macros.html' import render_form %}
1213
{% set BREADCRUMBS = [(_('Tickets'), href('portal', 'tickets/list'))] + BREADCRUMBS|d([]) %}
1314

1415
{% block content %}
@@ -48,20 +49,45 @@
4849
{{ element.reporting_time|datetime }}
4950
</td>
5051
<td>
51-
{{ element.reporter_comment }}
52+
{{ element.reporter_comment_rendered }}
5253
</td>
5354
</tr>
5455
<tr>
5556
<td>
5657
{% if element.owning_user %}
57-
{% trans %}Owned by{% endtrans %} <a href="{{ element.owning_user|url }}">{{ element.owning_user.username }}</a><br>
58+
{% trans %}Owned by{% endtrans %} <a href="{{ element.owning_user|url }}">{{ element.owning_user.username }}</a>
59+
{% if element.owning_user == USER %}
60+
(<a href="../{{ element.id }}/disown">{% trans %}Release ownership{% endtrans %}</a>)
61+
{% endif %}
62+
<br>
5863
{{ element.owned_time|datetime }}
5964
{% else %}
60-
<a href="todo/take_over">{% trans %}Take ownership{% endtrans %}</a>
65+
<a href="../{{ element.id }}/own">{% trans %}Take ownership{% endtrans %}</a>
66+
{% if element.owned_time %}
67+
<br>
68+
{% trans %}Previously already owned at {% endtrans %}{{ element.owned_time|datetime }}
69+
{% endif %}
6170
{% endif %}
6271
</td>
6372
<td>
64-
{{ element.owner_comment }}
73+
{% if element.owning_user == USER %}
74+
{% if owner_comment_form and edit_ticket_id==element.id %}
75+
<owner_comment_form id="owner_comment" method="post" action="" class="new_topic">
76+
{{ csrf_token() }}
77+
{{ render_form(owner_comment_form, ['owner_comment'], inline=true) }}<br>
78+
<input type="submit" value="{% trans %}Submit{% endtrans %}" />
79+
</owner_comment_form>
80+
{% else %}
81+
{% if element.owner_comment %}
82+
<a href="../{{ element.id }}/edit" class="action action_edit">{% trans %}Edit comment{% endtrans %}</a><br>
83+
{{ element.owner_comment_rendered }}
84+
{% else %}
85+
<a href="../{{ element.id }}/edit" class="action action_edit">{% trans %}Add comment{% endtrans %}</a><br>
86+
{% endif %}
87+
{% endif %}
88+
{% else %}
89+
{{ element.owner_comment_rendered }}
90+
{% endif %}
6591
</td>
6692
</tr>
6793
{%- else %}
@@ -84,6 +110,12 @@
84110
{%- trans %}Subscribe to topic reports{% endtrans -%}
85111
</a>
86112
{%- endif %}
113+
{%- if USER.has_perm('portal.change_ticketreason') %}
114+
|
115+
<a href="{{ href('portal', 'ticketreason', 'list') }}">
116+
{%- trans %}Manage ticket reasons{% endtrans -%}
117+
</a>
118+
{%- endif %}
87119
</div>
88120
</form>
89121
{% endblock %}

inyoka_theme_ubuntuusers/templates/portal/ticketreason_list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{% block content %}
1616
<h3>{% trans %}Ticket Reasons{% endtrans %}</h3>
1717

18-
{%- if USER.has_perm('auth.add_group') -%}
18+
{%- if USER.has_perm('portal.change_ticketreason') -%}
1919
<p>
2020
<a href="{{ href('portal', 'ticketreason', 'new') }}">{% trans %}Create new ticket reason{% endtrans %}</a>.
2121
</p>
@@ -32,7 +32,7 @@ <h3>{% trans %}Ticket Reasons{% endtrans %}</h3>
3232
<td>{{ reason.id }}</td>
3333
<td>{{ reason.content_type }}</td>
3434
<td>{{ reason.reason }}
35-
{%- if USER.has_perm('auth.change_group') -%}
35+
{%- if USER.has_perm('portal.change_ticketreason') -%}
3636
<a href="{{ href('portal', 'ticketreason', reason.id, 'edit') }}" class="admin_link"><img src="{{ href('static', 'img/ikhaya/category_edit.png') }}" /></a>
3737
</td>
3838
<td>

0 commit comments

Comments
 (0)