unirer-bootstrap 0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1999217d153e8eb5c35f2703867a6c1e7c22a33c
4
+ data.tar.gz: 1ae66f70b9c2d7de6e8c2b39a65a68c3bf3238c2
5
+ SHA512:
6
+ metadata.gz: c2f79afb95fbc89ac31c2fbb37f725f98c67ec984f32ad86093a55286796c1cca7de562abc2a613921191b4685f82087b8a95c44dab2ea0699c7468d860341c6
7
+ data.tar.gz: 5f45d120fb087b085cbfae4729ada9cecbcdba6964066b542562fda8d8632e6241a03399c0c78b8aff5c1e1fa07abaaa74f4f08f452876dabba9b36a3cdb7d75
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Topbit Du
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,18 @@
1
+ # Unirer Bootstrap
2
+
3
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT)
4
+
5
+ Unirer (UNIfied Resource Representation) is a series of resource representation engines. The Bootstrap resource representation engine includes Bootstrap-based resource representation templates & snippets.
6
+ Unirer (统一资源表现)是一系列的资源表现引擎。Bootstrap 资源表现引擎包括基于Bootstrap的资源表现模版和片段。
7
+
8
+ ## Usage in Gemfile:
9
+ ```ruby
10
+ gem 'unirer-bootstrap'
11
+ ```
12
+
13
+ ## Include the Concern in Controllers & Respond the Calls:
14
+ ```erb
15
+ <%= render partial: 'unirer/bootstrap/script' %>
16
+ <%= render partial: 'unirer/bootstrap/style' %>
17
+ <%= render partial: 'unirer/bootstrap/form_field', locals: { model: model, form: f, name: :phone_number, type: :tel_field } %>
18
+ ```
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Unirer Bootstrap'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+ load 'rails/tasks/statistics.rake'
20
+
21
+
22
+
23
+ Bundler::GemHelper.install_tasks
24
+
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
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.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
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 styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,2 @@
1
+ class Unirer::Bootstrap::ApplicationController < ActionController::Base
2
+ end
@@ -0,0 +1,2 @@
1
+ module Unirer::Bootstrap::ApplicationHelper
2
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Bootstrap</title>
5
+ <%= stylesheet_link_tag "bootstrap/application", media: "all" %>
6
+ <%= javascript_include_tag "bootstrap/application" %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,40 @@
1
+ <%
2
+ model = options[:model]
3
+ form = options[:form]
4
+ name = options[:name]
5
+ type = options[:type]||:text_field
6
+
7
+ label_class = [ 'control-label', options[:label_class]||'col-xs-2' ].flatten.join ' '
8
+ field_class = [ options[:field_class]||'col-xs-10 input-group' ].flatten.join ' '
9
+ error_class = [ options[:error_class]||'col-xs-offset-2 col-xs-10 text-danger' ].flatten.join ' '
10
+
11
+ prefix = options[:prefix]
12
+ suffix = options[:suffix]
13
+
14
+ field_options = {
15
+ disabled: options[:disabled],
16
+ class: 'form-control',
17
+ placeholder: options[:placeholder],
18
+ readonly: options[:readonly],
19
+ maxlength: options[:maxlength],
20
+ required: options[:required]
21
+ }
22
+ %>
23
+
24
+ <div class='form-group'>
25
+ <%= form.label name, class: label_class %>
26
+ <div class='<%= field_class %>'>
27
+ <% if prefix.present? %>
28
+ <span class='input-group-addon'><%= prefix %></span>
29
+ <% end %>
30
+
31
+ <%= form.send type, name, field_options %>
32
+
33
+ <% if suffix.present? %>
34
+ <span class='input-group-addon'><%= suffix %></span>
35
+ <% end %>
36
+ </div>
37
+ <% if model.errors[name].present? %>
38
+ <p class='<%= error_class %>'><%= model.errors[name].first %></p>
39
+ <% end %>
40
+ </div>
@@ -0,0 +1,8 @@
1
+ <%= javascript_include_tag '//cdn.bootcss.com/jquery/2.2.0/jquery.min.js' %>
2
+ <%= javascript_include_tag '//cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js' %>
3
+
4
+ <%= javascript_include_tag '//cdn.bootcss.com/moment.js/2.11.1/moment-with-locales.min.js' %>
5
+ <%= javascript_include_tag '//cdn.bootcss.com/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js' %>
6
+
7
+ <%= javascript_include_tag '//cdn.bootcss.com/react/0.14.6/react.min.js' %>
8
+ <%= javascript_include_tag '//cdn.bootcss.com/react/0.14.6/react-dom.min.js' %>
@@ -0,0 +1,4 @@
1
+ <%= stylesheet_link_tag '//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css', media: 'all' %>
2
+ <%= stylesheet_link_tag '//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css', media: 'all' %>
3
+
4
+ <%= stylesheet_link_tag '//cdn.bootcss.com/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css', media: 'all' %>
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Unirer::Bootstrap::Engine.routes.draw do
2
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bootstrap do
3
+ # # Task goes here
4
+ # end
@@ -0,0 +1,6 @@
1
+ require 'unirer/bootstrap/engine'
2
+
3
+ module Unirer
4
+ module Bootstrap
5
+ end
6
+ end
@@ -0,0 +1,23 @@
1
+ module Unirer
2
+ module Bootstrap
3
+
4
+ class Engine < ::Rails::Engine
5
+
6
+ config.autoload_paths += %W(
7
+ #{config.root}/lib
8
+ #{config.root}/app/controllers/unirer/bootstrap/concerns
9
+ #{config.root}/app/models/unirer/bootstrap/concerns
10
+ )
11
+
12
+ config.eager_load_paths += %W(
13
+ #{config.root}/lib
14
+ #{config.root}/app/controllers/unirer/bootstrap/concerns
15
+ #{config.root}/app/models/unirer/bootstrap/concerns
16
+ )
17
+
18
+ isolate_namespace Unirer::Bootstrap
19
+
20
+ end
21
+
22
+ end
23
+ end
@@ -0,0 +1,5 @@
1
+ module Unirer
2
+ module Bootstrap
3
+ VERSION = '0.1'.freeze
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: unirer-bootstrap
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ platform: ruby
6
+ authors:
7
+ - Topbit Du
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ description: Unirer (UNIfied Resource Representation) is a series of resource representation
28
+ engines. The Bootstrap resource representation engine includes Bootstrap-based resource
29
+ representation templates & snippets. Unirer (统一资源表现)是一系列的资源表现引擎。Bootstrap 资源表现引擎包括基于Bootstrap的资源表现模版和片段。
30
+ email:
31
+ - topbit.du@gmail.com
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - MIT-LICENSE
37
+ - README.md
38
+ - Rakefile
39
+ - app/assets/javascripts/unirer/bootstrap/application.js
40
+ - app/assets/stylesheets/unirer/bootstrap/application.css
41
+ - app/controllers/unirer/bootstrap/application_controller.rb
42
+ - app/helpers/unirer/bootstrap/application_helper.rb
43
+ - app/views/layouts/unirer/bootstrap/application.html.erb
44
+ - app/views/unirer/bootstrap/_form_field.html.erb
45
+ - app/views/unirer/bootstrap/_script.html.erb
46
+ - app/views/unirer/bootstrap/_style.html.erb
47
+ - config/routes.rb
48
+ - lib/tasks/bootstrap_tasks.rake
49
+ - lib/unirer/bootstrap.rb
50
+ - lib/unirer/bootstrap/engine.rb
51
+ - lib/unirer/bootstrap/version.rb
52
+ homepage: https://github.com/topbitdu/unirer-bootstrap
53
+ licenses:
54
+ - MIT
55
+ metadata: {}
56
+ post_install_message:
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubyforge_project:
72
+ rubygems_version: 2.4.5.1
73
+ signing_key:
74
+ specification_version: 4
75
+ summary: The Unirer Bootstrap resource representation engine includes Bootstrap-based
76
+ resource representation templates & snippets.
77
+ test_files: []