test
This commit is contained in:
1 parent
ae85fe2859
commit
2df2919aad
2 files changed
+36
-42
No files matched your search
@@ -2,7 +2,6 @@
|
||||
require 'rubyXL'
|
||||
class Admin::PatchfilesController < OrbitAdminController
|
||||
include Admin::PatchfilesHelper
|
||||
before_action ->(module_app = @app_title) { set_variables module_app }
|
||||
before_action :getfont , :create_first_field
|
||||
#before_action :load_access_levels
|
||||
def initialize
|
||||
@@ -11,23 +10,17 @@ class Admin::PatchfilesController < OrbitAdminController
|
||||
end
|
||||
|
||||
def index
|
||||
@tags = @module_app.tags
|
||||
@categories = @module_app.categories.enabled
|
||||
@filter_fields = filter_fields(@categories, @tags)
|
||||
@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
|
||||
#@tags = @module_app.tags
|
||||
#@categories = @module_app.categories.enabled
|
||||
#@filter_fields = filter_fields(@categories, @tags)
|
||||
#@table_fields = [:status, :category, :title, :start_date, :end_date, :last_modified]
|
||||
if request.xhr?
|
||||
render :partial => "index"
|
||||
end
|
||||
end
|
||||
def edit
|
||||
params["filefield"]["file_show"].each do |name,status|
|
||||
@file_to_show.file_show[name][:status] = status.to_i rescue nil
|
||||
end
|
||||
if params["filefield"]["refresh_btn"] == "true"
|
||||
@default_field = Filefield.new()
|
||||
@file_to_show.file_show = @default_field.file_show
|
||||
@file_to_show.save
|
||||
redirect_to admin_patchfiles_path and return
|
||||
@file_to_show.file_show[name][:status] = status.to_i
|
||||
end
|
||||
params["filefield"]["sub_file_fields"].each do |name,files|
|
||||
files.each do |index,file_and_status|
|
||||
@@ -186,6 +179,7 @@ class Admin::PatchfilesController < OrbitAdminController
|
||||
end
|
||||
end
|
||||
def create_first_field
|
||||
@app_title = "patchfile"
|
||||
if Patchfilefield.where("title"=>(@app_title + "_back")).take_while{true}.count == 0
|
||||
@field = Patchfilefield.new()
|
||||
@field.title = @app_title +"_back"
|
||||
|
||||
Reference in new issue
Block a user