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,4 +1,4 @@
|
|
1
|
-
- link_title = t('bhf.helpers.entry.edit',
|
1
|
+
- link_title = t('bhf.helpers.entry.edit', platform_title: object.to_bhf_s)
|
2
2
|
|
3
3
|
= link_to bhf.edit_entry_url(platform_name, object, {return_to: request.original_url}.merge(area ? {bhf_area: area} : {})), class: 'bhf_edit', data: {:'no-turbolink' => true}, title: link_title do
|
4
4
|
= block ? block : link_title
|
@@ -4,7 +4,7 @@
|
|
4
4
|
- referral_id = (referral_entry[:platform] == platform.name && referral_entry[:id])
|
5
5
|
|
6
6
|
- if platform.custom_partial
|
7
|
-
= render partial: "bhf/
|
7
|
+
= render partial: "bhf/platform/#{platform.custom_partial}", locals: {platform: platform, referral_id: referral_id}
|
8
8
|
- else
|
9
9
|
%table.data_table{id: "#{platform.name}_platform", class: (platform.custom_columns? ? :custom_columns : :default_columns)}
|
10
10
|
%caption
|
@@ -20,11 +20,8 @@
|
|
20
20
|
- if platform.sortable
|
21
21
|
%th.drag
|
22
22
|
- platform.columns.each do |column|
|
23
|
-
|
24
|
-
|
25
|
-
- column_name = platform.model.human_attribute_name(column.name)
|
26
|
-
- can_sort = platform.model.bhf_attribute_method?(db_column_name)
|
27
|
-
= link_to_if can_sort, column_name, current_order_path(db_column_name, platform.name)
|
23
|
+
%th{class: "#{column.macro} #{column.display_type} #{order_class(column.db_name, platform.name)}"}
|
24
|
+
= link_to_if column.reorderble, column.title, current_order_path(column.db_name, platform.name)
|
28
25
|
%th.action
|
29
26
|
|
30
27
|
%tfoot
|
@@ -32,25 +29,30 @@
|
|
32
29
|
%td{colspan: platform.columns_count}
|
33
30
|
= platform.pagination.create(platform) unless platform.sortable
|
34
31
|
|
35
|
-
%tbody{class: (
|
32
|
+
%tbody.quick_edit_block{class: ('js_sortable' if platform.sortable), data: {sort_url: sort_entries_path(platform.name)}}
|
36
33
|
- if platform.objects.any?
|
37
34
|
- platform.objects.each do |object|
|
38
35
|
- edit_link = edit_entry_path(platform.name, object)
|
39
36
|
- custom_link = send(platform.custom_link, platform.name, object) if platform.custom_link
|
40
|
-
%tr{id: "#{object.id}_#{platform.name}", class: ('animate live_edit initial_referral' if referral_id == object.id)}
|
37
|
+
%tr.quick_edit_entry{id: "#{object.id}_#{platform.name}", class: ('animate live_edit initial_referral' if referral_id == object.id)}
|
41
38
|
- if platform.sortable
|
42
39
|
%td.drag
|
43
40
|
%span.handle.icon
|
44
41
|
- platform.columns.each do |column|
|
45
|
-
- css_classes = [column.
|
46
|
-
-
|
42
|
+
- css_classes = [column.macro, column.display_type]
|
43
|
+
- column_value = object.send(column.name)
|
44
|
+
- if column.display_type == :primary_key && column_value.to_s.length > 6
|
47
45
|
- css_classes << :key_long
|
48
|
-
%td{class: css_classes
|
49
|
-
-
|
50
|
-
- ' '
|
46
|
+
%td{class: css_classes}
|
47
|
+
- value = if column.display_type != :boolean && column_value.blank?
|
48
|
+
- ' '.html_safe
|
51
49
|
- else
|
52
|
-
-
|
53
|
-
|
50
|
+
- if column.display_type == :string
|
51
|
+
- column_value
|
52
|
+
- else
|
53
|
+
- # Haml::Engine.new(File.read(File.expand_path File.dirname(__FILE__)+"/../table/#{column.macro}/_#{column.display_type}.haml")).render(OpenStruct.new({column_value: column_value, object: object}))
|
54
|
+
- render(partial: "bhf/table/#{column.macro}/#{column.display_type}", locals: {column_value: column_value, object: object})
|
55
|
+
= link_to value, (platform.custom_link ? custom_link : edit_link), class: ('quick_edit' unless platform.custom_link)
|
54
56
|
|
55
57
|
%td.action{class: ('wider' if platform.show_duplicate && !platform.hide_edit && !platform.hide_delete)}
|
56
58
|
- if platform.show_duplicate
|
@@ -59,10 +61,31 @@
|
|
59
61
|
- unless platform.hide_edit
|
60
62
|
= link_to edit_t(platform), edit_link, class: 'icon edit'
|
61
63
|
- unless platform.hide_delete
|
62
|
-
= link_to delete_t(platform), entry_path(platform.name, object), method: :delete, remote: true, class: 'icon delete', data: {confirm: t('bhf.helpers.promts.confirm')}
|
64
|
+
= link_to delete_t(platform), entry_path(platform.name, object), method: :delete, remote: true, class: 'icon delete js_delete', data: {confirm: t('bhf.helpers.promts.confirm', platform_title: platform.title_singular)}
|
63
65
|
- else
|
64
66
|
%td.no_entries{colspan: platform.columns_count}
|
65
67
|
= t 'bhf.pagination.info', name_zero: platform.title, count: 0
|
66
68
|
- unless platform.hide_create
|
67
69
|
= link_to new_t(platform), new_entry_path(platform.name)
|
68
70
|
|
71
|
+
|
72
|
+
%template.quick_edit_template{type: 'text/template'}
|
73
|
+
%tr.quick_edit_entry{id: "{object_id}_#{platform.name}"}
|
74
|
+
- edit_link = edit_entry_path(platform.name, '{object_id}')
|
75
|
+
- if platform.sortable
|
76
|
+
%td.drag
|
77
|
+
%span.handle.icon
|
78
|
+
- platform.columns.each do |column|
|
79
|
+
- css_classes = [column.macro, column.display_type]
|
80
|
+
- custom_link = send(platform.custom_link, platform.name, '{object_id}') if platform.custom_link
|
81
|
+
%td{class: css_classes}
|
82
|
+
= link_to "{#{column.name}}", (platform.custom_link ? custom_link : edit_link), class: ('quick_edit' unless platform.custom_link)
|
83
|
+
|
84
|
+
%td.action{class: ('wider' if platform.show_duplicate && !platform.hide_edit && !platform.hide_delete)}
|
85
|
+
- if platform.show_duplicate
|
86
|
+
- dt = duplicate_t(platform)
|
87
|
+
= link_to dt, duplicate_entry_path(platform.name, '{object_id}'), class: 'icon duplicate', method: :post, title: dt
|
88
|
+
- unless platform.hide_edit
|
89
|
+
= link_to edit_t(platform), edit_link, class: 'icon edit'
|
90
|
+
- unless platform.hide_delete
|
91
|
+
= link_to delete_t(platform), entry_path(platform.name, '{object_id}'), method: :delete, remote: true, class: 'icon delete js_delete', data: {confirm: t('bhf.helpers.promts.confirm', platform_title: platform.title_singular)}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
- ref_object =
|
1
|
+
- ref_object = column_value
|
2
2
|
= ref_object.blank? ? t('bhf.helpers.entry.empty', count: 1) : ref_object.to_bhf_s
|
@@ -0,0 +1 @@
|
|
1
|
+
= column_value[0..5].join(', ')
|
@@ -0,0 +1 @@
|
|
1
|
+
= t("bhf.helpers.boolean.#{!!column_value}")
|
@@ -0,0 +1 @@
|
|
1
|
+
= l(column_value, format: :short) if column_value
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to_if column_value, column_value, column_value
|
@@ -0,0 +1 @@
|
|
1
|
+
= column_value.inspect
|
@@ -0,0 +1 @@
|
|
1
|
+
= image_tag column_value, alt: column_value, class: 'preview_image'
|
@@ -0,0 +1 @@
|
|
1
|
+
= column_value
|
@@ -0,0 +1 @@
|
|
1
|
+
%strong= column_value
|
@@ -0,0 +1 @@
|
|
1
|
+
= column_value
|
@@ -0,0 +1 @@
|
|
1
|
+
= sanitize(column_value.to_s, tags: %w(strong em))
|
@@ -0,0 +1 @@
|
|
1
|
+
= render partial: 'bhf/table/has_many/default', locals: {ref_objects: column_value}
|
@@ -0,0 +1 @@
|
|
1
|
+
= render partial: 'bhf/table/has_one/default', locals: {ref_object: column_value}
|
@@ -0,0 +1 @@
|
|
1
|
+
= render partial: 'bhf/table/has_many/default', locals: {ref_objects: column_value}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
- ref_object ||=
|
1
|
+
- ref_object ||= column_value
|
2
2
|
= ref_object.blank? ? t('bhf.helpers.entry.empty', count: 1) : ref_object.to_bhf_s
|
data/bhf.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: bhf 0.8.
|
5
|
+
# stub: bhf 0.8.2 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bhf"
|
9
|
-
s.version = "0.8.
|
9
|
+
s.version = "0.8.2"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
13
13
|
s.authors = ["Anton Pawlik"]
|
14
|
-
s.date = "2014-
|
14
|
+
s.date = "2014-07-02"
|
15
15
|
s.description = "Gets you there on time"
|
16
16
|
s.email = "anton.pawlik@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
@@ -35,8 +35,6 @@ Gem::Specification.new do |s|
|
|
35
35
|
"app/assets/images/bhf/wmd-buttons.png",
|
36
36
|
"app/assets/images/logo_bhf.svg",
|
37
37
|
"app/assets/javascripts/bhf/application.js",
|
38
|
-
"app/assets/javascripts/bhf/classes/AjaxEdit.js",
|
39
|
-
"app/assets/javascripts/bhf/classes/AjaxEditStack.js",
|
40
38
|
"app/assets/javascripts/bhf/classes/Ajaxify.js",
|
41
39
|
"app/assets/javascripts/bhf/classes/ArrayFields.js",
|
42
40
|
"app/assets/javascripts/bhf/classes/FormHelper.js",
|
@@ -48,6 +46,8 @@ Gem::Specification.new do |s|
|
|
48
46
|
"app/assets/javascripts/bhf/classes/Picker_Attach.js",
|
49
47
|
"app/assets/javascripts/bhf/classes/Picker_Date.js",
|
50
48
|
"app/assets/javascripts/bhf/classes/PlatformHelper.js",
|
49
|
+
"app/assets/javascripts/bhf/classes/QuickEdit.js",
|
50
|
+
"app/assets/javascripts/bhf/classes/QuickEditStack.js",
|
51
51
|
"app/assets/javascripts/bhf/classes/Setlatlng.js",
|
52
52
|
"app/assets/javascripts/bhf/classes/showdown.js",
|
53
53
|
"app/assets/javascripts/bhf/classes/wmd.js",
|
@@ -73,34 +73,31 @@ Gem::Specification.new do |s|
|
|
73
73
|
"app/views/bhf/entries/_form.haml",
|
74
74
|
"app/views/bhf/entries/_validation_errors.haml",
|
75
75
|
"app/views/bhf/entries/edit.haml",
|
76
|
-
"app/views/bhf/entries/form/belongs_to/_account_scope.haml",
|
77
|
-
"app/views/bhf/entries/form/belongs_to/_radio.haml",
|
78
|
-
"app/views/bhf/entries/form/belongs_to/_select.haml",
|
79
|
-
"app/views/bhf/entries/form/belongs_to/_static.haml",
|
80
|
-
"app/views/bhf/entries/form/column/_array.haml",
|
81
|
-
"app/views/bhf/entries/form/column/_boolean.haml",
|
82
|
-
"app/views/bhf/entries/form/column/_date.haml",
|
83
|
-
"app/views/bhf/entries/form/column/_hash.haml",
|
84
|
-
"app/views/bhf/entries/form/column/_mappin.haml",
|
85
|
-
"app/views/bhf/entries/form/column/_markdown.haml",
|
86
|
-
"app/views/bhf/entries/form/column/_multiple_fields.haml",
|
87
|
-
"app/views/bhf/entries/form/column/_number.haml",
|
88
|
-
"app/views/bhf/entries/form/column/_paperclip.haml",
|
89
|
-
"app/views/bhf/entries/form/column/_password.haml",
|
90
|
-
"app/views/bhf/entries/form/column/_static.haml",
|
91
|
-
"app/views/bhf/entries/form/column/_string.haml",
|
92
|
-
"app/views/bhf/entries/form/column/_text.haml",
|
93
|
-
"app/views/bhf/entries/form/column/_wysiwyg.haml",
|
94
|
-
"app/views/bhf/entries/form/embeds_many/_static.haml",
|
95
|
-
"app/views/bhf/entries/form/embeds_one/_static.haml",
|
96
|
-
"app/views/bhf/entries/form/has_and_belongs_to_many/_account_scope.haml",
|
97
|
-
"app/views/bhf/entries/form/has_and_belongs_to_many/_check_box.haml",
|
98
|
-
"app/views/bhf/entries/form/has_and_belongs_to_many/_static.haml",
|
99
|
-
"app/views/bhf/entries/form/has_many/_static.haml",
|
100
|
-
"app/views/bhf/entries/form/has_one/_account_scope.haml",
|
101
|
-
"app/views/bhf/entries/form/has_one/_static.haml",
|
102
76
|
"app/views/bhf/entries/new.haml",
|
103
77
|
"app/views/bhf/entries/show.haml",
|
78
|
+
"app/views/bhf/form/belongs_to/_radio.haml",
|
79
|
+
"app/views/bhf/form/belongs_to/_select.haml",
|
80
|
+
"app/views/bhf/form/belongs_to/_static.haml",
|
81
|
+
"app/views/bhf/form/column/_array.haml",
|
82
|
+
"app/views/bhf/form/column/_boolean.haml",
|
83
|
+
"app/views/bhf/form/column/_date.haml",
|
84
|
+
"app/views/bhf/form/column/_hash.haml",
|
85
|
+
"app/views/bhf/form/column/_mappin.haml",
|
86
|
+
"app/views/bhf/form/column/_markdown.haml",
|
87
|
+
"app/views/bhf/form/column/_multiple_fields.haml",
|
88
|
+
"app/views/bhf/form/column/_number.haml",
|
89
|
+
"app/views/bhf/form/column/_paperclip.haml",
|
90
|
+
"app/views/bhf/form/column/_password.haml",
|
91
|
+
"app/views/bhf/form/column/_static.haml",
|
92
|
+
"app/views/bhf/form/column/_string.haml",
|
93
|
+
"app/views/bhf/form/column/_text.haml",
|
94
|
+
"app/views/bhf/form/column/_wysiwyg.haml",
|
95
|
+
"app/views/bhf/form/embeds_many/_static.haml",
|
96
|
+
"app/views/bhf/form/embeds_one/_static.haml",
|
97
|
+
"app/views/bhf/form/has_and_belongs_to_many/_check_box.haml",
|
98
|
+
"app/views/bhf/form/has_and_belongs_to_many/_static.haml",
|
99
|
+
"app/views/bhf/form/has_many/_static.haml",
|
100
|
+
"app/views/bhf/form/has_one/_static.haml",
|
104
101
|
"app/views/bhf/helper/_definition_item.haml",
|
105
102
|
"app/views/bhf/helper/_field_errors.haml",
|
106
103
|
"app/views/bhf/helper/_flash.haml",
|
@@ -110,25 +107,25 @@ Gem::Specification.new do |s|
|
|
110
107
|
"app/views/bhf/helper/_reflection_node.haml",
|
111
108
|
"app/views/bhf/pages/_platform.haml",
|
112
109
|
"app/views/bhf/pages/_search.haml",
|
113
|
-
"app/views/bhf/pages/macro/belongs_to/_default.haml",
|
114
|
-
"app/views/bhf/pages/macro/column/_array.haml",
|
115
|
-
"app/views/bhf/pages/macro/column/_boolean.haml",
|
116
|
-
"app/views/bhf/pages/macro/column/_date.haml",
|
117
|
-
"app/views/bhf/pages/macro/column/_extern_link.haml",
|
118
|
-
"app/views/bhf/pages/macro/column/_file.haml",
|
119
|
-
"app/views/bhf/pages/macro/column/_hash.haml",
|
120
|
-
"app/views/bhf/pages/macro/column/_image.haml",
|
121
|
-
"app/views/bhf/pages/macro/column/_number.haml",
|
122
|
-
"app/views/bhf/pages/macro/column/_paperclip.haml",
|
123
|
-
"app/views/bhf/pages/macro/column/_primary_key.haml",
|
124
|
-
"app/views/bhf/pages/macro/column/_string.haml",
|
125
|
-
"app/views/bhf/pages/macro/column/_text.haml",
|
126
|
-
"app/views/bhf/pages/macro/embeds_many/_default.haml",
|
127
|
-
"app/views/bhf/pages/macro/embeds_one/_default.haml",
|
128
|
-
"app/views/bhf/pages/macro/has_and_belongs_to_many/_default.haml",
|
129
|
-
"app/views/bhf/pages/macro/has_many/_default.haml",
|
130
|
-
"app/views/bhf/pages/macro/has_one/_default.haml",
|
131
110
|
"app/views/bhf/pages/show.haml",
|
111
|
+
"app/views/bhf/table/belongs_to/_default.haml",
|
112
|
+
"app/views/bhf/table/column/_array.haml",
|
113
|
+
"app/views/bhf/table/column/_boolean.haml",
|
114
|
+
"app/views/bhf/table/column/_date.haml",
|
115
|
+
"app/views/bhf/table/column/_extern_link.haml",
|
116
|
+
"app/views/bhf/table/column/_file.haml",
|
117
|
+
"app/views/bhf/table/column/_hash.haml",
|
118
|
+
"app/views/bhf/table/column/_image.haml",
|
119
|
+
"app/views/bhf/table/column/_number.haml",
|
120
|
+
"app/views/bhf/table/column/_paperclip.haml",
|
121
|
+
"app/views/bhf/table/column/_primary_key.haml",
|
122
|
+
"app/views/bhf/table/column/_string.haml",
|
123
|
+
"app/views/bhf/table/column/_text.haml",
|
124
|
+
"app/views/bhf/table/embeds_many/_default.haml",
|
125
|
+
"app/views/bhf/table/embeds_one/_default.haml",
|
126
|
+
"app/views/bhf/table/has_and_belongs_to_many/_default.haml",
|
127
|
+
"app/views/bhf/table/has_many/_default.haml",
|
128
|
+
"app/views/bhf/table/has_one/_default.haml",
|
132
129
|
"app/views/kaminari/bhf/_gap.html.haml",
|
133
130
|
"app/views/kaminari/bhf/_next_page.html.haml",
|
134
131
|
"app/views/kaminari/bhf/_page.html.haml",
|
@@ -141,14 +138,18 @@ Gem::Specification.new do |s|
|
|
141
138
|
"config/locales/en.yml",
|
142
139
|
"config/routes.rb",
|
143
140
|
"lib/bhf.rb",
|
144
|
-
"lib/bhf/
|
145
|
-
"lib/bhf/
|
146
|
-
"lib/bhf/
|
141
|
+
"lib/bhf/action_view/form_builder.rb",
|
142
|
+
"lib/bhf/action_view/form_options.rb",
|
143
|
+
"lib/bhf/active_record/base.rb",
|
147
144
|
"lib/bhf/mongoid/document.rb",
|
148
|
-
"lib/bhf/
|
149
|
-
"lib/bhf/platform.rb",
|
150
|
-
"lib/bhf/
|
151
|
-
"lib/bhf/
|
145
|
+
"lib/bhf/platform/attribute/abstract.rb",
|
146
|
+
"lib/bhf/platform/attribute/column.rb",
|
147
|
+
"lib/bhf/platform/attribute/reflection.rb",
|
148
|
+
"lib/bhf/platform/base.rb",
|
149
|
+
"lib/bhf/platform/pagination.rb",
|
150
|
+
"lib/bhf/settings/base.rb",
|
151
|
+
"lib/bhf/settings/platform.rb",
|
152
|
+
"lib/bhf/settings/yaml_parser.rb",
|
152
153
|
"lib/rails/generators/bhf/templates/initializer.rb",
|
153
154
|
"test/database.yml",
|
154
155
|
"test/test_helper.rb"
|
@@ -162,7 +163,7 @@ Gem::Specification.new do |s|
|
|
162
163
|
s.specification_version = 4
|
163
164
|
|
164
165
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
165
|
-
s.add_runtime_dependency(%q<rails>, ["~> 4
|
166
|
+
s.add_runtime_dependency(%q<rails>, ["~> 4"])
|
166
167
|
s.add_runtime_dependency(%q<turbolinks>, ["~> 2.1"])
|
167
168
|
s.add_runtime_dependency(%q<kaminari>, ["~> 0.15"])
|
168
169
|
s.add_runtime_dependency(%q<haml-rails>, ["~> 0.4"])
|
@@ -173,7 +174,7 @@ Gem::Specification.new do |s|
|
|
173
174
|
s.add_development_dependency(%q<jeweler>, ["~> 2.0"])
|
174
175
|
s.add_development_dependency(%q<simplecov>, ["~> 0.8"])
|
175
176
|
else
|
176
|
-
s.add_dependency(%q<rails>, ["~> 4
|
177
|
+
s.add_dependency(%q<rails>, ["~> 4"])
|
177
178
|
s.add_dependency(%q<turbolinks>, ["~> 2.1"])
|
178
179
|
s.add_dependency(%q<kaminari>, ["~> 0.15"])
|
179
180
|
s.add_dependency(%q<haml-rails>, ["~> 0.4"])
|
@@ -185,7 +186,7 @@ Gem::Specification.new do |s|
|
|
185
186
|
s.add_dependency(%q<simplecov>, ["~> 0.8"])
|
186
187
|
end
|
187
188
|
else
|
188
|
-
s.add_dependency(%q<rails>, ["~> 4
|
189
|
+
s.add_dependency(%q<rails>, ["~> 4"])
|
189
190
|
s.add_dependency(%q<turbolinks>, ["~> 2.1"])
|
190
191
|
s.add_dependency(%q<kaminari>, ["~> 0.15"])
|
191
192
|
s.add_dependency(%q<haml-rails>, ["~> 0.4"])
|
data/config/locales/de.yml
CHANGED
@@ -4,22 +4,22 @@ de:
|
|
4
4
|
boolean:
|
5
5
|
'true': 'ja'
|
6
6
|
'false': 'nein'
|
7
|
-
link: Link ⬀
|
7
|
+
link: 'Link ⬀'
|
8
8
|
form:
|
9
9
|
buttons:
|
10
|
-
save: '%{
|
10
|
+
save: '%{platform_title} speichern'
|
11
11
|
and_edit: und editieren
|
12
12
|
and_add: und anlegen
|
13
13
|
searchform:
|
14
14
|
placeholder: Suche
|
15
15
|
promts:
|
16
|
-
confirm:
|
16
|
+
confirm: 'Wollen Sie diesen %{platform_title}-Eintrag löschen?'
|
17
17
|
entry:
|
18
|
-
show: "%{
|
19
|
-
new: "%{
|
20
|
-
duplicate: "%{
|
21
|
-
edit: "%{
|
22
|
-
delete: "%{
|
18
|
+
show: "%{platform_title} anzeigen"
|
19
|
+
new: "%{platform_title} anlegen"
|
20
|
+
duplicate: "%{platform_title} duplizieren"
|
21
|
+
edit: "%{platform_title} editieren"
|
22
|
+
delete: "%{platform_title} löschen"
|
23
23
|
empty: Leer
|
24
24
|
cancel: Abbrechen
|
25
25
|
user:
|
data/config/locales/en.yml
CHANGED
@@ -10,19 +10,19 @@ en:
|
|
10
10
|
link: Link ⬀
|
11
11
|
form:
|
12
12
|
buttons:
|
13
|
-
save: 'Save %{
|
13
|
+
save: 'Save %{platform_title}'
|
14
14
|
and_edit: and edit
|
15
15
|
and_add: and add another
|
16
16
|
searchform:
|
17
17
|
placeholder: Search
|
18
18
|
promts:
|
19
|
-
confirm:
|
19
|
+
confirm: 'Do you want to delete this %{platform_title}-entry?'
|
20
20
|
entry:
|
21
|
-
new: "New %{
|
22
|
-
show: "Show %{
|
23
|
-
duplicate: "Duplicate %{
|
24
|
-
edit: "Edit %{
|
25
|
-
delete: "Delete %{
|
21
|
+
new: "New %{platform_title}"
|
22
|
+
show: "Show %{platform_title}"
|
23
|
+
duplicate: "Duplicate %{platform_title}"
|
24
|
+
edit: "Edit %{platform_title}"
|
25
|
+
delete: "Delete %{platform_title}"
|
26
26
|
empty: Empty
|
27
27
|
cancel: Cancel
|
28
28
|
user:
|
data/lib/bhf.rb
CHANGED
@@ -2,24 +2,8 @@ require 'haml'
|
|
2
2
|
require 'sass'
|
3
3
|
require 'turbolinks'
|
4
4
|
require 'kaminari'
|
5
|
-
require 'bhf/active_record/active_record'
|
6
|
-
require 'bhf/mongoid/document'
|
7
|
-
require 'bhf/data'
|
8
|
-
require 'bhf/platform'
|
9
|
-
require 'bhf/settings_parser'
|
10
|
-
require 'bhf/settings'
|
11
|
-
require 'bhf/pagination'
|
12
|
-
require 'bhf/form'
|
13
|
-
|
14
5
|
|
15
6
|
module Bhf
|
16
|
-
def self.configuration
|
17
|
-
@configuration ||= Bhf::Configuration.new
|
18
|
-
end
|
19
|
-
def self.configure
|
20
|
-
yield configuration
|
21
|
-
end
|
22
|
-
|
23
7
|
class Engine < Rails::Engine
|
24
8
|
|
25
9
|
isolate_namespace Bhf
|
@@ -32,15 +16,21 @@ module Bhf
|
|
32
16
|
|
33
17
|
initializer 'bhf.model_hooks' do
|
34
18
|
ActiveSupport.on_load :active_record do
|
35
|
-
include Bhf::ActiveRecord::
|
19
|
+
include Bhf::ActiveRecord::Base
|
36
20
|
end
|
37
21
|
ActiveSupport.on_load :mongoid do
|
38
22
|
include Bhf::Mongoid::Document
|
39
23
|
end
|
40
24
|
end
|
41
25
|
end
|
42
|
-
PAPERCLIP_IMAGE_TYPES = ['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif']
|
43
26
|
|
27
|
+
|
28
|
+
def self.configuration
|
29
|
+
@configuration ||= Bhf::Configuration.new
|
30
|
+
end
|
31
|
+
def self.configure
|
32
|
+
yield configuration
|
33
|
+
end
|
44
34
|
class Configuration
|
45
35
|
include ActiveSupport::Configurable
|
46
36
|
|
@@ -52,7 +42,22 @@ module Bhf
|
|
52
42
|
config_accessor(:account_model_find_method) { 'find' }
|
53
43
|
config_accessor(:css) { ['bhf/application'] }
|
54
44
|
config_accessor(:js) { ['bhf/application'] }
|
55
|
-
config_accessor(:
|
45
|
+
config_accessor(:abstract_settings) { [] }
|
46
|
+
config_accessor(:paperclip_image_types) {
|
47
|
+
['image/jpeg', 'image/pjpeg', 'image/jpg', 'image/png', 'image/tif', 'image/gif']
|
48
|
+
}
|
56
49
|
end
|
57
|
-
|
58
|
-
|
50
|
+
end
|
51
|
+
|
52
|
+
require 'bhf/settings/base'
|
53
|
+
require 'bhf/settings/platform'
|
54
|
+
require 'bhf/settings/yaml_parser'
|
55
|
+
require 'bhf/platform/base'
|
56
|
+
require 'bhf/platform/pagination'
|
57
|
+
require 'bhf/platform/attribute/abstract'
|
58
|
+
require 'bhf/platform/attribute/column'
|
59
|
+
require 'bhf/platform/attribute/reflection'
|
60
|
+
require 'bhf/active_record/base'
|
61
|
+
require 'bhf/mongoid/document'
|
62
|
+
require 'bhf/action_view/form_options'
|
63
|
+
require 'bhf/action_view/form_builder'
|