Skip to content

Commit

Permalink
Fixing table entry buttons for groups
Browse files Browse the repository at this point in the history
  • Loading branch information
etraikov authored and jerboaa committed Mar 12, 2012
1 parent 39e4ccd commit d4a8b1a
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 37 deletions.
5 changes: 5 additions & 0 deletions app/views/groups/index.html.erb
Expand Up @@ -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" %>
<script type="text/javascript">
Expand Down Expand Up @@ -219,6 +220,10 @@ $("global_action_form").observe('ajax:after', function(evt, status, data, xhr) {
$("global_action_form").observe('ajax:complete', function(evt, status, data, xhr) {
done_thinking();
});

$("global_action_form").observe('ajax:success', function(evt, status, data, xhr) {
done_thinking();
});
</script>


Expand Down
2 changes: 1 addition & 1 deletion app/views/groups/invalid_grouping.rjs
@@ -1 +1 @@
page.call "modify_grouping", @grouping_data.to_json
page.call "modify_grouping", @grouping_data.to_json
4 changes: 2 additions & 2 deletions app/views/groups/modal_dialogs/_rename_group.html.erb
@@ -1,5 +1,5 @@
<h2><%= I18n.t('groups.rename_group.title') %></h2>
<% 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 %>
<fieldset>
<%= label_tag "new_groupname", I18n.t('groups.rename_group.group_name') %>
<input type="text" maxlength="30" id="new_groupname" name="new_groupname">
Expand All @@ -8,4 +8,4 @@
<%= submit_tag I18n.t('groups.rename_group.title') %>
<button onclick="modalRenameGroup.close(); return false;"><%= I18n.t('cancel') %> </button>
</p>
<% end %>
<% end %>
55 changes: 24 additions & 31 deletions app/views/groups/table_row/_filter_table_row.html.erb
Expand Up @@ -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 %>
</span>
</td>

Expand Down
2 changes: 1 addition & 1 deletion app/views/groups/valid_grouping.rjs
@@ -1 +1 @@
page.call "modify_grouping", @grouping_data.to_json
page.call "modify_grouping", @grouping_data.to_json
5 changes: 3 additions & 2 deletions config/routes.rb
Expand Up @@ -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
Expand Down

0 comments on commit d4a8b1a

Please sign in to comment.