mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-22 21:20:48 +01:00
Add setting HELPDESK_SHOW_KB_ON_HOMEPAGE to show KnowledgeBase
categories on the homepage. Bumped version number.
This commit is contained in:
parent
4ae7069517
commit
321a9aef2d
@ -78,6 +78,9 @@ HELPDESK_VIEW_A_TICKET_PUBLIC = getattr(settings, 'HELPDESK_VIEW_A_TICKET_PUBLIC
|
||||
# show 'submit a ticket' section on public page?
|
||||
HELPDESK_SUBMIT_A_TICKET_PUBLIC = getattr(settings, 'HELPDESK_SUBMIT_A_TICKET_PUBLIC', True)
|
||||
|
||||
# Should we should the KB categories on the homepage?
|
||||
HELPDESK_SHOW_KB_ON_HOMEPAGE = getattr(settings, 'HELPDESK_SHOW_KB_ON_HOMEPAGE', False)
|
||||
|
||||
|
||||
|
||||
''' options for update_ticket views '''
|
||||
|
@ -1,6 +1,22 @@
|
||||
{% extends "helpdesk/public_base.html" %}{% load i18n %}
|
||||
|
||||
{% block helpdesk_body %}
|
||||
|
||||
{% if helpdesk_settings.HELPDESK_SHOW_KB_ON_HOMEPAGE %}
|
||||
<h2>{% trans "Knowledgebase Articles" %}</h2>
|
||||
|
||||
<table width='100%'>
|
||||
<tr class='row_tablehead'><td>{% trans "Knowledgebase Categories" %}</td></tr>
|
||||
<tr class='row_columnheads'><th>{% trans "Category" %}</th></tr>
|
||||
|
||||
{% for category in kb_categories %}
|
||||
<tr class='row_even row_hover'><th><a href='{{ category.get_absolute_url }}'>{{ category.title }}</a></th></tr>
|
||||
<tr class='row_odd'><td>{{ category.description }}</td></tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if helpdesk_settings.HELPDESK_VIEW_A_TICKET_PUBLIC %}
|
||||
<h2>{% trans "View a Ticket" %}</h2>
|
||||
|
||||
|
@ -18,7 +18,7 @@ from django.utils.translation import ugettext as _
|
||||
from helpdesk import settings as helpdesk_settings
|
||||
from helpdesk.forms import PublicTicketForm
|
||||
from helpdesk.lib import send_templated_mail, text_is_spam
|
||||
from helpdesk.models import Ticket, Queue, UserSettings
|
||||
from helpdesk.models import Ticket, Queue, UserSettings, KBCategory
|
||||
|
||||
|
||||
def homepage(request):
|
||||
@ -63,10 +63,13 @@ def homepage(request):
|
||||
form = PublicTicketForm(initial=initial_data)
|
||||
form.fields['queue'].choices = [('', '--------')] + [[q.id, q.title] for q in Queue.objects.filter(allow_public_submission=True)]
|
||||
|
||||
knowledgebase_categories = KBCategory.objects.all()
|
||||
|
||||
return render_to_response('helpdesk/public_homepage.html',
|
||||
RequestContext(request, {
|
||||
'form': form,
|
||||
'helpdesk_settings': helpdesk_settings,
|
||||
'kb_categories': knowledgebase_categories
|
||||
}))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user