bhf 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/app/assets/javascripts/bhf/application.js +1 -5
- data/app/assets/stylesheets/bhf/application.css.sass +8 -2
- data/app/views/bhf/pages/_platform.haml +28 -21
- data/app/views/bhf/pages/_search.haml +2 -0
- data/bhf.gemspec +3 -3
- data/lib/bhf/platform/base.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f344e5b10c973d0d42c55159deb54c645e7a0e24
|
4
|
+
data.tar.gz: 1091824278485c4d3be0c94fdde0269dbabf1184
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 31617fbd1004836e2045abf8e26195a593a2e63d0d28c38616ae5be813022e7179fd4de6dada51fb8f65f56ff6f36f774f51fecb5c33a96caa6631cda2e7ef00
|
7
|
+
data.tar.gz: 74cb8070bb915bc29a02893125ac3c9c23db534e1a6d6190f7b526282139602c6eddf9effc2474452406ea0617e3ad1b3c814a6b94ef5de1d742bec34bee4e10
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.4
|
@@ -120,7 +120,6 @@ Turbolinks.pagesCached(0);
|
|
120
120
|
});
|
121
121
|
}
|
122
122
|
|
123
|
-
var quickEditArray = [];
|
124
123
|
var quickEditOptions;
|
125
124
|
|
126
125
|
ajaxNote.setup();
|
@@ -289,9 +288,8 @@ Turbolinks.pagesCached(0);
|
|
289
288
|
});
|
290
289
|
}
|
291
290
|
|
292
|
-
|
293
291
|
var scrollContent = function(){
|
294
|
-
|
292
|
+
editStack.bricksArray.each(function(quickEdit){
|
295
293
|
var innerForm = quickEdit.holder.getElement('form');
|
296
294
|
if ( ! innerForm) { return; }
|
297
295
|
var scroll = document.body.scrollTop - 83;
|
@@ -299,8 +297,6 @@ Turbolinks.pagesCached(0);
|
|
299
297
|
quickEdit.holder.setStyle('padding-top', scroll);
|
300
298
|
});
|
301
299
|
};
|
302
|
-
// window.onscroll = scrollContent;
|
303
|
-
|
304
300
|
|
305
301
|
mainScope.getElements('.js_sortable').each(function(sortableElems){
|
306
302
|
new Sortables(sortableElems, {
|
@@ -264,10 +264,11 @@ table.data_table
|
|
264
264
|
.info
|
265
265
|
margin: 0 20px 0 10px
|
266
266
|
min-width: 290px
|
267
|
-
|
267
|
+
white-space: nowrap
|
268
268
|
font-size: 12px
|
269
|
+
font-style: normal
|
270
|
+
text-transform: uppercase
|
269
271
|
color: $g5
|
270
|
-
white-space: nowrap
|
271
272
|
strong
|
272
273
|
color: $g6
|
273
274
|
form
|
@@ -392,8 +393,13 @@ table.data_table
|
|
392
393
|
th.drag
|
393
394
|
width: 24px
|
394
395
|
tfoot
|
396
|
+
.custom_footer_td
|
397
|
+
text-align: right
|
398
|
+
padding-right: 20px
|
395
399
|
td
|
396
400
|
padding-top: 10px
|
401
|
+
&:first-child
|
402
|
+
padding-left: 20px
|
397
403
|
thead,
|
398
404
|
tbody
|
399
405
|
.primary_key,
|
@@ -11,7 +11,6 @@
|
|
11
11
|
%table.data_table{id: "#{platform.name}_platform", class: (platform.custom_columns? ? :custom_columns : :default_columns)}
|
12
12
|
%caption
|
13
13
|
%h4= platform.title
|
14
|
-
%p.info= platform.pagination.info platform
|
15
14
|
- unless platform.hide_create
|
16
15
|
%p.create= link_to new_t(platform), new_entry_path(platform.name), class: :alt_button
|
17
16
|
- unless platform.custom_partial
|
@@ -28,8 +27,15 @@
|
|
28
27
|
|
29
28
|
%tfoot
|
30
29
|
%tr
|
31
|
-
|
30
|
+
- colspan_1 = platform.columns_count+1
|
31
|
+
- if platform.custom_footer
|
32
|
+
- colspan_1 = (platform.columns_count / 2.to_f).ceil
|
33
|
+
- colspan_2 = (platform.columns_count / 2.to_f).floor
|
34
|
+
%td{colspan: colspan_1}
|
32
35
|
= platform.pagination.create(platform) unless platform.sortable
|
36
|
+
- if platform.custom_footer
|
37
|
+
%td.custom_footer_td{colspan: colspan_2}
|
38
|
+
= render partial: "bhf/platform/#{platform.custom_footer}", locals: { platform: platform }
|
33
39
|
|
34
40
|
%tbody.quick_edit_block{class: ('js_sortable' if platform.sortable), data: {sort_url: sort_entries_path(platform.name)}}
|
35
41
|
- if platform.objects.any?
|
@@ -70,23 +76,24 @@
|
|
70
76
|
- unless platform.hide_create
|
71
77
|
= link_to new_t(platform), new_entry_path(platform.name)
|
72
78
|
|
73
|
-
|
74
|
-
%
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
%
|
79
|
-
|
80
|
-
-
|
81
|
-
|
82
|
-
|
83
|
-
|
79
|
+
- if platform.table_quick_edit
|
80
|
+
%template.quick_edit_template{type: 'text/template'}
|
81
|
+
%tr.quick_edit_entry{id: "{object_id}_#{platform.name}"}
|
82
|
+
- edit_link = edit_entry_path(platform.name, '{object_id}')
|
83
|
+
- if platform.sortable
|
84
|
+
%td.drag
|
85
|
+
%span.handle.icon
|
86
|
+
- platform.columns.each do |column|
|
87
|
+
- css_classes = [column.macro, column.display_type]
|
88
|
+
- custom_link = send(platform.custom_link, platform: platform.name, id: '{object_id}') if platform.custom_link
|
89
|
+
%td{class: css_classes}
|
90
|
+
= render(partial: "bhf/table/#{column.macro}/#{column.display_type}", locals: {column_value: "{#{column.name}}", object: platform.model.new, link: (platform.custom_link ? custom_link : edit_link), add_quick_link: (!platform.custom_link && platform.table_quick_edit)})
|
84
91
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
92
|
+
%td.action{class: ('wider' if platform.show_duplicate && !platform.hide_edit && !platform.hide_delete)}
|
93
|
+
- if platform.show_duplicate
|
94
|
+
- dt = duplicate_t(platform)
|
95
|
+
= link_to dt, duplicate_entry_path(platform.name, '{object_id}'), class: 'icon duplicate', method: :post, title: dt
|
96
|
+
- unless platform.hide_edit
|
97
|
+
= link_to edit_t(platform), edit_link, class: 'icon edit'
|
98
|
+
- unless platform.hide_delete
|
99
|
+
= 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)}
|
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
- if platform.scopes
|
6
6
|
= f.select :scope, options_from_collection_for_select(platform.scopes, :value, :name, (p && p[:scope])), {}, class: 'js_submit_form_on_change'
|
7
|
+
|
8
|
+
%p.info= platform.pagination.info platform
|
7
9
|
|
8
10
|
- if platform.search_field?
|
9
11
|
= s.text_field :text, value: get_value([:search, :text], p), placeholder: t('bhf.helpers.searchform.placeholder')
|
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.9.
|
5
|
+
# stub: bhf 0.9.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "bhf"
|
9
|
-
s.version = "0.9.
|
9
|
+
s.version = "0.9.4"
|
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-07-
|
14
|
+
s.date = "2014-07-12"
|
15
15
|
s.description = "A simple to use Rails-Engine-Gem that offers an admin interface for trusted user. Easy integratable and highly configurable and agnostic. Works with ActiveRecord and Mongoid."
|
16
16
|
s.email = "anton.pawlik@gmail.com"
|
17
17
|
s.extra_rdoc_files = [
|
data/lib/bhf/platform/base.rb
CHANGED
@@ -80,7 +80,14 @@ module Bhf::Platform
|
|
80
80
|
end
|
81
81
|
|
82
82
|
def fields
|
83
|
-
@fields
|
83
|
+
return @fields if @fields
|
84
|
+
|
85
|
+
tmp = default_attrs(form_value(:display), attributes)
|
86
|
+
if sortable and ! form_value(:display)
|
87
|
+
tmp = remove_excludes(tmp, [sortable_property.to_s])
|
88
|
+
end
|
89
|
+
|
90
|
+
@fields = remove_excludes(tmp, form_value(:exclude))
|
84
91
|
end
|
85
92
|
|
86
93
|
def columns
|
@@ -127,6 +134,10 @@ module Bhf::Platform
|
|
127
134
|
table_value(:custom_search)
|
128
135
|
end
|
129
136
|
|
137
|
+
def custom_footer
|
138
|
+
table_value(:custom_footer)
|
139
|
+
end
|
140
|
+
|
130
141
|
def table_columns
|
131
142
|
table_value(:display) || table_value(:columns)
|
132
143
|
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.9.
|
4
|
+
version: 0.9.4
|
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-07-
|
11
|
+
date: 2014-07-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|