Add setting HELPDESK_SHOW_KB_ON_HOMEPAGE to show KnowledgeBase

categories on the homepage.
Bumped version number.
This commit is contained in:
Ross Poulton 2012-03-02 09:28:54 +11:00
parent 4ae7069517
commit 321a9aef2d
4 changed files with 24 additions and 2 deletions

View File

@ -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 '''

View File

@ -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>

View File

@ -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
}))

View File

@ -4,7 +4,7 @@ from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
version = '0.1.5b'
version = '0.1.6b'
# Provided as an attribute, so you can append to these instead
# of replicating them: