dead_simple_cms 0.12.6 → 0.12.7
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 +8 -8
- data/lib/dead_simple_cms/attribute/type/base.rb +6 -2
- data/lib/dead_simple_cms/rails/action_view/form_builders/simple_form.rb +4 -1
- data/lib/dead_simple_cms/rails/action_view/form_builders/simple_form_with_bootstrap.rb +1 -1
- data/lib/dead_simple_cms/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NWUwOGU1MDI2ZWQzMTNlMjI4YmJhODNkMDY1NTY5ZTBlNWQyYTg4MA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OWYxYzkxYjJiNGFlOGM3ZjI0MjIwNzczNjhhMGFkNjAwOGFjYjZmNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZDhhYzA0NDQxNzllYTljNTkyYWY5MmRjNjQ5MzY2ODQyOTA4YTE0OThkYjEz
|
10
|
+
ZDQzM2MwOTczMzU1YzgyZjY0MzcyMjIwOWI3MjUwNmEwNjE5NzVjYTk5Mzkw
|
11
|
+
ODI4ODcyNWQzODdkYTdmZTQ4MDYzNDBhNmU5NmQyMzU2NGUxOTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzY3NDY0MDA4NTBjM2UzMTVhMGRiMzlmYWE1NDcyNTYyNDFmOWU3M2Y4MTAy
|
14
|
+
OWIxOWNhOTg0MTdmN2VlMjg2ZjY5ZjIyYzgxOWUxZDFkYTkzMTA3NzJkYjFk
|
15
|
+
NjMwNmZmYjA1Y2FiOTBkMDE4MWQ3NWQ4YzNlZjc4ZjkwYmYzNGU=
|
@@ -27,8 +27,8 @@ module DeadSimpleCMS
|
|
27
27
|
|
28
28
|
def initialize(identifier, options={})
|
29
29
|
options.reverse_merge!(:group_hierarchy => [], :input_type => default_input_type, :required => false)
|
30
|
-
@hint, @default, @input_type, @group_hierarchy, @section, @required =
|
31
|
-
options.values_at(:hint, :default, :input_type, :group_hierarchy, :section, :required)
|
30
|
+
@hint, @default, @input_type, @group_hierarchy, @section, @required, @length =
|
31
|
+
options.values_at(:hint, :default, :input_type, :group_hierarchy, :section, :required, :length)
|
32
32
|
raise("Invalid input type: #{input_type.inspect}. Should be one of #{VALID_INPUT_TYPES}.") unless VALID_INPUT_TYPES.include?(input_type)
|
33
33
|
super
|
34
34
|
end
|
@@ -46,6 +46,10 @@ module DeadSimpleCMS
|
|
46
46
|
@hint.is_a?(Proc) ? @hint.call : @hint
|
47
47
|
end
|
48
48
|
|
49
|
+
def length
|
50
|
+
@length.is_a?(Proc) ? @length.call : @length
|
51
|
+
end
|
52
|
+
|
49
53
|
def default
|
50
54
|
@default.is_a?(Proc) ? @default.call : @default
|
51
55
|
end
|
@@ -22,12 +22,15 @@ module DeadSimpleCMS
|
|
22
22
|
hint = attribute.hint.to_s.dup
|
23
23
|
hint << %{ <a href="#{attribute.value}" target="_blank">preview</a>} if attribute.is_a?(Attribute::Type::Image)
|
24
24
|
options = {:required => attribute.required, :hint => hint, :as => as, :label => attribute.label}
|
25
|
+
if attribute.length
|
26
|
+
options[:input_html] = {maxlength: attribute.length}
|
27
|
+
end
|
25
28
|
if attribute.is_a?(Attribute::Type::CollectionSupport) && (collection = attribute.collection)
|
26
29
|
options[:collection] = collection
|
27
30
|
options[:include_blank] = false if as==:select
|
28
31
|
end
|
29
32
|
|
30
|
-
input(attribute.identifier, attribute_options.
|
33
|
+
input(attribute.identifier, attribute_options.merge(options))
|
31
34
|
end
|
32
35
|
|
33
36
|
def update
|
@@ -4,7 +4,7 @@ module DeadSimpleCMS
|
|
4
4
|
module FormBuilders
|
5
5
|
class SimpleFormWithBootstrap < SimpleForm
|
6
6
|
|
7
|
-
self.form_for_options = {:wrapper => :bootstrap, :html => { class: "form-horizontal well" }}
|
7
|
+
self.form_for_options = {:wrapper => :bootstrap, :html => { class: "form-horizontal well dead-simple-cms" }}
|
8
8
|
self.update_options = {:class => "btn-primary"}
|
9
9
|
self.actions_options = {:class => "form-actions btn-group"}
|
10
10
|
self.preview_options = {:class => "btn"}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dead_simple_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aryk Grosz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|