mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-01-05 13:39:06 +01:00
use naturaltime for elapsed times (resolves #229)
This commit is contained in:
parent
21e46f010d
commit
fd0ab29dfc
@ -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::
|
||||
|
||||
|
||||
INSTALLED_APPS = (
|
||||
'django.contrib.auth',
|
||||
'django.contrib.contenttypes',
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.sites',
|
||||
'django.contrib.admin', # Required for helpdesk admin/maintenance
|
||||
'django.contrib.markup', # Required for helpdesk text display
|
||||
'south', # Highly recommended to make database migrations simpler.
|
||||
'markdown_deux', # Required for Knowledgebase item formatting
|
||||
'helpdesk', # This is new!
|
||||
'django.contrib.admin', # Required for helpdesk admin/maintenance
|
||||
'django.contrib.markup', # Required for helpdesk text display
|
||||
'django.contrib.humanize', # Required for elapsed time formatting
|
||||
'south', # Highly recommended to make database migrations simpler.
|
||||
'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``::
|
||||
@ -48,7 +49,7 @@ Adding To Your Django Project
|
||||
(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::
|
||||
|
||||
|
||||
(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.
|
||||
|
@ -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_head %}
|
||||
<script type='text/javascript' language='javascript' src='{{ STATIC_URL }}helpdesk/hover.js'></script>
|
||||
@ -34,8 +34,8 @@
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
<tr class='row_tablehead' style="color: #fbff00;"><td colspan='2'><i>{% trans "Current Ticket Stats" %}</i></td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (all tickets): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed }}</strong>.</td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (tickets opened in last 60 days): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed_last_60_days }}</strong>.
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (all tickets): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed }}</strong>.</td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Average number of days until ticket is closed (tickets opened in last 60 days): " %}<strong style="color: red;">{{ basic_ticket_stats.average_nbr_days_until_ticket_closed_last_60_days }}</strong>.
|
||||
{% trans "Click" %} <strong><a href="{% url 'helpdesk_report_index' %}daysuntilticketclosedbymonth">here</a></strong> {% trans "for detailed average by month." %} </td></tr>
|
||||
<tr><td colspan='2'>- {% trans "Distribution of open tickets, grouped by time period:" %}</td></tr>
|
||||
<tr class='row_columnheads'><th>{% trans "Days since opened" %}</th><th>{% trans "Number of open tickets" %}</th></tr>
|
||||
@ -65,7 +65,7 @@
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</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>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
@ -85,7 +85,7 @@
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</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>
|
||||
{% endfor %}
|
||||
{% if not user_tickets %}
|
||||
@ -106,7 +106,7 @@
|
||||
<td>{{ ticket.get_priority_span }}</td>
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<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>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
@ -131,7 +131,7 @@
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</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>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% extends "helpdesk/public_base.html" %}{% load i18n %}
|
||||
{% extends "helpdesk/public_base.html" %}{% load i18n humanize %}
|
||||
|
||||
{% block helpdesk_body %}
|
||||
<h2>{% blocktrans with category.title as kbcat %}Knowledgebase Category: {{ kbcat }}{% endblocktrans %}</h2>
|
||||
@ -14,7 +14,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr class='row_even row_hover'><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 class='row_even row_hover'><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 class='row_odd'><td colspan='3'>{{ item.question }}</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
@ -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_body %}
|
||||
@ -11,7 +11,7 @@
|
||||
<tbody>
|
||||
<tr class="{% cycle 'row_odd' 'row_even' as rowcolors %}">
|
||||
<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 class='{% cycle rowcolors %}'>
|
||||
@ -58,7 +58,7 @@
|
||||
{% load ticket_to_link %}
|
||||
{% for followup in ticket.followup_set.public_followups %}
|
||||
<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 }}
|
||||
{% if followup.ticketchange_set.all %}<div class='changes'><ul>
|
||||
{% for change in followup.ticketchange_set.all %}
|
||||
|
@ -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_head %}
|
||||
<script type="text/javascript">
|
||||
@ -8,7 +8,7 @@
|
||||
$("#ShowFurtherOptPara").hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
processAddFileClick();
|
||||
$("#ShowFileUpload").click(function() {
|
||||
$("#FileUpload").fadeIn();
|
||||
@ -27,7 +27,7 @@
|
||||
});
|
||||
|
||||
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. */
|
||||
$(".AddAnotherFile>a").click(function() {
|
||||
$(this).parent().remove();
|
||||
@ -69,7 +69,7 @@ function googleTranslateElementInit() {
|
||||
{% if helpdesk_settings.HELPDESK_FOLLOWUP_MOD %}
|
||||
<div class='followup_mod'>
|
||||
<div class='title'>
|
||||
<span class='byline text-info'>{{ followup.user.get_full_name }} {{ followup.date }} ({{ followup.date|timesince }} ago)</span> <small>{{ followup.title }}</small>
|
||||
<span class='byline text-info'>{{ followup.user.get_full_name }} {{ followup.date }} ({{ followup.date|naturaltime }})</span> <small>{{ followup.title }}</small>
|
||||
{% if not followup.public %} <span class='private'>({% trans "Private" %})</span>{% endif %}
|
||||
{% if helpdesk_settings.HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP %}
|
||||
{% if followup.user and request.user == followup.user and not followup.ticketchange_set.all %}
|
||||
@ -83,7 +83,7 @@ function googleTranslateElementInit() {
|
||||
{% else %}
|
||||
<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>{% 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 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>
|
||||
@ -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>
|
||||
{% endifequal %}
|
||||
{% 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> »
|
||||
<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> »
|
||||
<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> »
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened' checked='checked'><label for='st_reopened' class='active'>{% trans "Reopened" %}</label> »
|
||||
<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> »
|
||||
<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> »
|
||||
<input type='radio' name='new_status' value='5' id='st_duplicate'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd>
|
||||
{% endifequal %}
|
||||
{% ifequal ticket.status 3 %}
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<input type='radio' name='new_status' value='3' id='st_resolved' checked='checked'><label for='st_resolved' class='active'>{% trans "Resolved" %}</label> »
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<input type='radio' name='new_status' value='3' id='st_resolved' checked='checked'><label for='st_resolved' class='active'>{% trans "Resolved" %}</label> »
|
||||
<input type='radio' name='new_status' value='4' id='st_closed'><label for='st_closed'>{% trans "Closed" %}</label></dd>
|
||||
{% endifequal %}
|
||||
{% ifequal ticket.status 4 %}
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<input type='radio' name='new_status' value='4' id='st_closed' checked='checked'><label for='st_closed'>{% trans "Closed" %}</label></dd>
|
||||
{% endifequal %}
|
||||
{% ifequal ticket.status 5 %}
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<dd><input type='radio' name='new_status' value='2' id='st_reopened'><label for='st_reopened'>{% trans "Reopened" %}</label> «
|
||||
<input type='radio' name='new_status' value='5' id='st_duplicate' checked='checked'><label for='st_duplicate'>{% trans "Duplicate" %}</label></dd>
|
||||
{% endifequal %}
|
||||
|
||||
|
||||
{% if helpdesk_settings.HELPDESK_UPDATE_PUBLIC_DEFAULT %}
|
||||
<input type='hidden' name='public' value='1'>
|
||||
{% 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>
|
||||
<dt><label for='id_due_date'>{% trans "Due on" %}</label></dt>
|
||||
<dd>{{ form.due_date }}</dd>
|
||||
|
||||
|
||||
</dl>
|
||||
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
{% load i18n %}{% load url from future %}
|
||||
{% load i18n humanize %}{% load url from future %}
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
<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 class='{% cycle rowcolors %}'>
|
||||
<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 class='{% cycle rowcolors %}'>
|
||||
|
@ -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_head %}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
|
||||
<script type='text/javascript' language='javascript'>
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
// Enable Tabs
|
||||
$("#searchtabs").tabs({
|
||||
collapsible:true
|
||||
@ -126,7 +126,7 @@ $(document).ready(function() {
|
||||
<p class='filterHelp'>{% trans "Ctrl-click to select multiple options" %}</p>
|
||||
<input type='button' class='filterBuilderRemove' value='-' />
|
||||
</div>
|
||||
|
||||
|
||||
<div class='thumbnail filterBox{% if query_params.filtering.created__gte or query_params.filtering.created__lte %} filterBoxShow{% endif %}' id='filterBoxDates'>
|
||||
<label for='id_date_from'>{% trans "Date (From)" %}</label><input type='text' name='date_from' value='{{ query_params.filtering.created__gte }}' id='id_date_from' />
|
||||
<label for='id_date_to'>{% trans "Date (To)" %}</label><input type='text' name='date_to' value='{{ query_params.filtering.created__lte }}' id='id_date_to' />
|
||||
@ -152,7 +152,7 @@ $(document).ready(function() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{% if not from_saved_query %}
|
||||
<div class='panel panel-default' id='tabsave'>
|
||||
<div class="panel-heading">
|
||||
@ -232,7 +232,7 @@ $(document).ready(function() {
|
||||
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.title }}</a></th>
|
||||
<td>{{ ticket.queue }}</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>
|
||||
</tr>
|
||||
{% endfor %}{% else %}
|
||||
|
@ -11,7 +11,7 @@ class QuickDjangoTest(object):
|
||||
|
||||
>>> 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
|
||||
"""
|
||||
DIRNAME = os.path.dirname(__file__)
|
||||
@ -22,6 +22,7 @@ class QuickDjangoTest(object):
|
||||
'django.contrib.admin',
|
||||
'django.contrib.staticfiles',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.humanize',
|
||||
'bootstrapform',
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user