bhf 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/app/assets/images/bhf/pictos.png +0 -0
- data/app/assets/images/bhf/pictos_2x.png +0 -0
- data/app/assets/javascripts/bhf/application.js +153 -116
- data/app/assets/javascripts/bhf/classes/ArrayFields.js +1 -1
- data/app/assets/javascripts/bhf/classes/MultipleFields.js +2 -2
- data/app/assets/javascripts/bhf/classes/PlatformHelper.js +6 -11
- data/app/assets/javascripts/bhf/classes/{AjaxEdit.js → QuickEdit.js} +9 -9
- data/app/assets/javascripts/bhf/classes/{AjaxEditStack.js → QuickEditStack.js} +4 -20
- data/app/assets/javascripts/bhf/mootools-core-1.5.0-full-compat.js +1 -0
- data/app/assets/javascripts/bhf/mootools_ujs.js +11 -11
- data/app/assets/stylesheets/bhf/application.css.sass +86 -48
- data/app/controllers/bhf/application_controller.rb +8 -4
- data/app/controllers/bhf/embed_entries_controller.rb +2 -6
- data/app/controllers/bhf/entries_controller.rb +13 -16
- data/app/controllers/bhf/pages_controller.rb +14 -13
- data/app/helpers/bhf/application_helper.rb +6 -6
- data/app/helpers/bhf/entries_helper.rb +4 -2
- data/app/helpers/bhf/pages_helper.rb +0 -4
- data/app/views/bhf/entries/_form.haml +7 -4
- data/app/views/bhf/entries/show.haml +3 -4
- data/app/views/bhf/form/belongs_to/_radio.haml +28 -0
- data/app/views/bhf/form/belongs_to/_select.haml +21 -0
- data/app/views/bhf/form/belongs_to/_static.haml +1 -0
- data/app/views/bhf/{entries/form → form}/column/_array.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_boolean.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_date.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_hash.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_mappin.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_markdown.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_multiple_fields.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_number.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_paperclip.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_password.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_static.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_string.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_text.haml +0 -0
- data/app/views/bhf/{entries/form → form}/column/_wysiwyg.haml +0 -0
- data/app/views/bhf/form/embeds_many/_static.haml +26 -0
- data/app/views/bhf/form/embeds_one/_static.haml +2 -0
- data/app/views/bhf/form/has_and_belongs_to_many/_check_box.haml +22 -0
- data/app/views/bhf/form/has_and_belongs_to_many/_static.haml +1 -0
- data/app/views/bhf/form/has_many/_static.haml +26 -0
- data/app/views/bhf/form/has_one/_static.haml +2 -0
- data/app/views/bhf/helper/_definition_item.haml +1 -1
- data/app/views/bhf/helper/_frontend_edit.haml +1 -1
- data/app/views/bhf/pages/_platform.haml +39 -16
- data/app/views/bhf/{pages/macro → table}/belongs_to/_default.haml +1 -1
- data/app/views/bhf/table/column/_array.haml +1 -0
- data/app/views/bhf/table/column/_boolean.haml +1 -0
- data/app/views/bhf/table/column/_date.haml +1 -0
- data/app/views/bhf/table/column/_extern_link.haml +2 -0
- data/app/views/bhf/table/column/_file.haml +1 -0
- data/app/views/bhf/table/column/_hash.haml +1 -0
- data/app/views/bhf/table/column/_image.haml +1 -0
- data/app/views/bhf/table/column/_number.haml +1 -0
- data/app/views/bhf/table/column/_paperclip.haml +5 -0
- data/app/views/bhf/table/column/_primary_key.haml +1 -0
- data/app/views/bhf/table/column/_string.haml +1 -0
- data/app/views/bhf/table/column/_text.haml +1 -0
- data/app/views/bhf/table/embeds_many/_default.haml +1 -0
- data/app/views/bhf/table/embeds_one/_default.haml +1 -0
- data/app/views/bhf/table/has_and_belongs_to_many/_default.haml +1 -0
- data/app/views/bhf/table/has_many/_default.haml +2 -0
- data/app/views/bhf/{pages/macro → table}/has_one/_default.haml +1 -1
- data/bhf.gemspec +60 -59
- data/config/locales/de.yml +8 -8
- data/config/locales/en.yml +7 -7
- data/lib/bhf.rb +26 -21
- data/lib/bhf/action_view/form_builder.rb +36 -0
- data/lib/bhf/action_view/form_options.rb +30 -0
- data/lib/bhf/active_record/base.rb +58 -0
- data/lib/bhf/mongoid/document.rb +135 -137
- data/lib/bhf/platform/attribute/abstract.rb +52 -0
- data/lib/bhf/platform/attribute/column.rb +78 -0
- data/lib/bhf/platform/attribute/reflection.rb +68 -0
- data/lib/bhf/platform/base.rb +333 -0
- data/lib/bhf/{pagination.rb → platform/pagination.rb} +1 -1
- data/lib/bhf/{settings.rb → settings/base.rb} +14 -11
- data/lib/bhf/settings/platform.rb +20 -0
- data/lib/bhf/settings/yaml_parser.rb +84 -0
- data/lib/rails/generators/bhf/templates/initializer.rb +1 -1
- metadata +58 -57
- data/app/views/bhf/entries/form/belongs_to/_account_scope.haml +0 -2
- data/app/views/bhf/entries/form/belongs_to/_radio.haml +0 -8
- data/app/views/bhf/entries/form/belongs_to/_select.haml +0 -7
- data/app/views/bhf/entries/form/belongs_to/_static.haml +0 -1
- data/app/views/bhf/entries/form/embeds_many/_static.haml +0 -12
- data/app/views/bhf/entries/form/embeds_one/_static.haml +0 -12
- data/app/views/bhf/entries/form/has_and_belongs_to_many/_account_scope.haml +0 -2
- data/app/views/bhf/entries/form/has_and_belongs_to_many/_check_box.haml +0 -5
- data/app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml +0 -1
- data/app/views/bhf/entries/form/has_many/_static.haml +0 -12
- data/app/views/bhf/entries/form/has_one/_account_scope.haml +0 -2
- data/app/views/bhf/entries/form/has_one/_static.haml +0 -9
- data/app/views/bhf/pages/macro/column/_array.haml +0 -1
- data/app/views/bhf/pages/macro/column/_boolean.haml +0 -1
- data/app/views/bhf/pages/macro/column/_date.haml +0 -1
- data/app/views/bhf/pages/macro/column/_extern_link.haml +0 -2
- data/app/views/bhf/pages/macro/column/_file.haml +0 -1
- data/app/views/bhf/pages/macro/column/_hash.haml +0 -1
- data/app/views/bhf/pages/macro/column/_image.haml +0 -2
- data/app/views/bhf/pages/macro/column/_number.haml +0 -1
- data/app/views/bhf/pages/macro/column/_paperclip.haml +0 -6
- data/app/views/bhf/pages/macro/column/_primary_key.haml +0 -1
- data/app/views/bhf/pages/macro/column/_string.haml +0 -1
- data/app/views/bhf/pages/macro/column/_text.haml +0 -1
- data/app/views/bhf/pages/macro/embeds_many/_default.haml +0 -1
- data/app/views/bhf/pages/macro/embeds_one/_default.haml +0 -1
- data/app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml +0 -1
- data/app/views/bhf/pages/macro/has_many/_default.haml +0 -2
- data/lib/bhf/active_record/active_record.rb +0 -59
- data/lib/bhf/data.rb +0 -169
- data/lib/bhf/form.rb +0 -36
- data/lib/bhf/platform.rb +0 -308
- data/lib/bhf/settings_parser.rb +0 -84
@@ -1,9 +1,12 @@
|
|
1
|
-
module Bhf
|
1
|
+
module Bhf::Settings
|
2
2
|
|
3
|
-
class
|
3
|
+
class Base
|
4
|
+
|
5
|
+
attr_accessor :user
|
4
6
|
|
5
|
-
def initialize(
|
6
|
-
@
|
7
|
+
def initialize(settings_hash, user = nil)
|
8
|
+
@settings_hash = settings_hash
|
9
|
+
@user = user
|
7
10
|
|
8
11
|
t = pages.each_with_object([]) do |page, obj|
|
9
12
|
content_for_page(page).each do |platform|
|
@@ -19,8 +22,7 @@ module Bhf
|
|
19
22
|
end
|
20
23
|
|
21
24
|
def pages
|
22
|
-
|
23
|
-
@pages = @options['pages'].each_with_object([]) do |page, obj|
|
25
|
+
@pages ||= @settings_hash['pages'].each_with_object([]) do |page, obj|
|
24
26
|
if page.is_a?(String)
|
25
27
|
page = {page => nil}
|
26
28
|
end
|
@@ -29,7 +31,7 @@ module Bhf
|
|
29
31
|
end
|
30
32
|
|
31
33
|
def content_for_page(selected_page)
|
32
|
-
@
|
34
|
+
@settings_hash['pages'].each do |page|
|
33
35
|
page = {page => nil} if page.is_a?(String)
|
34
36
|
|
35
37
|
if selected_page == page.keys[0]
|
@@ -39,11 +41,12 @@ module Bhf
|
|
39
41
|
nil
|
40
42
|
end
|
41
43
|
|
42
|
-
def
|
44
|
+
def find_platform_settings(platform_name)
|
43
45
|
pages.each do |page|
|
44
|
-
content_for_page(page).each do |
|
45
|
-
|
46
|
-
|
46
|
+
content_for_page(page).each do |platform_hash|
|
47
|
+
if platform_hash.keys[0] == platform_name.to_s
|
48
|
+
return Bhf::Settings::Platform.new(platform_hash, page, self)
|
49
|
+
end
|
47
50
|
end
|
48
51
|
end
|
49
52
|
nil
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Bhf::Settings
|
2
|
+
|
3
|
+
class Platform
|
4
|
+
|
5
|
+
attr_reader :name, :data, :page_name, :hash, :settings_base
|
6
|
+
|
7
|
+
def initialize(settings_hash, page_name, settings_base)
|
8
|
+
if settings_hash.is_a?(String)
|
9
|
+
settings_hash = {settings_hash => nil}
|
10
|
+
end
|
11
|
+
@name = settings_hash.keys[0]
|
12
|
+
@hash = settings_hash.values[0] || {}
|
13
|
+
|
14
|
+
@settings_base = settings_base
|
15
|
+
@page_name = page_name
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module Bhf::Settings
|
2
|
+
|
3
|
+
class YAMLParser
|
4
|
+
|
5
|
+
attr_accessor :settings_hash
|
6
|
+
|
7
|
+
def initialize(roles_array, area = nil)
|
8
|
+
roles_settings = roles_yml(roles_array, area)
|
9
|
+
|
10
|
+
if Bhf.configuration.abstract_settings.any?
|
11
|
+
|
12
|
+
tmp_pages = get_settings_array(Bhf.configuration.abstract_settings, '/abstract')['pages']
|
13
|
+
abstract_platform_settings = tmp_pages.each_with_object({}) do |abstract_pages, hash|
|
14
|
+
abstract_pages.each do |abstract_page|
|
15
|
+
abstract_page[1].each do |abstract_platform|
|
16
|
+
hash.merge!(abstract_platform)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
roles_settings['pages'].each_with_index do |pages, i_1|
|
22
|
+
pages.each_pair do |key_1, page|
|
23
|
+
page.each_with_index do |platform, i_2|
|
24
|
+
platform.each_pair do |key_2, value|
|
25
|
+
abstract_platform_key = if value.to_h['extend_abstract']
|
26
|
+
value.to_h['extend_abstract']
|
27
|
+
elsif abstract_platform_settings[key_2]
|
28
|
+
key_2
|
29
|
+
end
|
30
|
+
next unless abstract_platform_key
|
31
|
+
roles_settings['pages'][i_1][key_1][i_2][key_2] = abstract_platform_settings[abstract_platform_key].deep_merge(value.to_h)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
@settings_hash = roles_settings
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
def get_settings_array(array, dir)
|
43
|
+
array.each_with_object({'pages' => []}) do |r, account_roles|
|
44
|
+
pages = load_yml("#{dir}/#{r}")['pages']
|
45
|
+
account_roles['pages'] += pages if pages
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def roles_yml(roles = nil, area = nil)
|
50
|
+
area_dir = "/#{area}" if area.present?
|
51
|
+
if roles.is_a?(String)
|
52
|
+
load_yml("#{area_dir}/#{roles}")
|
53
|
+
elsif roles.is_a?(Array)
|
54
|
+
files = get_settings_array(roles, area_dir)
|
55
|
+
|
56
|
+
# find the same pages and merge them
|
57
|
+
merged_files = {'pages' => []}
|
58
|
+
files['pages'].each do |pages|
|
59
|
+
merged = false
|
60
|
+
pages.each_pair do |key, page|
|
61
|
+
merged_files['pages'].each do |m_page|
|
62
|
+
if m_page.include?(key)
|
63
|
+
merged = true
|
64
|
+
m_page[key] = m_page[key] + page
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
if !merged
|
69
|
+
merged_files['pages'] << pages
|
70
|
+
end
|
71
|
+
end
|
72
|
+
merged_files
|
73
|
+
else
|
74
|
+
load_yml(area.present? ? "/#{area}/bhf" : nil)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def load_yml(suffix = nil)
|
79
|
+
YAML::load(IO.read("config/bhf#{suffix}.yml"))
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bhf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Pawlik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4
|
19
|
+
version: '4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4
|
26
|
+
version: '4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: turbolinks
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,8 +174,6 @@ files:
|
|
174
174
|
- app/assets/images/bhf/wmd-buttons.png
|
175
175
|
- app/assets/images/logo_bhf.svg
|
176
176
|
- app/assets/javascripts/bhf/application.js
|
177
|
-
- app/assets/javascripts/bhf/classes/AjaxEdit.js
|
178
|
-
- app/assets/javascripts/bhf/classes/AjaxEditStack.js
|
179
177
|
- app/assets/javascripts/bhf/classes/Ajaxify.js
|
180
178
|
- app/assets/javascripts/bhf/classes/ArrayFields.js
|
181
179
|
- app/assets/javascripts/bhf/classes/FormHelper.js
|
@@ -187,6 +185,8 @@ files:
|
|
187
185
|
- app/assets/javascripts/bhf/classes/Picker_Attach.js
|
188
186
|
- app/assets/javascripts/bhf/classes/Picker_Date.js
|
189
187
|
- app/assets/javascripts/bhf/classes/PlatformHelper.js
|
188
|
+
- app/assets/javascripts/bhf/classes/QuickEdit.js
|
189
|
+
- app/assets/javascripts/bhf/classes/QuickEditStack.js
|
190
190
|
- app/assets/javascripts/bhf/classes/Setlatlng.js
|
191
191
|
- app/assets/javascripts/bhf/classes/showdown.js
|
192
192
|
- app/assets/javascripts/bhf/classes/wmd.js
|
@@ -212,34 +212,31 @@ files:
|
|
212
212
|
- app/views/bhf/entries/_form.haml
|
213
213
|
- app/views/bhf/entries/_validation_errors.haml
|
214
214
|
- app/views/bhf/entries/edit.haml
|
215
|
-
- app/views/bhf/entries/form/belongs_to/_account_scope.haml
|
216
|
-
- app/views/bhf/entries/form/belongs_to/_radio.haml
|
217
|
-
- app/views/bhf/entries/form/belongs_to/_select.haml
|
218
|
-
- app/views/bhf/entries/form/belongs_to/_static.haml
|
219
|
-
- app/views/bhf/entries/form/column/_array.haml
|
220
|
-
- app/views/bhf/entries/form/column/_boolean.haml
|
221
|
-
- app/views/bhf/entries/form/column/_date.haml
|
222
|
-
- app/views/bhf/entries/form/column/_hash.haml
|
223
|
-
- app/views/bhf/entries/form/column/_mappin.haml
|
224
|
-
- app/views/bhf/entries/form/column/_markdown.haml
|
225
|
-
- app/views/bhf/entries/form/column/_multiple_fields.haml
|
226
|
-
- app/views/bhf/entries/form/column/_number.haml
|
227
|
-
- app/views/bhf/entries/form/column/_paperclip.haml
|
228
|
-
- app/views/bhf/entries/form/column/_password.haml
|
229
|
-
- app/views/bhf/entries/form/column/_static.haml
|
230
|
-
- app/views/bhf/entries/form/column/_string.haml
|
231
|
-
- app/views/bhf/entries/form/column/_text.haml
|
232
|
-
- app/views/bhf/entries/form/column/_wysiwyg.haml
|
233
|
-
- app/views/bhf/entries/form/embeds_many/_static.haml
|
234
|
-
- app/views/bhf/entries/form/embeds_one/_static.haml
|
235
|
-
- app/views/bhf/entries/form/has_and_belongs_to_many/_account_scope.haml
|
236
|
-
- app/views/bhf/entries/form/has_and_belongs_to_many/_check_box.haml
|
237
|
-
- app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml
|
238
|
-
- app/views/bhf/entries/form/has_many/_static.haml
|
239
|
-
- app/views/bhf/entries/form/has_one/_account_scope.haml
|
240
|
-
- app/views/bhf/entries/form/has_one/_static.haml
|
241
215
|
- app/views/bhf/entries/new.haml
|
242
216
|
- app/views/bhf/entries/show.haml
|
217
|
+
- app/views/bhf/form/belongs_to/_radio.haml
|
218
|
+
- app/views/bhf/form/belongs_to/_select.haml
|
219
|
+
- app/views/bhf/form/belongs_to/_static.haml
|
220
|
+
- app/views/bhf/form/column/_array.haml
|
221
|
+
- app/views/bhf/form/column/_boolean.haml
|
222
|
+
- app/views/bhf/form/column/_date.haml
|
223
|
+
- app/views/bhf/form/column/_hash.haml
|
224
|
+
- app/views/bhf/form/column/_mappin.haml
|
225
|
+
- app/views/bhf/form/column/_markdown.haml
|
226
|
+
- app/views/bhf/form/column/_multiple_fields.haml
|
227
|
+
- app/views/bhf/form/column/_number.haml
|
228
|
+
- app/views/bhf/form/column/_paperclip.haml
|
229
|
+
- app/views/bhf/form/column/_password.haml
|
230
|
+
- app/views/bhf/form/column/_static.haml
|
231
|
+
- app/views/bhf/form/column/_string.haml
|
232
|
+
- app/views/bhf/form/column/_text.haml
|
233
|
+
- app/views/bhf/form/column/_wysiwyg.haml
|
234
|
+
- app/views/bhf/form/embeds_many/_static.haml
|
235
|
+
- app/views/bhf/form/embeds_one/_static.haml
|
236
|
+
- app/views/bhf/form/has_and_belongs_to_many/_check_box.haml
|
237
|
+
- app/views/bhf/form/has_and_belongs_to_many/_static.haml
|
238
|
+
- app/views/bhf/form/has_many/_static.haml
|
239
|
+
- app/views/bhf/form/has_one/_static.haml
|
243
240
|
- app/views/bhf/helper/_definition_item.haml
|
244
241
|
- app/views/bhf/helper/_field_errors.haml
|
245
242
|
- app/views/bhf/helper/_flash.haml
|
@@ -249,25 +246,25 @@ files:
|
|
249
246
|
- app/views/bhf/helper/_reflection_node.haml
|
250
247
|
- app/views/bhf/pages/_platform.haml
|
251
248
|
- app/views/bhf/pages/_search.haml
|
252
|
-
- app/views/bhf/pages/macro/belongs_to/_default.haml
|
253
|
-
- app/views/bhf/pages/macro/column/_array.haml
|
254
|
-
- app/views/bhf/pages/macro/column/_boolean.haml
|
255
|
-
- app/views/bhf/pages/macro/column/_date.haml
|
256
|
-
- app/views/bhf/pages/macro/column/_extern_link.haml
|
257
|
-
- app/views/bhf/pages/macro/column/_file.haml
|
258
|
-
- app/views/bhf/pages/macro/column/_hash.haml
|
259
|
-
- app/views/bhf/pages/macro/column/_image.haml
|
260
|
-
- app/views/bhf/pages/macro/column/_number.haml
|
261
|
-
- app/views/bhf/pages/macro/column/_paperclip.haml
|
262
|
-
- app/views/bhf/pages/macro/column/_primary_key.haml
|
263
|
-
- app/views/bhf/pages/macro/column/_string.haml
|
264
|
-
- app/views/bhf/pages/macro/column/_text.haml
|
265
|
-
- app/views/bhf/pages/macro/embeds_many/_default.haml
|
266
|
-
- app/views/bhf/pages/macro/embeds_one/_default.haml
|
267
|
-
- app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml
|
268
|
-
- app/views/bhf/pages/macro/has_many/_default.haml
|
269
|
-
- app/views/bhf/pages/macro/has_one/_default.haml
|
270
249
|
- app/views/bhf/pages/show.haml
|
250
|
+
- app/views/bhf/table/belongs_to/_default.haml
|
251
|
+
- app/views/bhf/table/column/_array.haml
|
252
|
+
- app/views/bhf/table/column/_boolean.haml
|
253
|
+
- app/views/bhf/table/column/_date.haml
|
254
|
+
- app/views/bhf/table/column/_extern_link.haml
|
255
|
+
- app/views/bhf/table/column/_file.haml
|
256
|
+
- app/views/bhf/table/column/_hash.haml
|
257
|
+
- app/views/bhf/table/column/_image.haml
|
258
|
+
- app/views/bhf/table/column/_number.haml
|
259
|
+
- app/views/bhf/table/column/_paperclip.haml
|
260
|
+
- app/views/bhf/table/column/_primary_key.haml
|
261
|
+
- app/views/bhf/table/column/_string.haml
|
262
|
+
- app/views/bhf/table/column/_text.haml
|
263
|
+
- app/views/bhf/table/embeds_many/_default.haml
|
264
|
+
- app/views/bhf/table/embeds_one/_default.haml
|
265
|
+
- app/views/bhf/table/has_and_belongs_to_many/_default.haml
|
266
|
+
- app/views/bhf/table/has_many/_default.haml
|
267
|
+
- app/views/bhf/table/has_one/_default.haml
|
271
268
|
- app/views/kaminari/bhf/_gap.html.haml
|
272
269
|
- app/views/kaminari/bhf/_next_page.html.haml
|
273
270
|
- app/views/kaminari/bhf/_page.html.haml
|
@@ -280,14 +277,18 @@ files:
|
|
280
277
|
- config/locales/en.yml
|
281
278
|
- config/routes.rb
|
282
279
|
- lib/bhf.rb
|
283
|
-
- lib/bhf/
|
284
|
-
- lib/bhf/
|
285
|
-
- lib/bhf/
|
280
|
+
- lib/bhf/action_view/form_builder.rb
|
281
|
+
- lib/bhf/action_view/form_options.rb
|
282
|
+
- lib/bhf/active_record/base.rb
|
286
283
|
- lib/bhf/mongoid/document.rb
|
287
|
-
- lib/bhf/
|
288
|
-
- lib/bhf/platform.rb
|
289
|
-
- lib/bhf/
|
290
|
-
- lib/bhf/
|
284
|
+
- lib/bhf/platform/attribute/abstract.rb
|
285
|
+
- lib/bhf/platform/attribute/column.rb
|
286
|
+
- lib/bhf/platform/attribute/reflection.rb
|
287
|
+
- lib/bhf/platform/base.rb
|
288
|
+
- lib/bhf/platform/pagination.rb
|
289
|
+
- lib/bhf/settings/base.rb
|
290
|
+
- lib/bhf/settings/platform.rb
|
291
|
+
- lib/bhf/settings/yaml_parser.rb
|
291
292
|
- lib/rails/generators/bhf/templates/initializer.rb
|
292
293
|
- test/database.yml
|
293
294
|
- test/test_helper.rb
|
@@ -1,8 +0,0 @@
|
|
1
|
-
- data_source ||= field.reflection.klass.all
|
2
|
-
= reflection_node f, field do
|
3
|
-
- fk = field.reflection.foreign_key
|
4
|
-
%ul
|
5
|
-
- data_source.each do |obj|
|
6
|
-
%li
|
7
|
-
= f.radio_button fk, obj.id, id: "belongs_to_#{fk}_#{obj.id}"
|
8
|
-
= label_tag "belongs_to_#{fk}_#{obj.id}", obj.to_bhf_s
|
@@ -1,7 +0,0 @@
|
|
1
|
-
- data_source ||= field.reflection.klass.all
|
2
|
-
- fk = field.reflection.foreign_key
|
3
|
-
.node
|
4
|
-
.label= f.label fk, reflection_title(f, field)
|
5
|
-
.input
|
6
|
-
= f.select fk, options_from_collection_for_select(data_source, :id, :to_bhf_s, f.object.send(fk)), include_blank: true
|
7
|
-
= render partial: 'bhf/helper/field_errors', locals: {f: f, field: fk}
|
@@ -1 +0,0 @@
|
|
1
|
-
= render partial: 'bhf/entries/form/has_one/static', locals: {ref_object: f.object.send(field.reflection.name), field: field, f: f}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
= reflection_node f, field do
|
2
|
-
- ref_objects = f.object.send(field.reflection.name)
|
3
|
-
%p.empty{class: ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', count: 2
|
4
|
-
%ul.relation{class: field.macro}
|
5
|
-
- ref_objects.each do |ref_object|
|
6
|
-
%li
|
7
|
-
= link_to_if field.link && ! field.link.hide_edit, ref_object.to_bhf_s, edit_entry_embed_path(field.link || 0, f.object, ref_object), class: :quick_edit
|
8
|
-
- if field.link && ! field.link.hide_delete
|
9
|
-
= link_to '×'.html_safe, entry_embed_path(field.link, f.object, ref_object), method: :delete, class: :delete, remote: true, data: {confirm: t('bhf.helpers.promts.confirm')}
|
10
|
-
|
11
|
-
- if field.link && ! field.link.hide_create
|
12
|
-
= link_to '+', new_entry_embed_path(field.link, f.object), class: 'add_field quick_edit'
|
@@ -1,12 +0,0 @@
|
|
1
|
-
= reflection_node f, field do
|
2
|
-
- ref_object = f.object.send(field.reflection.name)
|
3
|
-
%p.empty{class: ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', count: 1
|
4
|
-
%ul.relation{class: field.macro}
|
5
|
-
%li
|
6
|
-
- if ref_object
|
7
|
-
= link_to_if field.link && ! field.link.hide_edit, ref_object.to_bhf_s, edit_entry_embed_path(field.link || 0, f.object, ref_object), class: :quick_edit
|
8
|
-
- if field.link && ! field.link.hide_delete
|
9
|
-
= link_to '×'.html_safe, entry_embed_path(field.link, f.object, ref_object), method: :delete, class: :delete, remote: true, data: {confirm: t('bhf.helpers.promts.confirm')}
|
10
|
-
|
11
|
-
- if field.link && ! field.link.hide_create
|
12
|
-
= link_to '+', new_entry_embed_path(field.link, f.object), class: "add_field quick_edit #{('hide' if ref_object)}"
|
@@ -1 +0,0 @@
|
|
1
|
-
= render partial: 'bhf/entries/form/has_many/static', locals: {ref_objects: f.object.send(field.reflection.name), field: field, f: f}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
= reflection_node f, field do
|
2
|
-
- ref_objects ||= f.object.send(field.reflection.name)
|
3
|
-
%p.empty{class: ('hide' unless ref_objects.blank?)}= t 'bhf.helpers.entry.empty', count: 2
|
4
|
-
%ul.relation{class: field.macro}
|
5
|
-
- ref_objects.each do |ref_object|
|
6
|
-
%li
|
7
|
-
= link_to_if field.link && ! field.link.hide_edit, ref_object.to_bhf_s, edit_entry_path(field.link || 0, ref_object), class: :quick_edit
|
8
|
-
- if field.link && ! field.link.hide_delete
|
9
|
-
= link_to '×'.html_safe, entry_path(field.link, ref_object), method: :delete, class: :delete, remote: true, data: {confirm: t('bhf.helpers.promts.confirm')}
|
10
|
-
|
11
|
-
- if field.link && ! field.link.hide_create
|
12
|
-
= link_to '+', new_entry_path(field.link), class: 'add_field quick_edit'
|
@@ -1,9 +0,0 @@
|
|
1
|
-
= reflection_node f, field do
|
2
|
-
- ref_object ||= f.object.send(field.reflection.name)
|
3
|
-
%p.empty{class: ('hide' if ref_object)}= t 'bhf.helpers.entry.empty', count: 1
|
4
|
-
%ul.relation{class: field.macro}
|
5
|
-
- if ref_object
|
6
|
-
%li= link_to_if field.link && ! field.link.hide_edit, ref_object.to_bhf_s, edit_entry_path(field.link || 0, ref_object), class: :quick_edit
|
7
|
-
|
8
|
-
-# if field.link
|
9
|
-
= link_to '+', new_entry_path(field.link), class: 'add_field quick_edit'
|