From d4a8b1a90c2ab9746be498bc9484f3bca8482c2c Mon Sep 17 00:00:00 2001 From: Erik Traikov Date: Wed, 14 Dec 2011 10:40:38 -0500 Subject: [PATCH] Fixing table entry buttons for groups --- app/views/groups/index.html.erb | 5 ++ app/views/groups/invalid_grouping.rjs | 2 +- .../modal_dialogs/_rename_group.html.erb | 4 +- .../table_row/_filter_table_row.html.erb | 55 ++++++++----------- app/views/groups/valid_grouping.rjs | 2 +- config/routes.rb | 5 +- 6 files changed, 36 insertions(+), 37 deletions(-) diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index 13c1454263..ba062b7d94 100644 --- a/app/views/groups/index.html.erb +++ b/app/views/groups/index.html.erb @@ -5,6 +5,7 @@ <%= javascript_include_tag "FilterTable/FilterTable.js" %> <%= javascript_include_tag "Groups/tabs_boot.js" %> <%= javascript_include_tag "prototype.js" %> +<%= csrf_meta_tag %> <%= render :partial => "boot.js.erb" %> diff --git a/app/views/groups/invalid_grouping.rjs b/app/views/groups/invalid_grouping.rjs index d0420e8ca6..7419ca567b 100644 --- a/app/views/groups/invalid_grouping.rjs +++ b/app/views/groups/invalid_grouping.rjs @@ -1 +1 @@ -page.call "modify_grouping", @grouping_data.to_json \ No newline at end of file +page.call "modify_grouping", @grouping_data.to_json diff --git a/app/views/groups/modal_dialogs/_rename_group.html.erb b/app/views/groups/modal_dialogs/_rename_group.html.erb index 46885927a1..0e606c906c 100644 --- a/app/views/groups/modal_dialogs/_rename_group.html.erb +++ b/app/views/groups/modal_dialogs/_rename_group.html.erb @@ -1,5 +1,5 @@

<%= I18n.t('groups.rename_group.title') %>

-<% form_remote_tag :url => { :action => 'rename_group', :id => @assignment.id, :grouping_id => @grouping_id} do %> +<% form_remote_tag :url => { :action => 'rename_group', :grouping_id => @grouping_id} do %>
<%= label_tag "new_groupname", I18n.t('groups.rename_group.group_name') %> @@ -8,4 +8,4 @@ <%= submit_tag I18n.t('groups.rename_group.title') %>

-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/groups/table_row/_filter_table_row.html.erb b/app/views/groups/table_row/_filter_table_row.html.erb index d16c64f00c..080f58f285 100644 --- a/app/views/groups/table_row/_filter_table_row.html.erb +++ b/app/views/groups/table_row/_filter_table_row.html.erb @@ -5,51 +5,44 @@ <%= link_to image_tag("icons/tick.png", :alt => I18n.t('groups.is_valid'), :title => I18n.t('groups.is_valid')), - :url => {:action => 'invalid_grouping', - :id => assignment.id, - :grouping_id => grouping.id}, - :confirm => I18n.t('groups.invalidate_confirm'), - :remote => true + { :action => 'invalid_grouping', + :grouping_id => grouping.id }, + :confirm => I18n.t('groups.invalidate_confirm'), + :remote => true %> <% else %> <%= link_to image_tag("icons/cross.png", :alt => I18n.t('groups.is_not_valid'), :title => I18n.t('groups.is_not_valid')), - :url => {:action => 'valid_grouping', - :id => assignment.id, - :grouping_id => grouping.id}, - :confirm => I18n.t('groups.validate_confirm'), - :remote => true %> + { :action => 'valid_grouping', + :grouping_id => grouping.id }, + :confirm => I18n.t('groups.validate_confirm'), + :remote => true %> <% end %> <%= link_to image_tag("icons/pencil.png", :alt => I18n.t('groups.rename_group.link'), :title => I18n.t('groups.rename_group.link')), - :url => {:action => 'rename_group_dialog', - :id => assignment.id, - :grouping_id => grouping.id}, - :remote => true %> + { :action => 'rename_group_dialog', + :grouping_id => grouping.id }, + :remote => true %> <%= link_to image_tag("icons/note.png", :alt => I18n.t('notes.title'), :title => I18n.t('notes.title')), - :url => {:controller => 'note', - :action => 'notes_dialog', - :id => assignment.id, - :noteable_id => grouping.id, - :noteable_type => 'Grouping', - :action_to => 'note_message', - :controller_to => 'groups'}, - :html => {:id => "notes_highlight_#{grouping.id}"}, - :remote => true %> + { :controller => 'notes', + :action => 'notes_dialog', + :id => assignment.id, + :noteable_id => grouping.id, + :noteable_type => 'Grouping', + :action_to => 'note_message', + :controller_to => 'groups' }, + :remote => true %> <%= link_to image_tag("icons/bin_closed.png", :alt => I18n.t('groups.delete')), - :method => 'delete', - :url => {:action => 'remove_group', - :id => assignment.id, - :grouping_id => grouping.id}, - :html => {:class => 'delete', - :title => I18n.t('groups.delete')}, - :confirm => I18n.t('groups.delete_confirm'), - :remote => true %> + { :action => 'remove_group', + :grouping_id => grouping.id }, + :method => 'delete', + :confirm => I18n.t('groups.delete_confirm'), + :remote => true %> diff --git a/app/views/groups/valid_grouping.rjs b/app/views/groups/valid_grouping.rjs index d0420e8ca6..7419ca567b 100755 --- a/app/views/groups/valid_grouping.rjs +++ b/app/views/groups/valid_grouping.rjs @@ -1 +1 @@ -page.call "modify_grouping", @grouping_data.to_json \ No newline at end of file +page.call "modify_grouping", @grouping_data.to_json diff --git a/config/routes.rb b/config/routes.rb index 90f445abba..a32809351b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -91,8 +91,9 @@ get 'valid_grouping' get 'invalid_grouping' get 'global_actions' - get 'remove_group' - get 'rename_group' + delete 'remove_group' + post 'rename_group' + get 'rename_group_dialog' post 'add_group' post 'global_actions' end