Mercurial > hg > soundsoftware-site
changeset 777:facded821cee feature_14
Fixes Bug #321 - testing for true as a string in the controller; test the status of the fieldsets before toggling them in the js script.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2011 22:12:45 +0000 |
parents | af852d82b00b |
children | c118d3389088 |
files | vendor/plugins/redmine_tags/app/views/projects/_my_projects.rhtml vendor/plugins/redmine_tags/app/views/projects/index.rhtml vendor/plugins/redmine_tags/assets/javascripts/projects_index.js vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb |
diffstat | 4 files changed, 10 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/vendor/plugins/redmine_tags/app/views/projects/_my_projects.rhtml Thu Nov 17 18:24:01 2011 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/_my_projects.rhtml Thu Nov 17 22:12:45 2011 +0000 @@ -1,4 +1,4 @@ -<% if @myproj_status %> +<% if @myproj_status=="true" %> <fieldset id="my_projects_fieldset" class="collapsible"> <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_my_projects) %></legend> <% else %>
--- a/vendor/plugins/redmine_tags/app/views/projects/index.rhtml Thu Nov 17 18:24:01 2011 +0000 +++ b/vendor/plugins/redmine_tags/app/views/projects/index.rhtml Thu Nov 17 22:12:45 2011 +0000 @@ -19,8 +19,7 @@ <div style="clear:both;"></div> <% form_tag(:controller => :projects, :action => :index, :method => :get, :id => :project_filtering) do %> - -<% if @filter_status %> +<% if @filter_status=="true" %> <fieldset id="filters_fieldset" class="collapsible"> <legend onclick="toggleFieldsetWithState(this);"><%= l(:label_filter_plural) %></legend> <% else %>
--- a/vendor/plugins/redmine_tags/assets/javascripts/projects_index.js Thu Nov 17 18:24:01 2011 +0000 +++ b/vendor/plugins/redmine_tags/assets/javascripts/projects_index.js Thu Nov 17 22:12:45 2011 +0000 @@ -4,14 +4,12 @@ function toggleFieldsetWithState(this_field){ - toggleFieldset(this_field); - - id = Element.up(this_field, 'fieldset').id; - + id = Element.up(this_field, 'fieldset').id; // is the fieldset collapsed? status = $(id).hasClassName("collapsed"); + change_session(id, status); - change_session(id, status); + toggleFieldset(this_field); }; function change_session(id, nstatus) { @@ -19,6 +17,6 @@ var request = new Ajax.Request(url, { method: 'post', parameters: {field_id: id, status: nstatus}, - asynchronous: true - }); + asynchronous: true + }); } \ No newline at end of file
--- a/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Thu Nov 17 18:24:01 2011 +0000 +++ b/vendor/plugins/redmine_tags/lib/redmine_tags/patches/projects_controller_patch.rb Thu Nov 17 22:12:45 2011 +0000 @@ -48,6 +48,8 @@ status = params[:status] session[(field + "_status").to_sym] = status + logger.error { "SET - DEBUG-ME #{session.inspect}" } + render :nothing => true end @@ -63,7 +65,7 @@ @filter_status = false else @filter_status = session[:filters_fieldset_status] - end + end end # Lists visible projects. Paginator is for top-level projects only @@ -71,11 +73,6 @@ def filtered_index @project = Project.new filter_projects - - debugger - - logger.error { "JASUS" } - get_fieldset_statuses respond_to do |format|