Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add setting HELPDESK_SHOW_KB_ON_HOMEPAGE to show KnowledgeBase

categories on the homepage.
Bumped version number.
  • Loading branch information...
commit 321a9aef2d3d2934b49dc6ebe362f80e9952f7f9 1 parent 4ae7069
@rossp authored
View
3  helpdesk/settings.py
@@ -78,6 +78,9 @@
# 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
16 helpdesk/templates/helpdesk/public_homepage.html
@@ -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
5 helpdesk/views/public.py
@@ -18,7 +18,7 @@
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
2  setup.py
@@ -4,7 +4,7 @@
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:
Please sign in to comment.
Something went wrong with that request. Please try again.