bhf 0.9.9 → 0.10.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89824fe418339127cfa805a2a783b0257246325a
4
- data.tar.gz: e7dcdce38b1f9decf65762548388f943483a5eb2
3
+ metadata.gz: d9a75de558dc0e33f75540cb2c35c1e61e3fa1c1
4
+ data.tar.gz: 6ece9c379069585db4e38cd08e0206c8f4b6e6eb
5
5
  SHA512:
6
- metadata.gz: ac49b229ffb4f1a076c58d81b5f82be0d2b5483a428593b78ca540d8e3f4cbcdea5b2f324218cb3a83c25847d6e281ede8005097146ae89ea538b45c6ae18f4d
7
- data.tar.gz: db8a47b44d37f1c5f8d73d0fd5186f1f0c909cf86f54c2359f8cdbc6605aacf8be45e94ccd4dfbf677e735533d2954fbf574fc2591a02d6c2b06c71f2bee7695
6
+ metadata.gz: c2f9630029bfe901b535deac2f2346e7d918fbe0808ec69831d4813e1b97f1f090cd9e8302efb7b81cf77ec395e76c69ad26d4cf34c8a55cbca41de4b1863066
7
+ data.tar.gz: 077b1d4282e0c5b47678bcf3c4237b45331c1826b6a49249ca68e1c5ce55ba3705fa63ddd955aed5de155ef6767b652d2377d6110bdbafc1034d215b5802148a
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.9
1
+ 0.10.9
@@ -746,6 +746,7 @@ input[type="submit"].alt_button,
746
746
  color: $w1
747
747
  border: 0
748
748
  +transition-duration(0.3)
749
+ &.selected,
749
750
  &:hover
750
751
  background: $b1
751
752
  text-decoration: none
@@ -27,7 +27,10 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
27
27
  @form_url = entry_embed_index_path(@platform.name, @model.get_embedded_parent(params[:entry_id]))
28
28
 
29
29
  r_settings = {status: :unprocessable_entity}
30
- r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
30
+ if @quick_edit
31
+ r_settings[:layout] = 'bhf/quick_edit'
32
+ r_settings[:formats] = [:html]
33
+ end
31
34
  render 'bhf/entries/new', r_settings
32
35
  end
33
36
  end
@@ -47,7 +50,10 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
47
50
  @form_url = entry_embed_path(@platform.name, @model.get_embedded_parent(params[:entry_id]), @object)
48
51
 
49
52
  r_settings = {status: :unprocessable_entity}
50
- r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
53
+ if @quick_edit
54
+ r_settings[:layout] = 'bhf/quick_edit'
55
+ r_settings[:formats] = [:html]
56
+ end
51
57
  render 'bhf/entries/edit', r_settings
52
58
  end
53
59
  end
@@ -56,6 +62,7 @@ class Bhf::EmbedEntriesController < Bhf::EntriesController
56
62
 
57
63
  def load_object
58
64
  @object = @model.bhf_find_embed(params[:entry_id], params[:id])
65
+ @object.assign_attributes(@permited_params) if @object and @permited_params
59
66
  after_load
60
67
  end
61
68
 
@@ -41,7 +41,10 @@ class Bhf::EntriesController < Bhf::ApplicationController
41
41
  @form_url = entries_path(@platform.name)
42
42
 
43
43
  r_settings = {status: :unprocessable_entity}
44
- r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
44
+ if @quick_edit
45
+ r_settings[:layout] = 'bhf/quick_edit'
46
+ r_settings[:formats] = [:html]
47
+ end
45
48
  render :new, r_settings
46
49
  end
47
50
  end
@@ -63,7 +66,10 @@ class Bhf::EntriesController < Bhf::ApplicationController
63
66
  @form_url = entry_path(@platform.name, @object)
64
67
 
65
68
  r_settings = {status: :unprocessable_entity}
66
- r_settings[:layout] = 'bhf/quick_edit' if @quick_edit
69
+ if @quick_edit
70
+ r_settings[:layout] = 'bhf/quick_edit'
71
+ r_settings[:formats] = [:html]
72
+ end
67
73
  render :edit, r_settings
68
74
  end
69
75
  end
@@ -110,10 +116,8 @@ class Bhf::EntriesController < Bhf::ApplicationController
110
116
  @platform.columns.each_with_object(extra_data) do |column, hash|
111
117
  column_value = @object.send(column.name)
112
118
  unless column.macro == :column && column_value.blank?
113
- with_format :html do
114
- p = "bhf/table/#{column.macro}/#{column.display_type}"
115
- hash[column.name] = render_to_string partial: p, locals: {object: @object, column_value: column_value, link: false, add_quick_link: false}
116
- end
119
+ p = "bhf/table/#{column.macro}/#{column.display_type}"
120
+ hash[column.name] = render_to_string partial: p, formats: [:html], locals: {object: @object, column_value: column_value, link: false, add_quick_link: false}
117
121
  end
118
122
  end
119
123
  end
@@ -129,6 +133,7 @@ class Bhf::EntriesController < Bhf::ApplicationController
129
133
 
130
134
  def load_object
131
135
  @object = @model.unscoped.find(params[:id]) rescue nil
136
+ @object.assign_attributes(@permited_params) if @object and @permited_params
132
137
  after_load
133
138
  end
134
139
 
@@ -5,8 +5,7 @@
5
5
  = render partial: 'bhf/entries/validation_errors', locals: {f: f}
6
6
 
7
7
  - @platform.fields.each do |field|
8
- - unless field.form_type == :hidden
9
- = render partial: "bhf/form/#{field.macro}/#{field.form_type}", locals: {f: f, field: field}
8
+ = render partial: "bhf/form/#{field.macro}/#{field.form_type}", locals: {f: f, field: field}
10
9
 
11
10
  - unless @quick_edit
12
11
 
@@ -0,0 +1 @@
1
+ = f.hidden_field field.name
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.9 ruby lib
5
+ # stub: bhf 0.10.9 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "bhf"
9
- s.version = "0.9.9"
9
+ s.version = "0.10.9"
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 = "2015-02-25"
14
+ s.date = "2015-02-28"
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 = [
@@ -84,6 +84,7 @@ Gem::Specification.new do |s|
84
84
  "app/views/bhf/form/column/_boolean.html.haml",
85
85
  "app/views/bhf/form/column/_date.html.haml",
86
86
  "app/views/bhf/form/column/_hash.html.haml",
87
+ "app/views/bhf/form/column/_hidden.html.haml",
87
88
  "app/views/bhf/form/column/_mappin.html.haml",
88
89
  "app/views/bhf/form/column/_markdown.html.haml",
89
90
  "app/views/bhf/form/column/_multiple_fields.html.haml",
@@ -289,7 +289,7 @@ module Bhf::Platform
289
289
 
290
290
  model.reflections.each_pair do |name, props|
291
291
  fk = props.foreign_key
292
- all[name.to_s] = Bhf::Platform::Attribute::Reflection.new(props, default_attribute_options(name).merge({
292
+ all[name] = Bhf::Platform::Attribute::Reflection.new(props, default_attribute_options(name).merge({
293
293
  link: find_platform_settings_for_link(name),
294
294
  reorderble: model.bhf_attribute_method?(fk)
295
295
  }))
@@ -48,7 +48,7 @@ module Bhf::Platform
48
48
  name: platform.title,
49
49
  count: collection.total_count,
50
50
  offset_start: collection.offset_value + 1,
51
- offset_end: collection.offset_value + collection.length
51
+ offset_end: collection.offset_value + collection.limit_value
52
52
  })
53
53
  else
54
54
  I18n.t('bhf.pagination.info', {
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.9
4
+ version: 0.10.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Pawlik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-25 00:00:00.000000000 Z
11
+ date: 2015-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -225,6 +225,7 @@ files:
225
225
  - app/views/bhf/form/column/_boolean.html.haml
226
226
  - app/views/bhf/form/column/_date.html.haml
227
227
  - app/views/bhf/form/column/_hash.html.haml
228
+ - app/views/bhf/form/column/_hidden.html.haml
228
229
  - app/views/bhf/form/column/_mappin.html.haml
229
230
  - app/views/bhf/form/column/_markdown.html.haml
230
231
  - app/views/bhf/form/column/_multiple_fields.html.haml