From c626b22f4d0819058220a8725ee237345540035c Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Tue, 15 Jan 2008 05:07:19 +0000 Subject: [PATCH] * Add interface for filtering mechanism - now only shows the filtering options that are being used, allowing users to add or remove more options rather than just display the lot on screen. * Break out filtering and row hover into separate javascript files (hover is used in the ticket list & dashboard - same code was used in both places. Anti-DRY) --- htdocs/filter.js | 21 ++++++++++++++++++ htdocs/helpdesk.css | 32 ++++++--------------------- htdocs/hover.js | 7 ++++++ templates/helpdesk/dashboard.html | 8 +++---- templates/helpdesk/ticket_list.html | 34 ++++++++++++++++++++++++----- 5 files changed, 67 insertions(+), 35 deletions(-) create mode 100644 htdocs/filter.js create mode 100644 htdocs/hover.js diff --git a/htdocs/filter.js b/htdocs/filter.js new file mode 100644 index 00000000..216e556e --- /dev/null +++ b/htdocs/filter.js @@ -0,0 +1,21 @@ +$(document).ready(function() { + $("#filterBuilderButton").click(function() { + var boxName = "#filterBox" + $("#filterBuilderSelect").val(); + $(boxName).slideDown(); + return false; + }); + $(".filterBuilderRemove").click(function() { + var boxName = "#" + $(this).parent().attr('id'); + $(boxName).slideUp(); + $(boxName).children("input:text").each(function() { + $(this).val(""); + }); + $(boxName).children("input:checkbox").each(function() { + this.checked = false; + }); + $(boxName).children("select").each(function() { + this.selectedIndex = -1; + }); + return false; + }); +}); diff --git a/htdocs/helpdesk.css b/htdocs/helpdesk.css index b07db72b..3e95f772 100644 --- a/htdocs/helpdesk.css +++ b/htdocs/helpdesk.css @@ -156,31 +156,6 @@ a.ticket_link_status { font: 12pt Garamond; } -.priority1 { - background-color: #fcc; -} - -.priority2 { - background-color: #FFE5CE; -} - -.priority3 { - background-color: #CEE0FF; -} - -.priority4 { - background-color: #CEF5FF; -} - -.prority5 { - background-color: #CEE0FF; -} - -.priority1, .priority2, .priority3, .priority4, .priority5 { - color: #6C79A0; - border-bottom: solid #d5e7fd 1px; -} - a img { border: none; padding: 2px; @@ -189,3 +164,10 @@ a img { textarea#commentBox { width: 100%; } + +.filterBox { + display: none; +} +.filterBoxShow { + display: block; +} diff --git a/htdocs/hover.js b/htdocs/hover.js new file mode 100644 index 00000000..7b5b412a --- /dev/null +++ b/htdocs/hover.js @@ -0,0 +1,7 @@ +$(document).ready(function() { + $("tr.row_hover").mouseover(function() { + $(this).addClass("hover"); + }).mouseout(function() { + $(this).removeClass("hover"); + }); +}); diff --git a/templates/helpdesk/dashboard.html b/templates/helpdesk/dashboard.html index 036b8a21..948640b8 100644 --- a/templates/helpdesk/dashboard.html +++ b/templates/helpdesk/dashboard.html @@ -1,10 +1,8 @@ {% extends "helpdesk/base.html" %} {% block helpdesk_title %}Helpdesk Dashboard{% endblock %} -{% block helpdesk_head %}{% endblock %} +{% block helpdesk_head %} + +{% endblock %} {% block helpdesk_body %} diff --git a/templates/helpdesk/ticket_list.html b/templates/helpdesk/ticket_list.html index 42774913..9a227036 100644 --- a/templates/helpdesk/ticket_list.html +++ b/templates/helpdesk/ticket_list.html @@ -1,15 +1,24 @@ {% extends "helpdesk/base.html" %} {% block helpdesk_title %}Ticket Listing{% endblock %} -{% block helpdesk_head %}{% endblock %} +{% block helpdesk_head %} + + +{% endblock %} {% block helpdesk_body %} {% load in_list %} + + + +
+ +
+
+ +
+
+ +
+
{% for s in status_choices %} {{ s.1 }}{% endfor %} + +
+ +
+ +
Helpdesk Summary