carnival 0.0.56 → 0.0.57
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/carnival/admin.js +3 -0
- data/app/assets/javascripts/carnival/admin.js.orig +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2.min.js +23 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ar.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_az.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_bg.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ca.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_cs.js +51 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_da.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_de.js +18 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_el.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_en.js.template +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_es.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_et.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_eu.js +45 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fa.js +21 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fi.js +30 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_fr.js +18 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_gl.js +45 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_he.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_hr.js +24 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_hu.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_id.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_is.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_it.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ja.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ka.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ko.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_lt.js +26 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_lv.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_mk.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ms.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_nl.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_no.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pl.js +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pt-BR.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_pt-PT.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ro.js +17 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_rs.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ru.js +23 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_sk.js +50 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_sv.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_th.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_tr.js +19 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_ug-CN.js +16 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_uk.js +25 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_vi.js +20 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_zh-CN.js +16 -0
- data/app/assets/javascripts/carnival/external/select2/select2_locale_zh-TW.js +16 -0
- data/app/assets/javascripts/carnival/select_remote.js +60 -0
- data/app/assets/javascripts/carnival/vizir_admin.js +2 -1
- data/app/assets/javascripts/carnival/vizir_admin.js.orig +144 -0
- data/app/assets/stylesheets/carnival/admin.css +1 -0
- data/app/assets/stylesheets/carnival/main.css +4 -0
- data/app/assets/stylesheets/carnival/select2-spinner.gif +0 -0
- data/app/assets/stylesheets/carnival/select2.css +704 -0
- data/app/assets/stylesheets/carnival/select2.png +0 -0
- data/app/assets/stylesheets/carnival/select2x2.png +0 -0
- data/app/controllers/carnival/base_admin_controller.rb +12 -0
- data/app/inputs/carnival_select_remote_input.rb +29 -0
- data/app/views/carnival/shared/form/_field.html.haml +7 -0
- data/app/views/carnival/shared/form/_field.html.haml.orig +14 -11
- data/app/views/carnival/shared/form/_form.html.haml +5 -1
- data/app/views/carnival/shared/form/_form.html.haml.orig +120 -0
- data/app/views/carnival/shared/form/_nested_form_options.html.haml +1 -1
- data/app/views/carnival/shared/form/_nested_form_options.html.haml.orig +47 -0
- data/lib/carnival/routes.rb +1 -0
- data/lib/carnival/routes.rb.orig +24 -0
- data/lib/carnival/version.rb +1 -1
- data/lib/carnival/version.rb.orig +3 -3
- data/test/dummy/app/controllers/admin/countries_controller.rb +1 -0
- data/test/dummy/app/presenters/admin/state_presenter.rb +2 -1
- data/test/dummy/app/presenters/admin/state_presenter.rb.orig +50 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/log/bullet.log +215 -0
- data/test/dummy/log/development.log +56326 -0
- data/test/dummy/tmp/cache/assets/development/sass/509d6df7de260d7d7b30aaf213f62ecc911d86f4/select2.scssc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/018a93c2452c8104980bcd5778c4f903 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0771f824a0b668f566e7c11953b6065e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0bbd04f3201327a4cdd08aa5beea2422 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0e538066312487cf0c93484b2a433017 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/12adab320a9b9986d13ed94e39efe2e7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1367e1fa08f1b8c7abd298d4bbe85c1a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/14a446a1806cd2ee255698c10b3cd391 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/22ee6768794b3c3c55570719479481c3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/24d23fdd4c311a9447e4c8c19c97d48e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/29317ab42cc07bf908f29827920b27d5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/29c571d9350b75a47945757daf5ef26f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2c4a028e3e3b137a5e49c13178239cce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2dfdac7588010f579a833be228971375 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/30c8c2e6ca355103a267133f6b45b0ce +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/32d06d5bee6f865ba0f92224a787a90a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/34dba06ee0eb7a742ecdfcba69edb56e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/379fa199e19b70bbee3ac80c78e0d81e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/39d34c0caaa6f36d684fac1898a7f88f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3d4686d9bb627b7c725f000130c5a61d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3d8100b6e405407290dcf994ef05e0b7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3eb8fc367b74dbe8ae50e0f98feec6bb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3f9e96f5004cdb0ba971394c41c76931 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/41249a08e767749660864b8a126871e4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/43797547fd9a4d394bb0f7a99b2b3a94 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/43f27cc92ef38f6a01575708b2fa0e97 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4771cad53166b45022c6d03cb4b8c1e2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/48693f24b0d6df0cc626066ce01674e3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4a7a4dcd9fea9bd2e287771c51f96631 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4b6e6db955179fabe966a77cecb884fc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4b8f852230d4e126ed2a8f54594bc2ca +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4e4b1f24c5e69f2f305f6d6483a1605c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/4fc67dc5428a9f07a32dd1bb9e1447ae +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/50b3d3fa409e82b9990432561974e533 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/51537bd5728cad7f016be9b074c4f3ee +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/51bc502ce2fcf333e1123f4b19fcf7f8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/536648929c703c8c5e964b502b2095ff +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5644ad965098c5b865233d32caa78fa2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/565023fdd3960225e817ec043b2d9474 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/56a682a9df1f53c8d67f2467389995b2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/63982917dbb816db857477c2a2e7f999 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/69b3c18a3b9e45cd69a6df6c91f1807b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6c56ac77ea3b80472eb076fda62e0259 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6c95dc85b0bd5df72197be27cb987cb0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6d806eaa317f200bbf2832a0abf1c1cc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6dbcb09bb8b13a79ba150908ac8a5491 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6ebd06491e132b3907c33181ba6455d8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/752d59d33a640efa2745467df3e2cb7b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/78b5037e05950c87864989c8fd18524a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/79938d0a132e22a9a8f9cb59799aa546 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/79f249600921bff9906cd4f6418852d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8576d7c22dbd8222ab27a6c47f56a65c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/874ebf15c13c8699187b0c9e5dc52175 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9285a4d2fa6444ced9a4d2775ebead57 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/929914a16eaca5537bbc9b4d33646223 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9ae99eba4f0f2e46d6bd58c98d39a1f9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9dbe0a36629f740426a301876917b9d3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9dcf3f13f133f78ee4595ed37117b05b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a0a55ae2ade6651b5e3a02c48eb65f88 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a104711413193d8cbfa431662760b38a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a23f793f10f58c10ce34d68d181ed32f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a515ea5e8aa465597bf897e31735b32d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/a68cd2439f6cc8e7f002b1845ab3fd0c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/adafe641ec176fcf476a9a200f7d561f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ae269fb1b4129501c9b8ca317b0cd7e7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b740fd10a7de993ae4db7f1f5df909d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bc4c8f727196d1e399090596cae4a85b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bf313b342653b1b3e509da03d61866e2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bf81a479ccdf9a6ba78ef5a5647d8e16 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bfae304b927120a1b379c8dfdcf03cbb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c34cb2d9c5caf3927f220b9e43f6762d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c72101732682999b6ca050f007fc6467 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c753ab5855fa7322e298f05684a45d0f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c8927e934e7960fc7907b6fc02ea7f08 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c980544b5828a643ecaa8e784897c2c2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/caa549dc4bdcddd64e487a5827e64a80 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cae24edceb694d087d7a1547f551ee34 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cb180d1ba68a565b8373b22576170eb8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cc2c3f8b87c5b787305412a3076058db +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d16461dfcae4b782f721ebd81e4f8740 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d5a920fbfad1410d8ec2dbc5029bbaf6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d6327a0916e2e516fcf7ab7c5520c7a0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d73ac23504860006ee8365d9031bd98b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/daf428b2f08afc738dfcd85d872d49c4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dc5a6e1e848dfc338a281846eb757ef2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/dcedf863f6acc3e1f21ec11434a77bf7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e0352d0f97751491adbe6a94832772af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e4298973f799acdce289752c24bfddf2 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e9c81ca91323dab8977ffd8a459cab06 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/eb7d39f60d584b68af01ee0b7fa59e9d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ef5b9ae70f88795292472efad672fc1b +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f1e75c209067b23f5c0c7bf2006c43d0 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f5c9348795319821f3309d4e03bb9fdb +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f69e8aafb38584272cbcbca08f3085d3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f6b09a5a33ecad520452011007930e0e +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7ab949c8c6b7ef3f2b743ebd98f9f59 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- metadata +267 -46
- data/app/models/carnival/field.rb.orig +0 -157
@@ -1,157 +0,0 @@
|
|
1
|
-
module Carnival
|
2
|
-
class Field
|
3
|
-
|
4
|
-
attr_accessor :size, :column, :line, :name, :params
|
5
|
-
|
6
|
-
def initialize(name, params={})
|
7
|
-
@params = params
|
8
|
-
@name = name
|
9
|
-
set_position_by_params
|
10
|
-
end
|
11
|
-
|
12
|
-
def name
|
13
|
-
@name.to_s
|
14
|
-
end
|
15
|
-
|
16
|
-
def css_class
|
17
|
-
if @params[:css_class]
|
18
|
-
return @params[:css_class]
|
19
|
-
else
|
20
|
-
return ""
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def date_filter?
|
25
|
-
@params[:date_filter]
|
26
|
-
end
|
27
|
-
|
28
|
-
def default_date_filter
|
29
|
-
if @params[:date_filter_default]
|
30
|
-
@params[:date_filter_default]
|
31
|
-
else
|
32
|
-
date_filter_periods.first.first
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def date_filter_periods
|
37
|
-
if @params[:date_filter_periods]
|
38
|
-
@params[:date_filter_periods]
|
39
|
-
else
|
40
|
-
{:today => ["#{Date.today}", "#{Date.today}"],
|
41
|
-
:yesterday => ["#{Date.today - 1.day}", "#{Date.today - 1.day}"],
|
42
|
-
:this_week => ["#{Date.today.beginning_of_week}", "#{Date.today.end_of_week}"],
|
43
|
-
:last_week => ["#{(Date.today - 1.week).beginning_of_week}", "#{(Date.today - 1.week).end_of_week}"],
|
44
|
-
:this_month => ["#{Date.today.beginning_of_month}", "#{Date.today.end_of_month}"],
|
45
|
-
:last_month => ["#{(Date.today - 1.month).beginning_of_month}", "#{(Date.today - 1.month).end_of_month}"],
|
46
|
-
:this_year => ["#{Date.today.beginning_of_year}", "#{Date.today.end_of_year}"],
|
47
|
-
:last_year => ["#{(Date.today - 1.year).beginning_of_year}", "#{(Date.today - 1.year).end_of_year}"]
|
48
|
-
}
|
49
|
-
end
|
50
|
-
end
|
51
|
-
def default_sortable?
|
52
|
-
@params[:sortable] && @params[:sortable].class == Hash && @params[:sortable][:default] == true
|
53
|
-
end
|
54
|
-
|
55
|
-
def default_sort_direction
|
56
|
-
if default_sortable?
|
57
|
-
if @params[:sortable][:direction]
|
58
|
-
return @params[:sortable][:direction]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
return :asc
|
62
|
-
end
|
63
|
-
|
64
|
-
def depends_on
|
65
|
-
@params[:depends_on]
|
66
|
-
end
|
67
|
-
|
68
|
-
def nested_form?
|
69
|
-
@params[:nested_form]
|
70
|
-
end
|
71
|
-
|
72
|
-
def nested_form_allow_destroy?
|
73
|
-
@params[:nested_form_allow_destroy]
|
74
|
-
end
|
75
|
-
|
76
|
-
def nested_form_modes? (mode)
|
77
|
-
associate = get_associate_nested_form_mode
|
78
|
-
return true if associate.present? && mode == :associate
|
79
|
-
return @params[:nested_form_modes].include?(mode) unless @params[:nested_form_modes].nil?
|
80
|
-
return false
|
81
|
-
end
|
82
|
-
|
83
|
-
def nested_form_scope
|
84
|
-
return nil if !nested_form_modes? :associate
|
85
|
-
associate_mode = get_associate_nested_form_mode
|
86
|
-
return nil if associate_mode.is_a? Symbol
|
87
|
-
return associate_mode[:scope] if associate_mode[:scope].present?
|
88
|
-
end
|
89
|
-
|
90
|
-
def sortable?
|
91
|
-
<<<<<<< HEAD
|
92
|
-
return true if @params[:sortable].nil?
|
93
|
-
@params[:sortable]
|
94
|
-
=======
|
95
|
-
return true if @params[:sortable]
|
96
|
-
return true if @params[:sortable].class == Hash
|
97
|
-
return false
|
98
|
-
end
|
99
|
-
|
100
|
-
def sortable_params
|
101
|
-
return false if !sortable?
|
102
|
-
return @params[:sortable].to_json if @params[:sortable].class == Hash
|
103
|
-
return true
|
104
|
-
>>>>>>> master
|
105
|
-
end
|
106
|
-
|
107
|
-
def searchable?
|
108
|
-
@params[:searchable]
|
109
|
-
end
|
110
|
-
|
111
|
-
def advanced_searchable?
|
112
|
-
@params[:advanced_search]
|
113
|
-
end
|
114
|
-
|
115
|
-
def show_as_list
|
116
|
-
@params[:show_as_list]
|
117
|
-
end
|
118
|
-
|
119
|
-
def advanced_search_operator
|
120
|
-
return @params[:advanced_search][:operator] if advanced_searchable? and @params[:advanced_search][:operator].present?
|
121
|
-
:like
|
122
|
-
end
|
123
|
-
|
124
|
-
def valid_for_action?(action)
|
125
|
-
@params[:actions].include?(action)
|
126
|
-
end
|
127
|
-
|
128
|
-
def as
|
129
|
-
@params[:as]
|
130
|
-
end
|
131
|
-
|
132
|
-
def widget
|
133
|
-
@params[:widget].present? ? @params[:widget] : :input
|
134
|
-
end
|
135
|
-
|
136
|
-
private
|
137
|
-
def set_position_by_params
|
138
|
-
if @params[:position].present?
|
139
|
-
@line = @params[:position][:line]
|
140
|
-
@column = @params[:position][:column]
|
141
|
-
@size = @params[:position][:size]
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
def get_associate_nested_form_mode
|
146
|
-
return nil if @params[:nested_form_modes].nil?
|
147
|
-
@params[:nested_form_modes].each do |mode|
|
148
|
-
if mode.is_a? Hash
|
149
|
-
return mode[:associate] if mode[:associate].present?
|
150
|
-
elsif mode.is_a? Symbol
|
151
|
-
return mode if mode == :associate
|
152
|
-
end
|
153
|
-
end
|
154
|
-
nil
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|