bhf 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/bhf/entries_controller.rb +2 -2
- data/app/helpers/bhf/application_helper.rb +4 -0
- data/app/views/bhf/entries/show.haml +7 -0
- data/app/views/bhf/pages/_platform.haml +6 -3
- data/app/views/bhf/pages/macro/column/_file.haml +1 -0
- data/app/views/bhf/pages/macro/column/_image.haml +2 -0
- data/config/locales/de.yml +1 -0
- data/config/locales/en.yml +1 -1
- data/config/routes.rb +1 -1
- data/lib/bhf/platform.rb +27 -0
- data/vendor/assets/javascripts/bhf/application.js +1 -1
- data/vendor/assets/stylesheets/bhf/application.css.sass +15 -0
- metadata +15 -12
@@ -19,7 +19,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
19
19
|
manage_many_to_many
|
20
20
|
after_save
|
21
21
|
|
22
|
-
redirect_back_or_default(
|
22
|
+
redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('create.success', @model))
|
23
23
|
else
|
24
24
|
@form_url = bhf_entries_path(@platform.name)
|
25
25
|
render :new
|
@@ -35,7 +35,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
|
|
35
35
|
if @quick_edit
|
36
36
|
render json: object_to_bhf_display_hash, status: :ok
|
37
37
|
else
|
38
|
-
redirect_back_or_default(
|
38
|
+
redirect_back_or_default(bhf_page_url(@platform.page_name, anchor: "#{@platform.name}_platform"), notice: set_message('update.success', @model))
|
39
39
|
end
|
40
40
|
else
|
41
41
|
@form_url = bhf_entry_path(@platform.name, @object)
|
@@ -1,6 +1,10 @@
|
|
1
1
|
module Bhf
|
2
2
|
module ApplicationHelper
|
3
3
|
|
4
|
+
def show_t(platform)
|
5
|
+
t("bhf.helpers.entry.models.#{platform.model_name}.show", platform_name: platform.title_singular, default: t('bhf.helpers.entry.show'))
|
6
|
+
end
|
7
|
+
|
4
8
|
def new_t(platform)
|
5
9
|
t("bhf.helpers.entry.models.#{platform.model_name}.new", platform_name: platform.title_singular, default: t('bhf.helpers.entry.new'))
|
6
10
|
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
%h3= show_t @platform
|
2
|
+
.dl
|
3
|
+
- @platform.definitions.each do |column|
|
4
|
+
%p
|
5
|
+
%span.dt= @platform.model.human_attribute_name(column.name) + ':'
|
6
|
+
%span.dd{class: "#{column.field.macro} #{column.field.display_type}", :'data-column-name' => column.name}
|
7
|
+
= render(partial: "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}", locals: {column: column, object: @object})
|
@@ -30,6 +30,7 @@
|
|
30
30
|
- if platform.objects.any?
|
31
31
|
- platform.objects.each do |object|
|
32
32
|
- edit_link = edit_bhf_entry_path(platform.name, object)
|
33
|
+
- custom_link = send(platform.custom_link, platform.name, object) if platform.custom_link
|
33
34
|
%tr{id: "#{object.id}_#{platform.name}"}
|
34
35
|
- if platform.sortable
|
35
36
|
%td.drag
|
@@ -41,11 +42,13 @@
|
|
41
42
|
- ' '
|
42
43
|
- else
|
43
44
|
- render(partial: "bhf/pages/macro/#{column.field.macro}/#{column.field.display_type}", locals: {column: column, object: object})
|
44
|
-
= link_to_if !has_link?(column.field.overwrite_display_type), a.html_safe, edit_link, class: 'quick_edit'
|
45
|
+
= link_to_if !has_link?(column.field.overwrite_display_type), a.html_safe, (platform.custom_link ? custom_link : edit_link), class: ('quick_edit' unless platform.custom_link)
|
45
46
|
|
46
47
|
%td.action
|
47
|
-
|
48
|
-
|
48
|
+
- if platform.display_edit
|
49
|
+
= link_to edit_t(platform), edit_link, class: 'edit'
|
50
|
+
- if platform.display_delete
|
51
|
+
= link_to delete_t(platform), bhf_entry_path(platform.name, object), method: :delete, remote: true, class: :delete, confirm: t('bhf.helpers.promts.confirm')
|
49
52
|
- else
|
50
53
|
%td.no_entries{colspan: platform.columns_count}
|
51
54
|
= t 'bhf.pagination.info', name_zero: platform.title, count: 0
|
@@ -0,0 +1 @@
|
|
1
|
+
= link_to_if object.send(column.name), object.send(column.name)
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/config/routes.rb
CHANGED
@@ -6,7 +6,7 @@ Rails.application.routes.draw do
|
|
6
6
|
get 'page/:page', to: 'pages#show', as: :page
|
7
7
|
|
8
8
|
scope ':platform' do
|
9
|
-
resources :entries, except: [:index
|
9
|
+
resources :entries, except: [:index] do
|
10
10
|
resources :embed_entries, except: [:index, :show], as: :embed
|
11
11
|
put :sort, on: :collection
|
12
12
|
end
|
data/lib/bhf/platform.rb
CHANGED
@@ -96,6 +96,13 @@ module Bhf
|
|
96
96
|
end
|
97
97
|
end
|
98
98
|
|
99
|
+
def definitions
|
100
|
+
default_attrs(show_options(:definitions), @collection).
|
101
|
+
each_with_object([]) do |field, obj|
|
102
|
+
obj << Bhf::Data::Column.new(field)
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
99
106
|
def entries_per_page
|
100
107
|
table_options(:per_page)
|
101
108
|
end
|
@@ -113,6 +120,10 @@ module Bhf
|
|
113
120
|
@data['table']
|
114
121
|
end
|
115
122
|
|
123
|
+
def show
|
124
|
+
@data['show']
|
125
|
+
end
|
126
|
+
|
116
127
|
def form
|
117
128
|
@data['form']
|
118
129
|
end
|
@@ -131,6 +142,18 @@ module Bhf
|
|
131
142
|
table_options 'sortable'
|
132
143
|
end
|
133
144
|
|
145
|
+
def display_edit
|
146
|
+
table_options 'display_edit'
|
147
|
+
end
|
148
|
+
|
149
|
+
def display_delete
|
150
|
+
table_options 'display_delete'
|
151
|
+
end
|
152
|
+
|
153
|
+
def custom_link
|
154
|
+
table_options 'custom_link'
|
155
|
+
end
|
156
|
+
|
134
157
|
def custom_partial
|
135
158
|
table_options 'partial'
|
136
159
|
end
|
@@ -234,6 +257,10 @@ module Bhf
|
|
234
257
|
def table_options(key, attribute = nil)
|
235
258
|
lookup_options table, key, attribute
|
236
259
|
end
|
260
|
+
|
261
|
+
def show_options(key, attribute = nil)
|
262
|
+
lookup_options show, key, attribute
|
263
|
+
end
|
237
264
|
|
238
265
|
def lookup_options(main_key, key, attribute = nil)
|
239
266
|
if main_key
|
@@ -45,7 +45,7 @@ window.addEvent('domready', function(){
|
|
45
45
|
}
|
46
46
|
|
47
47
|
var hiddenInput = input.clone();
|
48
|
-
input.value = new Date
|
48
|
+
input.value = new Date.parse(input.value).format(options.format);
|
49
49
|
input.erase('name');
|
50
50
|
hiddenInput.set('type', 'hidden').inject(input, 'after');
|
51
51
|
|
@@ -75,6 +75,21 @@ header
|
|
75
75
|
+bg-gradient($b2, $b1)
|
76
76
|
+text-shadow(#0068B3, -1)
|
77
77
|
|
78
|
+
.preview_image
|
79
|
+
@extend .default_input
|
80
|
+
vertical-align: middle
|
81
|
+
padding: 2px
|
82
|
+
width: auto
|
83
|
+
max-width: 400px
|
84
|
+
max-height: 200px
|
85
|
+
|
86
|
+
.dl
|
87
|
+
+text-shadow(#fff)
|
88
|
+
.dt
|
89
|
+
display: inline-block
|
90
|
+
min-width: 200px
|
91
|
+
color: $g1
|
92
|
+
|
78
93
|
|
79
94
|
#content
|
80
95
|
display: table
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bhf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-06-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &70201485646540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 3.2.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70201485646540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: kaminari
|
27
|
-
requirement: &
|
27
|
+
requirement: &70201485645620 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.12.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70201485645620
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: haml-rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &70201485642100 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.3.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70201485642100
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: sass-rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &70201485641140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.1.4
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70201485641140
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: mootools-rails
|
60
|
-
requirement: &
|
60
|
+
requirement: &70201485640160 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: 1.0.1
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70201485640160
|
69
69
|
description: Gets you there on time
|
70
70
|
email: anton.pawlik@gmail.com
|
71
71
|
executables: []
|
@@ -112,6 +112,7 @@ files:
|
|
112
112
|
- app/views/bhf/entries/form/has_one/_account_scope.haml
|
113
113
|
- app/views/bhf/entries/form/has_one/_static.haml
|
114
114
|
- app/views/bhf/entries/new.haml
|
115
|
+
- app/views/bhf/entries/show.haml
|
115
116
|
- app/views/bhf/helper/_field_errors.haml
|
116
117
|
- app/views/bhf/helper/_flash.haml
|
117
118
|
- app/views/bhf/helper/_frontend_edit.haml
|
@@ -124,6 +125,8 @@ files:
|
|
124
125
|
- app/views/bhf/pages/macro/column/_array.haml
|
125
126
|
- app/views/bhf/pages/macro/column/_boolean.haml
|
126
127
|
- app/views/bhf/pages/macro/column/_date.haml
|
128
|
+
- app/views/bhf/pages/macro/column/_file.haml
|
129
|
+
- app/views/bhf/pages/macro/column/_image.haml
|
127
130
|
- app/views/bhf/pages/macro/column/_number.haml
|
128
131
|
- app/views/bhf/pages/macro/column/_primary_key.haml
|
129
132
|
- app/views/bhf/pages/macro/column/_string.haml
|