repres-bootstrap 1.3.2 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -12
- data/Rakefile +2 -2
- data/app/assets/config/repres-bootstrap_manifest.js +2 -0
- data/app/assets/javascripts/repres/bootstrap/application.js +1 -1
- data/app/assets/stylesheets/repres/bootstrap/application.css +3 -3
- data/app/controllers/repres/bootstrap/application_controller.rb +1 -0
- data/app/jobs/repres/bootstrap/application_job.rb +2 -0
- data/app/mailers/repres/bootstrap/application_mailer.rb +4 -0
- data/app/models/repres/bootstrap/application_record.rb +3 -0
- data/app/views/layouts/repres/bootstrap/application.html.erb +2 -1
- data/app/views/repres/bootstrap/_script.html.erb +3 -0
- data/app/views/repres/bootstrap/_style.html.erb +3 -0
- data/lib/repres/bootstrap/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db3645ab0fdf4bd35ba65c70a9b5392c81ed4096
|
4
|
+
data.tar.gz: 7eecb5eb5cce70aa7751a27330c06af6562ca8de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1575da8a9eac9ed71e4cc46a57233a4f7bbb8bfb3d4579448a9451eaf7da3a9778f39e62bd930635fa5f17d6f8dcddbf273e0e0410d1e30ff0a59388b33c893
|
7
|
+
data.tar.gz: db9fd164502ed6d47f2d12959064113aa7095ca4f2745777b290c5072f83e87c8417b698cb16d6548510df4c9a55be20077298c4f735820682f5ba62d5abd2fa
|
data/README.md
CHANGED
@@ -10,12 +10,14 @@ Repres (资源表现)是一系列的资源表现引擎。Bootstrap 资源表现
|
|
10
10
|
|
11
11
|
|
12
12
|
## Recent Update
|
13
|
+
|
13
14
|
Check out the [Road Map](ROADMAP.md) to find out what's the next.
|
14
15
|
Check out the [Change Log](CHANGELOG.md) to find out what's new.
|
15
16
|
|
16
17
|
|
17
18
|
|
18
19
|
## Usage in Gemfile
|
20
|
+
|
19
21
|
```ruby
|
20
22
|
gem 'repres-bootstrap'
|
21
23
|
```
|
@@ -23,6 +25,7 @@ gem 'repres-bootstrap'
|
|
23
25
|
|
24
26
|
|
25
27
|
## Include the Helper in your Application Controller before Render the Style or Script with the helper methods
|
28
|
+
|
26
29
|
```ruby
|
27
30
|
include Repres::Bootstrap::ApplicationHelper
|
28
31
|
include Repres::Bootstrap::FormHelper
|
@@ -31,6 +34,7 @@ include Repres::Bootstrap::FormHelper
|
|
31
34
|
|
32
35
|
|
33
36
|
## Render the Pre-defined Partials
|
37
|
+
|
34
38
|
```erb
|
35
39
|
<html>
|
36
40
|
|
@@ -64,9 +68,8 @@ include Repres::Bootstrap::FormHelper
|
|
64
68
|
</html>
|
65
69
|
```
|
66
70
|
|
67
|
-
|
68
|
-
|
69
71
|
### Render the Script
|
72
|
+
|
70
73
|
The Script partial includes the HTML script tags for Bootstrap and its extensions. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
|
71
74
|
|
72
75
|
The following code snippet does __not__ load any JavaScript library.
|
@@ -85,22 +88,22 @@ The following code snippet loads the latest Bootstrap JavaScript library.
|
|
85
88
|
|
86
89
|
The following code snippet loads the Bootstrap JavaScript library with the given version.
|
87
90
|
```erb
|
88
|
-
<%= render partial: 'repres/bootstrap/script', locals: { options: { bootstrap: { version: '3.3.5' } } }
|
89
|
-
%>
|
91
|
+
<%= render partial: 'repres/bootstrap/script', locals: { options: { bootstrap: { version: '3.3.5' } } } %>
|
90
92
|
<!-- or the following line works identically -->
|
91
93
|
<%= bootstrap_script bootstrap: { version: '3.3.5' } %>
|
92
94
|
```
|
93
95
|
|
94
96
|
The following JavaScript libraries are switchable, and the version can be configurable:
|
95
97
|
- :bootstrap
|
98
|
+
- :'bootstrap-material-design'
|
99
|
+
- :'flat-ui'
|
96
100
|
- :'bootstrap-datepicker'
|
97
101
|
- :'bootstrap-datetimepicker'
|
98
102
|
- :'bootstrap-fileinput'
|
99
103
|
- :'bootstrap-table'
|
100
104
|
|
101
|
-
|
102
|
-
|
103
105
|
### Render the Style
|
106
|
+
|
104
107
|
The Style partial includes the HTML style tags for Bootstrap and its extensions. Only the [Boot CDN](http://cdn.bootcss.com/) servers are supported.
|
105
108
|
|
106
109
|
The following code snippet does __not__ load any CSS library.
|
@@ -127,14 +130,15 @@ The following code snippet loads the Bootstrap CSS library with the given versio
|
|
127
130
|
The following CSS libraries are switchable, and the version can be configurable:
|
128
131
|
- :bootstrap
|
129
132
|
- :'bootstrap-theme'
|
133
|
+
- :'bootstrap-material-design'
|
134
|
+
- :'flat-ui'
|
130
135
|
- :'bootstrap-datepicker'
|
131
136
|
- :'bootstrap-datetimepicker'
|
132
137
|
- :'bootstrap-fileinput'
|
133
138
|
- :'bootstrap-table'
|
134
139
|
|
135
|
-
|
136
|
-
|
137
140
|
### Render the Form Field
|
141
|
+
|
138
142
|
The Form Field partial includes the HTML form field tags for Rails Form Builder and Bootstrap.
|
139
143
|
```erb
|
140
144
|
<%= render partial: 'repres/bootstrap/form_field',
|
@@ -165,9 +169,8 @@ The Form Field partial includes the HTML form field tags for Rails Form Builder
|
|
165
169
|
<%= bootstrap_form_field model: model, form: f, name: :photo, type: :file_field, input_accept: 'image/*' %>
|
166
170
|
```
|
167
171
|
|
168
|
-
|
169
|
-
|
170
172
|
### Render the Form Select Box
|
173
|
+
|
171
174
|
The Form Select Box partial includes the HTML select tags for Rails Form Builder and Bootstrap.
|
172
175
|
```ruby
|
173
176
|
<%= render partial: 'repres/bootstrap/form_select_box',
|
@@ -185,8 +188,6 @@ The Form Select Box partial includes the HTML select tags for Rails Form Builder
|
|
185
188
|
<%= bootstrap_form_select_box model: model, form: f, name: :country_id, choices: @countries.select('id, name').map { |country| [ country.name, country.id ] }, options: { prompt: '请选择国家' } %>
|
186
189
|
```
|
187
190
|
|
188
|
-
|
189
|
-
|
190
191
|
The 4 options are required: model, form, name, and type.
|
191
192
|
Here are more options:
|
192
193
|
- label_text: The customized label text.
|
@@ -217,6 +218,7 @@ Here are more options:
|
|
217
218
|
## Generators
|
218
219
|
|
219
220
|
### Platform generator
|
221
|
+
|
220
222
|
The platform generator generates a platform with a version number. The platform name is administration in the following example.
|
221
223
|
```shell
|
222
224
|
rails generate repres:bootstrap:platform administration --version 4
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
10
|
rdoc.rdoc_dir = 'rdoc'
|
11
11
|
rdoc.title = 'Repres Bootstrap'
|
12
12
|
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
@@ -20,5 +20,5 @@ load 'rails/tasks/statistics.rake'
|
|
20
20
|
|
21
21
|
|
22
22
|
|
23
|
-
|
23
|
+
require 'bundler/gem_tasks'
|
24
24
|
|
@@ -5,7 +5,7 @@
|
|
5
5
|
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
6
|
//
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
8
|
+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
|
9
9
|
//
|
10
10
|
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
@@ -6,9 +6,9 @@
|
|
6
6
|
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
7
7
|
*
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any
|
10
|
-
*
|
11
|
-
* file per style scope.
|
9
|
+
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
10
|
+
* files in this directory. Styles in this file should be added after the last require_* statement.
|
11
|
+
* It is generally better to create a new file per style scope.
|
12
12
|
*
|
13
13
|
*= require_self
|
14
14
|
*/
|
@@ -2,12 +2,13 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<title>Repres Bootstrap</title>
|
5
|
-
<%= stylesheet_link_tag
|
5
|
+
<%= stylesheet_link_tag 'repres/bootstrap/application', media: 'all' %>
|
6
6
|
<%= csrf_meta_tags %>
|
7
7
|
</head>
|
8
8
|
<body>
|
9
9
|
|
10
10
|
<%= yield %>
|
11
|
+
|
11
12
|
<%= javascript_include_tag 'repres/bootstrap/application' %>
|
12
13
|
|
13
14
|
</body>
|
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
<%= javascript_include_tag "//cdn.bootcss.com/bootstrap/#{library_version(:bootstrap, '3.3.7', options)}/js/bootstrap.min.js" if library_enabled?(:bootstrap, options) %>
|
4
4
|
|
5
|
+
<%= javascript_include_tag "//cdn.bootcss.com/bootstrap-material-design/#{library_version(:'bootstrap-material-design', '4.0.2', options)}/bootstrap-material-design.umd.min.js" if library_enabled?(:'bootstrap-material-design', options) %>
|
6
|
+
<%= javascript_include_tag "//cdn.bootcss.com/flat-ui/#{library_version(:'flat-ui', '2.3.0', options)}/js/flat-ui.min.js" if library_enabled?(:'flat-ui', options) %>
|
7
|
+
|
5
8
|
<%= javascript_include_tag "//cdn.bootcss.com/bootstrap-datepicker/#{library_version(:'bootstrap-datepicker', '1.6.2', options)}/js/bootstrap-datepicker.min.js" if library_enabled?(:'bootstrap-datepicker', options) %>
|
6
9
|
<%= javascript_include_tag "//cdn.bootcss.com/bootstrap-datetimepicker/#{library_version(:'bootstrap-datetimepicker', '4.17.37', options)}/js/bootstrap-datetimepicker.min.js" if library_enabled?(:'bootstrap-datetimepicker', options) %>
|
7
10
|
|
@@ -3,6 +3,9 @@
|
|
3
3
|
<%= stylesheet_link_tag "//cdn.bootcss.com/bootstrap/#{library_version :bootstrap, '3.3.7', options}/css/bootstrap.min.css", media: 'all' if library_enabled?(:bootstrap, options) %>
|
4
4
|
<%= stylesheet_link_tag "//cdn.bootcss.com/bootstrap/#{library_version(:'bootstrap-theme', '3.3.7', options)}/css/bootstrap-theme.min.css", media: 'all' if library_enabled?(:'bootstrap-theme', options) %>
|
5
5
|
|
6
|
+
<%= stylesheet_link_tag "//cdn.bootcss.com/bootstrap-material-design/#{library_version(:'bootstrap-material-design', '4.0.2', options)}/bootstrap-material-design.min.css", media: 'all' if library_enabled?(:'bootstrap-material-design', options) %>
|
7
|
+
<%= stylesheet_link_tag "//cdn.bootcss.com/flat-ui/#{library_version(:'flat-ui', '2.3.0', options)}/css/flat-ui.min.css", media: 'all' if library_enabled?(:'flat-ui', options) %>
|
8
|
+
|
6
9
|
<%= stylesheet_link_tag "//cdn.bootcss.com/bootstrap-datepicker/#{library_version(:'bootstrap-datepicker', '1.6.2', options)}/css/bootstrap-datepicker.min.css", media: 'all' if library_enabled?(:'bootstrap-datepicker', options) %>
|
7
10
|
<%= stylesheet_link_tag "//cdn.bootcss.com/bootstrap-datetimepicker/#{library_version(:'bootstrap-datetimepicker', '4.17.37', options)}/css/bootstrap-datetimepicker.min.css", media: 'all' if library_enabled?(:'bootstrap-datetimepicker', options) %>
|
8
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: repres-bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.4'
|
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-
|
11
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -50,11 +50,15 @@ files:
|
|
50
50
|
- MIT-LICENSE
|
51
51
|
- README.md
|
52
52
|
- Rakefile
|
53
|
+
- app/assets/config/repres-bootstrap_manifest.js
|
53
54
|
- app/assets/javascripts/repres/bootstrap/application.js
|
54
55
|
- app/assets/stylesheets/repres/bootstrap/application.css
|
55
56
|
- app/controllers/repres/bootstrap/application_controller.rb
|
56
57
|
- app/helpers/repres/bootstrap/application_helper.rb
|
57
58
|
- app/helpers/repres/bootstrap/form_helper.rb
|
59
|
+
- app/jobs/repres/bootstrap/application_job.rb
|
60
|
+
- app/mailers/repres/bootstrap/application_mailer.rb
|
61
|
+
- app/models/repres/bootstrap/application_record.rb
|
58
62
|
- app/views/layouts/repres/bootstrap/application.html.erb
|
59
63
|
- app/views/repres/bootstrap/_form_field.html.erb
|
60
64
|
- app/views/repres/bootstrap/_form_select_box.html.erb
|