separate dashboard elements for easier customisation

This commit is contained in:
Stefano Brentegani 2014-07-22 19:20:40 +02:00
parent cfd0ca3b7d
commit 78103c345b
6 changed files with 89 additions and 117 deletions

View File

@ -32,6 +32,7 @@ Bootstrap overrides
.row_tablehead, table.table caption {background-color: #dbd5d9;}
table.table caption {height: 2em; line-height: 2em; font-weight: bold;}
table.ticket-stats caption {color: #fbff00; font-style: italic;}
table.ticket-stats tbody th, table.ticket-stats tbody tr {padding-left: 20px}
.errorlist {list-style: none;}
.errorlist {padding: 0;}

View File

@ -7,131 +7,24 @@
<p>{% trans "Welcome to your Helpdesk Dashboard! From here you can quickly see tickets submitted by you, tickets you are working on, and those tickets that have no owner." %}</p>
</div>
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Helpdesk Summary" %}</caption>
<thead>
<tr><th>{% trans "Queue" %}</th><th>{% trans "Open" %}</th><th>{% trans "Resolved" %}</th><th>{% trans "Closed" %}</th></tr>
</thead>
<tbody>
{% for queue in dash_tickets %}
<tr>
<th><a href='{% url 'helpdesk_list' %}?queue={{ queue.queue }}&status=1&status=2'>{{ queue.name }}</a></th>
<td align="center">{% if queue.open %}<a href='{% url 'helpdesk_list' %}?queue={{ queue.queue }}&status=1&status=2'>{% endif %}{{ queue.open }}{% if queue.open %}</a>{% endif %}</td>
<td align="center">{% if queue.resolved %}<a href='{% url 'helpdesk_list' %}?queue={{ queue.queue }}&status=3'>{% endif %}{{ queue.resolved }}{% if queue.resolved %}</a>{% endif %}</td>
<td align="center">{% if queue.closed %}<a href='{% url 'helpdesk_list' %}?queue={{ queue.queue }}&status=4'>{% endif %}{{ queue.closed }}{% if queue.closed %}</a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
<br style='clear: both;' />
<table class="table table-hover table-bordered table-striped ticket-stats">
<caption>{% trans "Current Ticket Stats" %}</caption>
<thead>
<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><th>{% trans "Days since opened" %}</th><th>{% trans "Number of open tickets" %}</th></tr>
</thead>
<tbody>
{% for entry in basic_ticket_stats.open_ticket_stats %}
<tr>
<th style="padding-left: 20px;">{{ entry.0 }}</th>
<td style="padding-left: 20px;"><span style="color: {{ entry.2 }};">{% if entry.1 > 0 %}<a href="{% url 'helpdesk_list' %}?{{ entry.3 }}">{{ entry.1 }}</a>{% else %}{{ entry.1 }}{% endif %}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% include 'helpdesk/include/summary.html' %}
{% include 'helpdesk/include/stats.html' %}
{% if all_tickets_reported_by_current_user %}
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "All Tickets submitted by you" %}</caption>
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
</thead>
<tbody>
{% for ticket in all_tickets_reported_by_current_user %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<td>{{ ticket.get_priority_span }}</td>
<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|naturaltime }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% trans "All Tickets submitted by you" as ticket_list_caption %}
{% include 'helpdesk/include/tickets.html' with ticket_list=all_tickets_reported_by_current_user ticket_list_empty_message="" %}
{% endif %}
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Open Tickets assigned to you (you are working on this ticket)" %}</caption>
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
</thead>
<tbody>
{% for ticket in user_tickets %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<td>{{ ticket.get_priority_span }}</td>
<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|naturaltime }}</span></td>
</tr>
{% empty %}
<tr><td colspan='6'>{% trans "You have no tickets assigned to you." %}</td></tr>
{% endfor %}
</tbody>
</table>
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Unassigned Tickets" %} {% trans "(pick up a ticket if you start to work on it)" %}</caption>
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Created" %}</th><th>&nbsp;</th></tr>
</thead>
<tbody>
{% for ticket in unassigned_tickets %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<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|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>
{% empty %}
<tr><td colspan='6'>{% trans "There are no unassigned tickets." %}</td></tr>
{% endfor %}
</tbody>
</table>
{% trans "Open Tickets assigned to you (you are working on this ticket)" as ticket_list_caption %}
{% trans "You have no tickets assigned to you." as no_assigned_tickets %}
{% include 'helpdesk/include/tickets.html' with ticket_list=user_tickets ticket_list_empty_message=no_assigned_tickets %}
{% include 'helpdesk/include/unassigned.html' %}
{% if user_tickets_closed_resolved %}
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Closed & resolved Tickets you used to work on" %}</caption>
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
</thead>
<tbody>
{% for ticket in user_tickets_closed_resolved %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<td>{{ ticket.get_priority_span }}</td>
<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|naturaltime }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
{% trans "Closed & resolved Tickets you used to work on" as ticket_list_caption %}
{% include 'helpdesk/include/tickets.html' with ticket_list=user_tickets_closed_resolved ticket_list_empty_message="" %}
{% endif %}
{% endblock %}

View File

@ -0,0 +1,19 @@
{% load i18n %}
<table class="table table-hover table-bordered table-striped ticket-stats">
<caption>{% trans "Current Ticket Stats" %}</caption>
<thead>
<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><th>{% trans "Days since opened" %}</th><th>{% trans "Number of open tickets" %}</th></tr>
</thead>
<tbody>
{% for entry in basic_ticket_stats.open_ticket_stats %}
<tr>
<th>{{ entry.0 }}</th>
<td><span style="color: {{ entry.2 }};">{% if entry.1 > 0 %}<a href="{% url 'helpdesk_list' %}?{{ entry.3 }}">{{ entry.1 }}</a>{% else %}{{ entry.1 }}{% endif %}</span></td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,17 @@
{% load i18n %}
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Helpdesk Summary" %}</caption>
<thead>
<tr><th>{% trans "Queue" %}</th><th>{% trans "Open" %}</th><th>{% trans "Resolved" %}</th><th>{% trans "Closed" %}</th></tr>
</thead>
<tbody>
{% for queue in dash_tickets %}
<tr>{% url 'helpdesk_list' as hdlist %}
<th><a href='{{ hdlist }}?queue={{ queue.queue }}&status=1&status=2'>{{ queue.name }}</a></th>
<td align="center">{% if queue.open %}<a href='{{ hdlist }}?queue={{ queue.queue }}&status=1&status=2'>{% endif %}{{ queue.open }}{% if queue.open %}</a>{% endif %}</td>
<td align="center">{% if queue.resolved %}<a href='{{ hdlist }}?queue={{ queue.queue }}&status=3'>{% endif %}{{ queue.resolved }}{% if queue.resolved %}</a>{% endif %}</td>
<td align="center">{% if queue.closed %}<a href='{{ hdlist }}?queue={{ queue.queue }}&status=4'>{% endif %}{{ queue.closed }}{% if queue.closed %}</a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,21 @@
{% load i18n %}
<table class="table table-hover table-bordered table-striped">{% if ticket_list_caption %}
<caption>{{ ticket_list_caption }}</caption>{% endif %}
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Status" %}</th><th>{% trans "Last Update" %}</th></tr>
</thead>
<tbody>
{% for ticket in ticket_list %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<td>{{ ticket.get_priority_span }}</td>
<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|naturaltime }}</span></td>
</tr>
{% empty %}{% if ticket_list_empty_message %}
<tr><td colspan='6'>{{ ticket_list_empty_message }}</td></tr>
{% endif %}{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,21 @@
{% load i18n %}
<table class="table table-hover table-bordered table-striped">
<caption>{% trans "Unassigned Tickets" %} {% trans "(pick up a ticket if you start to work on it)" %}</caption>
<thead>
<tr><th>#</th><th>{% trans "Pr" %}</th><th>{% trans "Title" %}</th><th>{% trans "Queue" %}</th><th>{% trans "Created" %}</th><th>&nbsp;</th></tr>
</thead>
<tbody>
{% for ticket in unassigned_tickets %}
<tr>
<th><a href='{{ ticket.get_absolute_url }}'>{{ ticket.ticket }}</a></th>
<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|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>
{% empty %}
<tr><td colspan='6'>{% trans "There are no unassigned tickets." %}</td></tr>
{% endfor %}
</tbody>
</table>