mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-05-19 00:40:45 +02: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?
|
# show 'submit a ticket' section on public page?
|
||||||
HELPDESK_SUBMIT_A_TICKET_PUBLIC = getattr(settings, 'HELPDESK_SUBMIT_A_TICKET_PUBLIC', True)
|
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 '''
|
''' options for update_ticket views '''
|
||||||
|
@ -1,6 +1,22 @@
|
|||||||
{% extends "helpdesk/public_base.html" %}{% load i18n %}
|
{% extends "helpdesk/public_base.html" %}{% load i18n %}
|
||||||
|
|
||||||
{% block helpdesk_body %}
|
{% 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 %}
|
{% if helpdesk_settings.HELPDESK_VIEW_A_TICKET_PUBLIC %}
|
||||||
<h2>{% trans "View a Ticket" %}</h2>
|
<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 import settings as helpdesk_settings
|
||||||
from helpdesk.forms import PublicTicketForm
|
from helpdesk.forms import PublicTicketForm
|
||||||
from helpdesk.lib import send_templated_mail, text_is_spam
|
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):
|
def homepage(request):
|
||||||
@ -63,10 +63,13 @@ def homepage(request):
|
|||||||
form = PublicTicketForm(initial=initial_data)
|
form = PublicTicketForm(initial=initial_data)
|
||||||
form.fields['queue'].choices = [('', '--------')] + [[q.id, q.title] for q in Queue.objects.filter(allow_public_submission=True)]
|
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',
|
return render_to_response('helpdesk/public_homepage.html',
|
||||||
RequestContext(request, {
|
RequestContext(request, {
|
||||||
'form': form,
|
'form': form,
|
||||||
'helpdesk_settings': helpdesk_settings,
|
'helpdesk_settings': helpdesk_settings,
|
||||||
|
'kb_categories': knowledgebase_categories
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -4,7 +4,7 @@ from distutils.util import convert_path
|
|||||||
from fnmatch import fnmatchcase
|
from fnmatch import fnmatchcase
|
||||||
from setuptools import setup, find_packages
|
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
|
# Provided as an attribute, so you can append to these instead
|
||||||
# of replicating them:
|
# of replicating them:
|
||||||
|
Loading…
Reference in New Issue
Block a user