<div class="tabs-panel marginbottom10">
-<%
+<%
found_resources_count = @resources.size
found_resources_ids = @resources.map {|r| r.id.to_s}.join(',')
page_size = (params[:page_size] && params[:page_size].to_i) || 20
<input type="hidden" name="resource_type" value="<%= @selected_tab -%>"/>
<%= submit_tag message('bulk_deletion.filter'), :id => 'filter_resources' %>
<% end %>
-
+
<% if @resources.empty? %>
<br/>
<%= message('no_results') -%>
<% else %>
<% form_remote_tag( :url => {:action => 'delete_resources'}, :loading => "window.location='#{url_for :action => 'pending_deletions'}';") do %>
-
+
<table class="data" id="resources-to-delete">
<tfoot>
<tr>
<td class="thin">
<input id="r-<%= index -%>" type="checkbox" value="<%= resource.id -%>" name="resources[]">
</td>
- <td><%= resource.name -%></td>
+ <td>
+ <%= resource.name -%>
+ <br/><span class="small gray"><%= resource.key -%></span></td>
+ </td>
</tr>
<% end %>
</tbody>
</table>
-
+
<% end %>
-
+
<script>
function checkBeforeDeleting() {
var resource_selected = false;
alert("<%= message('bulk_deletion.please_select_at_least_one_resource') -%>");
return false;
}
-
+
if (!confirm("<%= message('bulk_deletion.sure_to_delete_the_resources') -%>")) {
return false;
- }
-
+ }
+
return true;
}
-
+
function selectOrDeselect() {
var status = $('r-all').checked;
$$('tbody input').each(function(input) {
}
<% end %>
}
-
+
function handleSelectAllAction() {
if ($('all_resources').value=='') {
selectAllResources();
selectOrDeselect();
}
}
-
+
function selectAllResources() {
$('all_resources').value = '<%= found_resources_ids -%>';
$('select_all_action').innerHTML = '<%= message('bulk_deletion.clear_selection', :params => found_resources_count) -%>';
}
-
+
function selectNotAllResources() {
$('all_resources').value = '';
$('select_all_action').innerHTML = '<%= message('bulk_deletion.select_all_x_resources', :params => found_resources_count) -%>';
</script>
<% end %>
-
+
</div>
\ No newline at end of file