Merge commit 'fd0ab29dfcfc263be686c8351f4dc5880e3e1b9b' into template-cleanup

Conflicts:
	helpdesk/templates/helpdesk/dashboard.html
	helpdesk/templates/helpdesk/kb_category.html
	helpdesk/templates/helpdesk/ticket_desc_table.html
This commit is contained in:
Stefano Brentegani 2014-07-22 07:28:04 +02:00
commit df32432685
8 changed files with 38 additions and 36 deletions

View File

@ -30,17 +30,18 @@ Adding To Your Django Project
----------------------------- -----------------------------
1. Edit your ``settings.py`` file and add ``helpdesk`` to the ``INSTALLED_APPS`` setting. You also need ``django.contrib.admin`` and ``django.contrib.markup`` in ``INSTALLED_APPS`` if you haven't already added it. eg:: 1. Edit your ``settings.py`` file and add ``helpdesk`` to the ``INSTALLED_APPS`` setting. You also need ``django.contrib.admin`` and ``django.contrib.markup`` in ``INSTALLED_APPS`` if you haven't already added it. eg::
INSTALLED_APPS = ( INSTALLED_APPS = (
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.sites', 'django.contrib.sites',
'django.contrib.admin', # Required for helpdesk admin/maintenance 'django.contrib.admin', # Required for helpdesk admin/maintenance
'django.contrib.markup', # Required for helpdesk text display 'django.contrib.markup', # Required for helpdesk text display
'south', # Highly recommended to make database migrations simpler. 'django.contrib.humanize', # Required for elapsed time formatting
'markdown_deux', # Required for Knowledgebase item formatting 'south', # Highly recommended to make database migrations simpler.
'helpdesk', # This is new! 'markdown_deux', # Required for Knowledgebase item formatting
'helpdesk', # This is new!
) )
2. Make sure django-helpdesk is accessible via ``urls.py``. Add the following line to ``urls.py``:: 2. Make sure django-helpdesk is accessible via ``urls.py``. Add the following line to ``urls.py``::
@ -48,7 +49,7 @@ Adding To Your Django Project
(r'helpdesk/', include('helpdesk.urls')), (r'helpdesk/', include('helpdesk.urls')),
Note that you can change 'helpdesk/' to anything you like, such as 'support/' or 'help/'. If you want django-helpdesk to be available at the root of your site (for example at http://support.mysite.tld/) then the line will be as follows:: Note that you can change 'helpdesk/' to anything you like, such as 'support/' or 'help/'. If you want django-helpdesk to be available at the root of your site (for example at http://support.mysite.tld/) then the line will be as follows::
(r'', include('helpdesk.urls')), (r'', include('helpdesk.urls')),
This line will have to come *after* any other lines in your urls.py such as those used by the Django admin. This line will have to come *after* any other lines in your urls.py such as those used by the Django admin.

View File

@ -1,4 +1,4 @@
{% extends "helpdesk/base.html" %}{% load i18n %}{% load url from future %} {% extends "helpdesk/base.html" %}{% load i18n humanize %}{% load url from future %}
{% block helpdesk_title %}{% trans "Helpdesk Dashboard" %}{% endblock %} {% block helpdesk_title %}{% trans "Helpdesk Dashboard" %}{% endblock %}
{% block helpdesk_body %} {% block helpdesk_body %}
@ -63,7 +63,7 @@
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th> <th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td> <td>{{ ticket.queue }}</td>
<td>{{ ticket.get_status }}</td> <td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td> <td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|naturaltime }}</span></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -83,7 +83,7 @@
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th> <th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td> <td>{{ ticket.queue }}</td>
<td>{{ ticket.get_status }}</td> <td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td> <td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|naturaltime }}</span></td>
</tr> </tr>
{% empty %} {% empty %}
<tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr> <tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr>
@ -103,7 +103,7 @@
<td>{{ ticket.get_priority_span }}</td> <td>{{ ticket.get_priority_span }}</td>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th> <th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td> <td>{{ ticket.queue }}</td>
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|timesince }} ago</span></td> <td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|naturaltime }}</span></td>
<th><a href='{{ ticket.get_absolute_url }}?take'><span class='button button_take'>{% trans "Take" %}</span></a> | <a href='{% url 'helpdesk_delete' ticket.id %}'><span class='button button_delete'>{% trans "Delete" %}</span></a></th> <th><a href='{{ ticket.get_absolute_url }}?take'><span class='button button_take'>{% trans "Take" %}</span></a> | <a href='{% url 'helpdesk_delete' ticket.id %}'><span class='button button_delete'>{% trans "Delete" %}</span></a></th>
</tr> </tr>
{% empty %} {% empty %}
@ -127,7 +127,7 @@
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th> <th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td> <td>{{ ticket.queue }}</td>
<td>{{ ticket.get_status }}</td> <td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|timesince }}</span></td> <td><span title='{{ ticket.modified|date:"r" }}'>{{ ticket.modified|naturaltime }}</span></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -1,4 +1,4 @@
{% extends "helpdesk/public_base.html" %}{% load i18n %} {% extends "helpdesk/public_base.html" %}{% load i18n humanize %}
{% block helpdesk_body %} {% block helpdesk_body %}
<h2>{% blocktrans with category.title as kbcat %}Knowledgebase Category: {{ kbcat }}{% endblocktrans %}</h2> <h2>{% blocktrans with category.title as kbcat %}Knowledgebase Category: {{ kbcat }}{% endblocktrans %}</h2>
@ -14,7 +14,7 @@
</thead> </thead>
<tbody> <tbody>
{% for item in items %} {% for item in items %}
<tr><th><a href='{{ item.get_absolute_url }}'>{{ item.title }}</a></th><td>Rating: {{ item.score }}</td><td>Last Update: {{ item.last_updated|timesince }} ago</td></tr> <tr><th><a href='{{ item.get_absolute_url }}'>{{ item.title }}</a></th><td>Rating: {{ item.score }}</td><td>Last Update: {{ item.last_updated|naturaltime }}</td></tr>
<tr><td colspan='3'>{{ item.question }}</td></tr> <tr><td colspan='3'>{{ item.question }}</td></tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@ -1,4 +1,4 @@
{% extends "helpdesk/public_base.html" %}{% load i18n %} {% extends "helpdesk/public_base.html" %}{% load i18n humanize %}
{% block helpdesk_title %}{% trans "View a Ticket" %}{% endblock %} {% block helpdesk_title %}{% trans "View a Ticket" %}{% endblock %}
{% block helpdesk_body %} {% block helpdesk_body %}
@ -11,7 +11,7 @@
<tbody> <tbody>
<tr> <tr>
<th>{% trans "Submitted On" %}</th> <th>{% trans "Submitted On" %}</th>
<td>{{ ticket.created|date:"r" }} ({{ ticket.created|timesince }} ago)</td> <td>{{ ticket.created|date:"r" }} ({{ ticket.created|naturaltime }})</td>
</tr> </tr>
<tr> <tr>
@ -58,7 +58,7 @@
{% load ticket_to_link %} {% load ticket_to_link %}
{% for followup in ticket.followup_set.public_followups %} {% for followup in ticket.followup_set.public_followups %}
<div class='followup well'> <div class='followup well'>
<div class='title'>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span></span></div> <div class='title'>{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|naturaltime }}</span></span></div>
{{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }} {{ followup.comment|force_escape|urlizetrunc:50|num_to_link|linebreaksbr }}
{% if followup.ticketchange_set.all %}<div class='changes'><ul> {% if followup.ticketchange_set.all %}<div class='changes'><ul>
{% for change in followup.ticketchange_set.all %} {% for change in followup.ticketchange_set.all %}

View File

@ -1,4 +1,4 @@
{% extends "helpdesk/base.html" %}{% load i18n bootstrap %}{% load url from future %} {% extends "helpdesk/base.html" %}{% load i18n bootstrap humanize %}{% load url from future %}
{% block helpdesk_title %}{% trans "View Ticket Details" %}{% endblock %} {% block helpdesk_title %}{% trans "View Ticket Details" %}{% endblock %}
{% block helpdesk_head %} {% block helpdesk_head %}
<script type="text/javascript"> <script type="text/javascript">
@ -8,7 +8,7 @@
$("#ShowFurtherOptPara").hide(); $("#ShowFurtherOptPara").hide();
return false; return false;
}); });
processAddFileClick(); processAddFileClick();
$("#ShowFileUpload").click(function() { $("#ShowFileUpload").click(function() {
$("#FileUpload").fadeIn(); $("#FileUpload").fadeIn();
@ -27,7 +27,7 @@
}); });
function processAddFileClick() { function processAddFileClick() {
/* Until jQuery includes some 'livequery' functionality in the core /* Until jQuery includes some 'livequery' functionality in the core
distribution, this will have to do. */ distribution, this will have to do. */
$(".AddAnotherFile>a").click(function() { $(".AddAnotherFile>a").click(function() {
$(this).parent().remove(); $(this).parent().remove();
@ -69,7 +69,7 @@ function googleTranslateElementInit() {
{% if helpdesk_settings.HELPDESK_FOLLOWUP_MOD %} {% if helpdesk_settings.HELPDESK_FOLLOWUP_MOD %}
<div class='followup_mod'> <div class='followup_mod'>
<div class='title'> <div class='title'>
<span class='byline text-info'>{{ followup.user.get_full_name }}&nbsp;&nbsp;&nbsp;&nbsp;{{ followup.date }} ({{ followup.date|timesince }} ago)</span> <small>{{ followup.title }}</small> <span class='byline text-info'>{{ followup.user.get_full_name }}&nbsp;&nbsp;&nbsp;&nbsp;{{ followup.date }} ({{ followup.date|naturaltime }})</span> <small>{{ followup.title }}</small>
{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %} {% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}
{% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %} {% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %}
{% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %} {% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %}
@ -83,7 +83,7 @@ function googleTranslateElementInit() {
{% else %} {% else %}
<div class='followup well'> <div class='followup well'>
<div class='title'> <div class='title'>
{{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|timesince }} ago</span>{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span> {{ followup.title }} <span class='byline text-info'>{% if followup.user %}by {{ followup.user }}{% endif %} <span title='{{ followup.date|date:"r" }}'>{{ followup.date|naturaltime }}</span>{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}</span>
{% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %} {% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %}
{% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %} {% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %}
<a href="{% url 'helpdesk_followup_edit' ticket.id followup.id %}" class='followup-edit'><img width="60" height="15" title="Edit" alt="Edit" src="{{ STATIC_URL }}helpdesk/buttons/edit.png"></a> <a href="{% url 'helpdesk_followup_edit' ticket.id followup.id %}" class='followup-edit'><img width="60" height="15" title="Edit" alt="Edit" src="{{ STATIC_URL }}helpdesk/buttons/edit.png"></a>
@ -141,25 +141,25 @@ function googleTranslateElementInit() {
<input type='radio' name='new_status' value='5' id='st_duplicate'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd> <input type='radio' name='new_status' value='5' id='st_duplicate'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd>
{% endifequal %} {% endifequal %}
{% ifequal ticket.status 2 %} {% ifequal ticket.status 2 %}
<dd><input type='radio' name='new_status' value='2' id='st_reopened' checked='checked'><label for='st_reopened' class='active'>{% trans "Reopened" %}</label> &raquo; <dd><input type='radio' name='new_status' value='2' id='st_reopened' checked='checked'><label for='st_reopened' class='active'>{% trans "Reopened" %}</label> &raquo;
<input type='radio' name='new_status' value='3' id='st_resolved'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}><label for='st_resolved'>{% trans "Resolved" %}</label> &raquo; <input type='radio' name='new_status' value='3' id='st_resolved'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}><label for='st_resolved'>{% trans "Resolved" %}</label> &raquo;
<input type='radio' name='new_status' value='4' id='st_closed'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}><label for='st_closed'>{% trans "Closed" %}</label> &raquo; <input type='radio' name='new_status' value='4' id='st_closed'{% if not ticket.can_be_resolved %} disabled='disabled'{% endif %}><label for='st_closed'>{% trans "Closed" %}</label> &raquo;
<input type='radio' name='new_status' value='5' id='st_duplicate'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd> <input type='radio' name='new_status' value='5' id='st_duplicate'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd>
{% endifequal %} {% endifequal %}
{% ifequal ticket.status 3 %} {% ifequal ticket.status 3 %}
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo; <dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo;
<input type='radio' name='new_status' value='3' id='st_resolved' checked='checked'><label for='st_resolved' class='active'>{% trans "Resolved" %}</label> &raquo; <input type='radio' name='new_status' value='3' id='st_resolved' checked='checked'><label for='st_resolved' class='active'>{% trans "Resolved" %}</label> &raquo;
<input type='radio' name='new_status' value='4' id='st_closed'><label for='st_closed'>{% trans "Closed" %}</label></dd> <input type='radio' name='new_status' value='4' id='st_closed'><label for='st_closed'>{% trans "Closed" %}</label></dd>
{% endifequal %} {% endifequal %}
{% ifequal ticket.status 4 %} {% ifequal ticket.status 4 %}
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo; <dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo;
<input type='radio' name='new_status' value='4' id='st_closed' checked='checked'><label for='st_closed'>{% trans "Closed" %}</label></dd> <input type='radio' name='new_status' value='4' id='st_closed' checked='checked'><label for='st_closed'>{% trans "Closed" %}</label></dd>
{% endifequal %} {% endifequal %}
{% ifequal ticket.status 5 %} {% ifequal ticket.status 5 %}
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo; <dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> &laquo;
<input type='radio' name='new_status' value='5' id='st_duplicate' checked='checked'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd> <input type='radio' name='new_status' value='5' id='st_duplicate' checked='checked'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd>
{% endifequal %} {% endifequal %}
{% if helpdesk_settings.HELPDESK_UPDATE_PUBLIC_DEFAULT %} {% if helpdesk_settings.HELPDESK_UPDATE_PUBLIC_DEFAULT %}
<input type='hidden' name='public' value='1'> <input type='hidden' name='public' value='1'>
{% else %} {% else %}
@ -185,7 +185,7 @@ function googleTranslateElementInit() {
<dd><select id='id_priority' name='priority'>{% for p in priorities %}<option value='{{ p.0 }}'{% ifequal p.0 ticket.priority %} selected='selected'{% endifequal %}>{{ p.1 }}</option>{% endfor %}</select></dd> <dd><select id='id_priority' name='priority'>{% for p in priorities %}<option value='{{ p.0 }}'{% ifequal p.0 ticket.priority %} selected='selected'{% endifequal %}>{{ p.1 }}</option>{% endfor %}</select></dd>
<dt><label for='id_due_date'>{% trans "Due on" %}</label></dt> <dt><label for='id_due_date'>{% trans "Due on" %}</label></dt>
<dd>{{ form.due_date }}</dd> <dd>{{ form.due_date }}</dd>
</dl> </dl>
</div> </div>

View File

@ -1,4 +1,4 @@
{% load i18n %}{% load url from future %} {% load i18n humanize %}{% load url from future %}
<table class="table table-hover table-bordered table-striped"> <table class="table table-hover table-bordered table-striped">
<thead> <thead>
<tr class='row_tablehead'><td colspan='2'><h3>{{ ticket.id }}. {{ ticket.title }} [{{ ticket.get_status }}]</h3> <span class='ticket_toolbar'> <tr class='row_tablehead'><td colspan='2'><h3>{{ ticket.id }}. {{ ticket.title }} [{{ ticket.get_status }}]</h3> <span class='ticket_toolbar'>
@ -30,7 +30,7 @@
</tr>{% endif %} </tr>{% endif %}
<tr> <tr>
<th>{% trans "Submitted On" %}</th> <th>{% trans "Submitted On" %}</th>
<td>{{ ticket.created|date:"r" }} ({{ ticket.created|timesince }} ago)</td> <td>{{ ticket.created|date:"r" }} ({{ ticket.created|naturaltime }})</td>
</tr> </tr>
<tr> <tr>

View File

@ -1,4 +1,4 @@
{% extends "helpdesk/base.html" %}{% load i18n %}{% load url from future %} {% extends "helpdesk/base.html" %}{% load i18n humanize %}{% load url from future %}
{% block helpdesk_title %}{% trans "Tickets" %}{% endblock %} {% block helpdesk_title %}{% trans "Tickets" %}{% endblock %}
{% block helpdesk_head %} {% block helpdesk_head %}
@ -231,7 +231,7 @@ $(document).ready(function() {
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th> <th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
<td>{{ ticket.queue }}</td> <td>{{ ticket.queue }}</td>
<td>{{ ticket.get_status }}</td> <td>{{ ticket.get_status }}</td>
<td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|timesince }} ago</span></td> <td><span title='{{ ticket.created|date:"r" }}'>{{ ticket.created|naturaltime }}</span></td>
<td>{{ ticket.get_assigned_to }}</td> <td>{{ ticket.get_assigned_to }}</td>
</tr> </tr>
{% empty %} {% empty %}

View File

@ -11,7 +11,7 @@ class QuickDjangoTest(object):
>>> QuickDjangoTest('app1', 'app2') >>> QuickDjangoTest('app1', 'app2')
Based on a script published by Lukasz Dziedzia at: Based on a script published by Lukasz Dziedzia at:
http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app http://stackoverflow.com/questions/3841725/how-to-launch-tests-for-django-reusable-app
""" """
DIRNAME = os.path.dirname(__file__) DIRNAME = os.path.dirname(__file__)
@ -22,6 +22,7 @@ class QuickDjangoTest(object):
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.humanize',
'bootstrapform', 'bootstrapform',
) )