unirer-bootstrap 0.10 → 0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c48998f1e932da56ad3dc52873a29516bd6dc1c1
4
- data.tar.gz: 38f16e23b74340658b61650579817d87140aaab2
3
+ metadata.gz: 63d59602007413b7ab2105a31ff61042aa692011
4
+ data.tar.gz: 6dce15a796757df5a2978967fd68a97f93ac4bae
5
5
  SHA512:
6
- metadata.gz: 5853fb0c6463a1af3a682a5dcbda8f954275eaf584fda346da3872f14793848d97212e5558eb1ef58016b5967763449c92301fcbcd2a65676d4f036e2708f214
7
- data.tar.gz: a75a68055a6ce3240b2556a827d8fc84aabbc575e427ff5744bbcc5989572736b0d12990a0bf4fe456a0a4fb3d21f94275796ba1d7c3573c0c958705a69c84ce
6
+ metadata.gz: 7f94e0320ca24a1832fbb44c34a35a1f0c942f2530fc149764588c88bede1b75487ce9d9c94cfa120a73faea840851ce24d0e5ad0e5bd5153af86d8bdee7a859
7
+ data.tar.gz: 784a2e0cce7b31600326fc5f5199d7e3daec5365644f9fa6303a353e07fa80c0936ab9ca0f35510c68df50032e78d0e82e164356155e085e721fa3ec58fe4635
data/README.md CHANGED
@@ -6,6 +6,14 @@
6
6
  Unirer (UNIfied Resource Representation) is a series of resource representation engines. The Bootstrap resource representation engine includes Bootstrap-based resource representation templates & snippets.
7
7
  Unirer (统一资源表现)是一系列的资源表现引擎。Bootstrap 资源表现引擎包括基于Bootstrap的资源表现模版和片段。
8
8
 
9
+
10
+
11
+ ## Recent Update
12
+ Check out the [Road Map](ROADMAP.md) to find out what's the next.
13
+ Check out the [Change Log](CHANGELOG.md) to find out what's new.
14
+
15
+
16
+
9
17
  ## Usage in Gemfile
10
18
  ```ruby
11
19
  gem 'unirer-bootstrap'
@@ -135,6 +143,17 @@ The Form Field partial includes the HTML form field tags for Rails Form Builder
135
143
  }
136
144
  }
137
145
  %>
146
+ <%= render partial: 'unirer/bootstrap/form_field',
147
+ locals: {
148
+ options: {
149
+ model: model,
150
+ form: f,
151
+ name: :photo,
152
+ type: :file_field,
153
+ input_accept: 'image/*'
154
+ }
155
+ }
156
+ %>
138
157
  ```
139
158
 
140
159
 
@@ -164,6 +183,7 @@ Here are more options:
164
183
  - field_class: the CSS class for the wrapper of the form control. The .input-group class is mandatory, and can not be removed.
165
184
  - input_class: The CSS class for the HTML input tag. The .form-control class is mandatory, and can not be removed.
166
185
  - error_class: the CSS class for the validation error block of this field. The .text-danger class is mandatory, and can not be removed.
186
+ - input_accept: The HTML 5 attribute for the file input tag.
167
187
  - input_data: The HTML 5 Data attribute for the input tag.
168
188
  - error_hidden: Determines whether the error message block should be shown if the field has any error.
169
189
  - prefix: the HTML source codes of input group addon before the form control.
@@ -34,6 +34,8 @@
34
34
  required: options[:required],
35
35
  data: input_data
36
36
  }
37
+ input_options[:accept] = options[:accept] if options[:accept].present?
38
+
37
39
 
38
40
  error_hidden = options[:error_hidden]
39
41
  %>
@@ -29,7 +29,7 @@
29
29
  error_hidden = options[:error_hidden]
30
30
 
31
31
  choices = options[:choices]
32
- flags = options[:options]
32
+ flags = options[:options]||{}
33
33
  %>
34
34
 
35
35
  <div class='<%= group_class %>'>
@@ -1,5 +1,5 @@
1
1
  module Unirer
2
2
  module Bootstrap
3
- VERSION = '0.10'.freeze
3
+ VERSION = '0.11'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unirer-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.10'
4
+ version: '0.11'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Topbit Du
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-21 00:00:00.000000000 Z
11
+ date: 2016-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails