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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGEwZDRjMmM3OWU4YmZmMWFkZTk3MzU2YzIzYTUxNzZjNWNkY2Y3NQ==
4
+ NWUwOGU1MDI2ZWQzMTNlMjI4YmJhODNkMDY1NTY5ZTBlNWQyYTg4MA==
5
5
  data.tar.gz: !binary |-
6
- YzU5Zjg1ZjZmMDQ0MGM4NjEyNjIwNjg5MjU0ZTRhOTc2NDkwMGUxOA==
6
+ OWYxYzkxYjJiNGFlOGM3ZjI0MjIwNzczNjhhMGFkNjAwOGFjYjZmNQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YzdkYzFkNGFjN2UwMTE3YjY4OTI2MTM5YjMzY2IyNzJiNDU1M2FlOTQyZjEy
10
- MGE0YmJjMTlkOGNmNzU0M2MyMjkwMDUxZDg0ZDVmNGFiOWQwYmU3NWViNTcz
11
- ZGM3MmE0MTJkY2I1NjJlMjEyOTQ4YjZhZTkxMmIxOWU0YjZiMDg=
9
+ ZDhhYzA0NDQxNzllYTljNTkyYWY5MmRjNjQ5MzY2ODQyOTA4YTE0OThkYjEz
10
+ ZDQzM2MwOTczMzU1YzgyZjY0MzcyMjIwOWI3MjUwNmEwNjE5NzVjYTk5Mzkw
11
+ ODI4ODcyNWQzODdkYTdmZTQ4MDYzNDBhNmU5NmQyMzU2NGUxOTA=
12
12
  data.tar.gz: !binary |-
13
- NWMwZjllYWI1OGJlNjUxZWMwOTg3MTg3MWU5YmQwNWZmYmM0M2EwNDRhZDE4
14
- NTYxZmY1YWI3OGMwMmRkNjdmMjhiZWMwNzBmMjkzNzNjODk1NTgwNGVkMjU1
15
- MmEwM2EzZWM2ZjAxNWE5MGY5YTFmYmNkMzhkNTk5ZmI2NjZmMjM=
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.update(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"}
@@ -1,3 +1,3 @@
1
1
  module DeadSimpleCMS
2
- VERSION = "0.12.6"
2
+ VERSION = "0.12.7"
3
3
  end
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.6
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-27 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport