diff --git a/app/views/cost_reports/filters/_activate_filter.rhtml b/app/views/cost_reports/filters/_activate_filter.rhtml index 7f67bb69f1..60254d4b91 100644 --- a/app/views/cost_reports/filters/_activate_filter.rhtml +++ b/app/views/cost_reports/filters/_activate_filter.rhtml @@ -1,14 +1,13 @@ -<%# - This partial requires the following locals: - element a Hash containing the following keys: - - :name => :activate_filter - - :filter_name => String: The name of a filter (e.g. activity_id) - - :label => String: A text which is shown to the user as a label for this filter - - :width => Integer (optional): The width this partial may consume. If not given, a standard width will be applied +<%= + #This partial requires the following locals: + # element a Hash containing the following keys: + # - :name => :activate_filter + # - :filter_name => String: The name of a filter (e.g. activity_id) + # - :label => String: A text which is shown to the user as a label for this filter + # - :width => Integer (optional): The width this partial may consume. If not given, a standard width will be applied %> - - + + \ No newline at end of file diff --git a/assets/javascripts/reporting.js b/assets/javascripts/reporting.js index 97a13f9a0c..00b90820d6 100644 --- a/assets/javascripts/reporting.js +++ b/assets/javascripts/reporting.js @@ -1,15 +1,15 @@ /*global $, selectAllOptions, moveOptions */ function toggle_filter(field) { - var check_box, to_toggle; - check_box = $('cb_' + field); - to_toggle = check_box.up().siblings(); - - if (check_box.checked) { - to_toggle.invoke('show'); + var remove, to_toggle; + remove = $('rm_' + field); + to_toggle = remove.up().siblings(); + + if (remove.display) { + to_toggle.invoke('hide'); } else { - to_toggle.invoke('hide'); + to_toggle.invoke('show'); } } @@ -62,11 +62,9 @@ function display_category(tr_field) { } function show_filter(field) { - var field_el = $('tr_' + field), check_box = null; + var field_el = $('tr_' + field); if (field_el !== null) { field_el.show(); - check_box = $('cb_' + field); - check_box.checked = true; toggle_filter(field); operator_changed(field, $("operators_" + field)); display_category(field_el); @@ -74,11 +72,9 @@ function show_filter(field) { } function hide_filter(field) { - var field_el = $('tr_' + field), check_box = null; + var field_el = $('tr_' + field) if (field_el !== null) { field_el.hide(); - check_box = $('cb_' + field); - check_box.checked = false; toggle_filter(field); operator_changed(field, $("operators_" + field)); } @@ -110,6 +106,13 @@ function add_filter(select) { disable_select_option(select, field); } +function removed_filter(field) { + var select, field; + select = $("add_filter_select"); + hide_filter(field); + enable_select_option(select, field) +} + function show_group_by(group_by, target) { var source, group_option, i; source = $("group_by_container"); diff --git a/assets/stylesheets/reporting.css b/assets/stylesheets/reporting.css index c803885d0e..cad88ccf54 100644 --- a/assets/stylesheets/reporting.css +++ b/assets/stylesheets/reporting.css @@ -9,7 +9,7 @@ .report { text-align: center; - border-collapse: collapse; + border-collapse: collapse; border: solid 1px #ccc !important; width: auto !important; } @@ -135,7 +135,7 @@ .moveLeft { margin-left: 0px; - margin-right: 0px; + margin-right: 0px; background-image: url(../images/arrow_D_left.gif); } @@ -157,3 +157,7 @@ background-image: url(../images/arrow_B_down.gif); } +.icon-filterdel { + background-image: url(../images/filter_del.png); +} +