added hidden and show
This commit is contained in:
1 parent
e6c7b932aa
commit
5af9cfe9e2
7 files changed
+61
-9
No files matched your search
@@ -230,7 +230,7 @@ end
|
||||
|
||||
def add_entry
|
||||
entry = TableEntry.new(table_entry_params)
|
||||
create_get_table_tags(@entry)
|
||||
create_get_table_tags(entry)
|
||||
entry.save
|
||||
entry.fix_have_data
|
||||
table = UTable.find(params[:table_entry][:u_table_id])
|
||||
@@ -263,6 +263,13 @@ end
|
||||
redirect_to admin_universal_table_path(:id=> table.to_param, :page => params[:page])
|
||||
end
|
||||
|
||||
def toggle_entries
|
||||
ids = params[:ids]
|
||||
hidden = params[:status] == "hide"
|
||||
TableEntry.where(:id.in => ids).update_all(is_hidden: hidden)
|
||||
render :json => {"success" => true}.to_json
|
||||
end
|
||||
|
||||
def new
|
||||
@table = UTable.new
|
||||
end
|
||||
@@ -338,7 +345,7 @@ end
|
||||
columns_count = columns.count
|
||||
columns_count = 1 if columns_count==0
|
||||
columns = Kaminari.paginate_array(columns,limit: columns_count)
|
||||
entries = TableEntry.where(:u_table_id=>table.id).sorting(params: params,table: table,column_entries: columns,page_num: params[:page],per: per)
|
||||
entries = TableEntry.where(:u_table_id=>table.id).can_display.sorting(params: params,table: table,column_entries: columns,page_num: params[:page],per: per)
|
||||
end
|
||||
|
||||
def table_params
|
||||
|
||||
@@ -127,15 +127,15 @@ class UniversalTablesController < ApplicationController
|
||||
end
|
||||
if paginated
|
||||
if tag.nil?
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count)
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).can_display.sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count)
|
||||
else
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids => tag.id).sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count)
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids => tag.id).can_display.sorting(params: params,table: table,page_num: params["page_no"],per: OrbitHelper.page_data_count)
|
||||
end
|
||||
else
|
||||
if tag.nil?
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).sorting(params: params,table: table,paginated: false)
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}).can_display.sorting(params: params,table: table,paginated: false)
|
||||
else
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids => tag.id).sorting(params: params,table: table,paginated: false)
|
||||
entries = TableEntry.where(:u_table_id=>table.id, "have_data.#{I18n.locale}" => {"$in" => [nil, true]}, :table_tag_ids => tag.id).can_display.sorting(params: params,table: table,paginated: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user