bhf 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +1 -1
  4. data/VERSION +1 -1
  5. data/app/assets/images/bhf/pictos.png +0 -0
  6. data/app/assets/images/bhf/pictos_2x.png +0 -0
  7. data/app/assets/javascripts/bhf/application.js +153 -116
  8. data/app/assets/javascripts/bhf/classes/ArrayFields.js +1 -1
  9. data/app/assets/javascripts/bhf/classes/MultipleFields.js +2 -2
  10. data/app/assets/javascripts/bhf/classes/PlatformHelper.js +6 -11
  11. data/app/assets/javascripts/bhf/classes/{AjaxEdit.js → QuickEdit.js} +9 -9
  12. data/app/assets/javascripts/bhf/classes/{AjaxEditStack.js → QuickEditStack.js} +4 -20
  13. data/app/assets/javascripts/bhf/mootools-core-1.5.0-full-compat.js +1 -0
  14. data/app/assets/javascripts/bhf/mootools_ujs.js +11 -11
  15. data/app/assets/stylesheets/bhf/application.css.sass +86 -48
  16. data/app/controllers/bhf/application_controller.rb +8 -4
  17. data/app/controllers/bhf/embed_entries_controller.rb +2 -6
  18. data/app/controllers/bhf/entries_controller.rb +13 -16
  19. data/app/controllers/bhf/pages_controller.rb +14 -13
  20. data/app/helpers/bhf/application_helper.rb +6 -6
  21. data/app/helpers/bhf/entries_helper.rb +4 -2
  22. data/app/helpers/bhf/pages_helper.rb +0 -4
  23. data/app/views/bhf/entries/_form.haml +7 -4
  24. data/app/views/bhf/entries/show.haml +3 -4
  25. data/app/views/bhf/form/belongs_to/_radio.haml +28 -0
  26. data/app/views/bhf/form/belongs_to/_select.haml +21 -0
  27. data/app/views/bhf/form/belongs_to/_static.haml +1 -0
  28. data/app/views/bhf/{entries/form → form}/column/_array.haml +0 -0
  29. data/app/views/bhf/{entries/form → form}/column/_boolean.haml +0 -0
  30. data/app/views/bhf/{entries/form → form}/column/_date.haml +0 -0
  31. data/app/views/bhf/{entries/form → form}/column/_hash.haml +0 -0
  32. data/app/views/bhf/{entries/form → form}/column/_mappin.haml +0 -0
  33. data/app/views/bhf/{entries/form → form}/column/_markdown.haml +0 -0
  34. data/app/views/bhf/{entries/form → form}/column/_multiple_fields.haml +0 -0
  35. data/app/views/bhf/{entries/form → form}/column/_number.haml +0 -0
  36. data/app/views/bhf/{entries/form → form}/column/_paperclip.haml +0 -0
  37. data/app/views/bhf/{entries/form → form}/column/_password.haml +0 -0
  38. data/app/views/bhf/{entries/form → form}/column/_static.haml +0 -0
  39. data/app/views/bhf/{entries/form → form}/column/_string.haml +0 -0
  40. data/app/views/bhf/{entries/form → form}/column/_text.haml +0 -0
  41. data/app/views/bhf/{entries/form → form}/column/_wysiwyg.haml +0 -0
  42. data/app/views/bhf/form/embeds_many/_static.haml +26 -0
  43. data/app/views/bhf/form/embeds_one/_static.haml +2 -0
  44. data/app/views/bhf/form/has_and_belongs_to_many/_check_box.haml +22 -0
  45. data/app/views/bhf/form/has_and_belongs_to_many/_static.haml +1 -0
  46. data/app/views/bhf/form/has_many/_static.haml +26 -0
  47. data/app/views/bhf/form/has_one/_static.haml +2 -0
  48. data/app/views/bhf/helper/_definition_item.haml +1 -1
  49. data/app/views/bhf/helper/_frontend_edit.haml +1 -1
  50. data/app/views/bhf/pages/_platform.haml +39 -16
  51. data/app/views/bhf/{pages/macro → table}/belongs_to/_default.haml +1 -1
  52. data/app/views/bhf/table/column/_array.haml +1 -0
  53. data/app/views/bhf/table/column/_boolean.haml +1 -0
  54. data/app/views/bhf/table/column/_date.haml +1 -0
  55. data/app/views/bhf/table/column/_extern_link.haml +2 -0
  56. data/app/views/bhf/table/column/_file.haml +1 -0
  57. data/app/views/bhf/table/column/_hash.haml +1 -0
  58. data/app/views/bhf/table/column/_image.haml +1 -0
  59. data/app/views/bhf/table/column/_number.haml +1 -0
  60. data/app/views/bhf/table/column/_paperclip.haml +5 -0
  61. data/app/views/bhf/table/column/_primary_key.haml +1 -0
  62. data/app/views/bhf/table/column/_string.haml +1 -0
  63. data/app/views/bhf/table/column/_text.haml +1 -0
  64. data/app/views/bhf/table/embeds_many/_default.haml +1 -0
  65. data/app/views/bhf/table/embeds_one/_default.haml +1 -0
  66. data/app/views/bhf/table/has_and_belongs_to_many/_default.haml +1 -0
  67. data/app/views/bhf/table/has_many/_default.haml +2 -0
  68. data/app/views/bhf/{pages/macro → table}/has_one/_default.haml +1 -1
  69. data/bhf.gemspec +60 -59
  70. data/config/locales/de.yml +8 -8
  71. data/config/locales/en.yml +7 -7
  72. data/lib/bhf.rb +26 -21
  73. data/lib/bhf/action_view/form_builder.rb +36 -0
  74. data/lib/bhf/action_view/form_options.rb +30 -0
  75. data/lib/bhf/active_record/base.rb +58 -0
  76. data/lib/bhf/mongoid/document.rb +135 -137
  77. data/lib/bhf/platform/attribute/abstract.rb +52 -0
  78. data/lib/bhf/platform/attribute/column.rb +78 -0
  79. data/lib/bhf/platform/attribute/reflection.rb +68 -0
  80. data/lib/bhf/platform/base.rb +333 -0
  81. data/lib/bhf/{pagination.rb → platform/pagination.rb} +1 -1
  82. data/lib/bhf/{settings.rb → settings/base.rb} +14 -11
  83. data/lib/bhf/settings/platform.rb +20 -0
  84. data/lib/bhf/settings/yaml_parser.rb +84 -0
  85. data/lib/rails/generators/bhf/templates/initializer.rb +1 -1
  86. metadata +58 -57
  87. data/app/views/bhf/entries/form/belongs_to/_account_scope.haml +0 -2
  88. data/app/views/bhf/entries/form/belongs_to/_radio.haml +0 -8
  89. data/app/views/bhf/entries/form/belongs_to/_select.haml +0 -7
  90. data/app/views/bhf/entries/form/belongs_to/_static.haml +0 -1
  91. data/app/views/bhf/entries/form/embeds_many/_static.haml +0 -12
  92. data/app/views/bhf/entries/form/embeds_one/_static.haml +0 -12
  93. data/app/views/bhf/entries/form/has_and_belongs_to_many/_account_scope.haml +0 -2
  94. data/app/views/bhf/entries/form/has_and_belongs_to_many/_check_box.haml +0 -5
  95. data/app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml +0 -1
  96. data/app/views/bhf/entries/form/has_many/_static.haml +0 -12
  97. data/app/views/bhf/entries/form/has_one/_account_scope.haml +0 -2
  98. data/app/views/bhf/entries/form/has_one/_static.haml +0 -9
  99. data/app/views/bhf/pages/macro/column/_array.haml +0 -1
  100. data/app/views/bhf/pages/macro/column/_boolean.haml +0 -1
  101. data/app/views/bhf/pages/macro/column/_date.haml +0 -1
  102. data/app/views/bhf/pages/macro/column/_extern_link.haml +0 -2
  103. data/app/views/bhf/pages/macro/column/_file.haml +0 -1
  104. data/app/views/bhf/pages/macro/column/_hash.haml +0 -1
  105. data/app/views/bhf/pages/macro/column/_image.haml +0 -2
  106. data/app/views/bhf/pages/macro/column/_number.haml +0 -1
  107. data/app/views/bhf/pages/macro/column/_paperclip.haml +0 -6
  108. data/app/views/bhf/pages/macro/column/_primary_key.haml +0 -1
  109. data/app/views/bhf/pages/macro/column/_string.haml +0 -1
  110. data/app/views/bhf/pages/macro/column/_text.haml +0 -1
  111. data/app/views/bhf/pages/macro/embeds_many/_default.haml +0 -1
  112. data/app/views/bhf/pages/macro/embeds_one/_default.haml +0 -1
  113. data/app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml +0 -1
  114. data/app/views/bhf/pages/macro/has_many/_default.haml +0 -2
  115. data/lib/bhf/active_record/active_record.rb +0 -59
  116. data/lib/bhf/data.rb +0 -169
  117. data/lib/bhf/form.rb +0 -36
  118. data/lib/bhf/platform.rb +0 -308
  119. data/lib/bhf/settings_parser.rb +0 -84
@@ -10,7 +10,7 @@ Kaminari::Helpers::Tag.class_eval do
10
10
  end
11
11
  # TODO: monitor https://github.com/amatsuda/kaminari/issues/542#issuecomment-40294388
12
12
 
13
- module Bhf
13
+ module Bhf::Platform
14
14
 
15
15
  class Pagination
16
16
 
@@ -1,9 +1,12 @@
1
- module Bhf
1
+ module Bhf::Settings
2
2
 
3
- class Settings
3
+ class Base
4
+
5
+ attr_accessor :user
4
6
 
5
- def initialize(options)
6
- @options = options
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
- return @pages if @pages
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
- @options['pages'].each do |page|
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 find_platform(platform_name, current_account = nil, config = nil)
44
+ def find_platform_settings(platform_name)
43
45
  pages.each do |page|
44
- content_for_page(page).each do |platform|
45
- bhf_platform = Bhf::Platform.new(platform, page, config == nil ? self : config, current_account)
46
- return bhf_platform if bhf_platform.name.to_s == platform_name.to_s
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
@@ -1,7 +1,7 @@
1
1
  Bhf.configure do |config|
2
2
  # config.css << 'bhf'
3
3
  # config.js << 'bhf'
4
- # config.abstract_config << 'abstract'
4
+ # config.abstract_settings << 'abstract'
5
5
 
6
6
  # config.on_login_fail = :root_url
7
7
  # config.logout_path = :logout_path
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.0
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-06-11 00:00:00.000000000 Z
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.1.1
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.1.1
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/active_record/active_record.rb
284
- - lib/bhf/data.rb
285
- - lib/bhf/form.rb
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/pagination.rb
288
- - lib/bhf/platform.rb
289
- - lib/bhf/settings.rb
290
- - lib/bhf/settings_parser.rb
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,2 +0,0 @@
1
- - data_source = current_account.send(field.reflection.name.to_s.pluralize)
2
- = render partial: 'bhf/entries/form/belongs_to/select', locals: {data_source: data_source, field: field, f: f}
@@ -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 '&times;'.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 '&times;'.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,2 +0,0 @@
1
- - data_source = current_account.send(field.reflection.name.to_s.pluralize)
2
- = render partial: 'bhf/entries/form/has_and_belongs_to_many/check_box', locals: {data_source: data_source, field: field, f: f}
@@ -1,5 +0,0 @@
1
- - data_source ||= field.reflection.klass.all
2
- = reflection_node f, field do
3
- %ul
4
- - data_source.each do |obj|
5
- %li= f.many_to_many_check_box obj, field.reflection.name, params
@@ -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 '&times;'.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,2 +0,0 @@
1
- - data_source = current_account.send(field.reflection.name)
2
- = render partial: 'bhf/entries/form/has_one/static', locals: {ref_object: ref_object, field: field, f: f}
@@ -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'