Move delete checkboxes to js

This commit is contained in:
Christophe Vilayphiou committed 2012-08-14 00:59:01 +08:00
1 parent 18e18a4add
commit c32b0dd4b4
22 files changed
+82 -78

No files matched your search

@@ -124,8 +124,8 @@ class Panel::WebResource::BackEnd::WebLinksController < OrbitBackendController
end
def delete
if params[:to_delete]
web_links = WebLink.any_in(:_id => params[:to_delete]).delete_all
if params[:ids]
web_links = WebLink.any_in(:_id => params[:ids]).delete_all
end
redirect_to panel_web_resource_back_end_web_links_url(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options])
end
@@ -1,4 +1,5 @@
<%= render_sort_bar(true, ['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
<%= render_sort_bar(true, delete_panel_web_resource_back_end_web_links_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]),
['status', ['is_top', 'is_hot', 'is_hidden', 'is_pending', 'is_checked', 'is_rejected'], 'span1', 'bulletin.status'],
['category', 'bulletin_category', 'span2', 'bulletin.category'],
['title', 'title','span3', 'bulletin.title'],
['tags', 'tags', 'span2', 'bulletin.tags']).html_safe %>
@@ -1,20 +1,18 @@
<%= form_for :news_bulletins, :url => delete_panel_web_resource_back_end_web_links_path(:direction => params[:direction], :sort => params[:sort], :sort_options => params[:sort_options]), :html => {:id => 'delete_all'}, :remote => true do %>
<%= render 'filter' %>
<table class="table main-list">
<thead>
<tr>
<th class="span1"></th>
<th class="span1"></th>
<th class="span2"></th>
<th class="span3"></th>
<th class="span2"></th>
</tr>
</thead>
<tbody id="tbody_web_links" class="sort-holder">
<%= render :partial => 'web_link', :collection => @web_links %>
</tbody>
</table>
<% end %>
<%= render 'filter' %>
<table class="table main-list">
<thead>
<tr>
<th class="span1"></th>
<th class="span1"></th>
<th class="span2"></th>
<th class="span3"></th>
<th class="span2"></th>
</tr>
</thead>
<tbody id="tbody_web_links" class="sort-holder">
<%= render :partial => 'web_link', :collection => @web_links %>
</tbody>
</table>
<div class="form-actions form-fixed pagination-right">
<%= link_to content_tag(:i, nil, :class => 'icon-plus icon-white') + t('announcement.add_new'), new_panel_web_resource_back_end_web_link_path, :class => 'btn btn-primary pull-right' %>
+1 -1
View File
@@ -6,7 +6,7 @@ Rails.application.routes.draw do
root :to => "web_links#index"
resources :web_links do
collection do
post 'delete'
get 'delete'
end
end
resources :web_link_categorys