bootstrap-generators 3.0.2.1 → 3.0.2.2

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: 953bb2852e50cfb8cfeb9d19d9910b5f8b10cc58
4
- data.tar.gz: 187d2dc4f3e93977e38006742884c990a936e11d
3
+ metadata.gz: 592a1264654682f1478ba958b195ff9df58523d2
4
+ data.tar.gz: 17ceb7876c44641e4a9e4df1d22bb8c6c72054c4
5
5
  SHA512:
6
- metadata.gz: 6934877e91a9de2b144290e3381c1d0607c51ab47750d30fb23468f008d86fddbefa43e4765c3f2e124c39e48234d589d4a0718ac381e551d9530a7b547ba4c6
7
- data.tar.gz: 870299a392382f7236eb75483329a2f3712b539d4769e65f7fe55d0a8c7c20fccda76e4b273cd975bab71116ce38b518b20139d7545a4f2bb948c36eb8fc794c
6
+ metadata.gz: 5ad3ce7c4b689a4ee971ebd3d2111f6f5fce1d711bd146f0c91f3fb8b4ab7a2c3412157d5044471e98d59403fcab462c05aa42a8f58f20324cc469b38cad257b
7
+ data.tar.gz: e29b4ea34a22fe3240557d4455467ba98bd314087af62391cca2cf093cf3b391041ef805ca882d92e6a0ab51c12f8dfa17040ded5b79d1907c88df3c19ca8f40
data/README.md CHANGED
@@ -64,6 +64,9 @@ Supported template engines:
64
64
 
65
65
  * ERB
66
66
  * Haml
67
+ * Slim
68
+
69
+ ##### Haml
67
70
 
68
71
  Add the dependency on your Gemfile:
69
72
 
@@ -73,6 +76,17 @@ And then run:
73
76
 
74
77
  rails generate bootstrap:install --template-engine=haml
75
78
 
79
+ ##### Slim
80
+
81
+ Add the dependency on your Gemfile:
82
+
83
+ gem 'slim-rails'
84
+
85
+ And then run:
86
+
87
+ rails generate bootstrap:install --template-engine=slim
88
+
89
+
76
90
  #### Stylesheet engines
77
91
 
78
92
  Supported stylesheet engines:
@@ -1,5 +1,5 @@
1
1
  module Bootstrap
2
2
  module Generators
3
- VERSION = "3.0.2.1"
3
+ VERSION = "3.0.2.2"
4
4
  end
5
5
  end
@@ -0,0 +1,18 @@
1
+ = form_for(@<%= singular_table_name %>, :html => { :class => "form-horizontal" }) do |f|
2
+ - if @<%= singular_table_name %>.errors.any?
3
+ .alert.alert-danger.alert-dismissable
4
+ button.close type="button" data-dismiss="alert" aria-hidden="true"
5
+ | &times;
6
+ h4= "#{pluralize(@<%= singular_table_name %>.errors.count,"error")} prohibited this <%= singular_table_name %> from being saved:"
7
+ ul
8
+ - @<%= singular_table_name %>.errors.full_messages.each do |msg|
9
+ li= msg
10
+ <%- attributes.each do |attribute| -%>
11
+ .form-group
12
+ = f.label :<%= attribute.name %>, :class => "col-lg-2 control-label"
13
+ .col-lg-10
14
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control"
15
+ <%- end -%>
16
+ .form-group
17
+ .col-lg-offset-2.col-lg-10
18
+ = f.submit :class => "btn btn-primary"
@@ -0,0 +1,42 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta charset="utf-8"
5
+ title
6
+ | Starter Template for Bootstrap
7
+ meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
8
+ meta name="description" content=""
9
+ meta name="author" content=""
10
+ /! HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries
11
+ /[if lt IE 9]
12
+ = javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"
13
+ = stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true
14
+ = javascript_include_tag "application", "data-turbolinks-track" => true
15
+ = csrf_meta_tags
16
+ body
17
+ .navbar.navbar-inverse.navbar-fixed-top
18
+ .container
19
+ .navbar-header
20
+ button.navbar-toggle type="button" data-toggle="collapse" data-target=".navbar-collapse"
21
+ span.icon-bar
22
+ span.icon-bar
23
+ span.icon-bar
24
+ = link_to "Project name", "#", :class => "navbar-brand"
25
+ .collapse.navbar-collapse
26
+ ul.nav.navbar-nav
27
+ li.active
28
+ a href="#"
29
+ | Home
30
+ li
31
+ a href="#about"
32
+ | About
33
+ li
34
+ a href="#contact"
35
+ | Contact
36
+ .container
37
+ - flash.each do |name, msg|
38
+ = content_tag :div, :class => "alert alert-#{ name == :error ? "danger" : "success" } alert-dismissable" do
39
+ button.close type="button" data-dismiss="alert" aria-hidden="true"
40
+ | &times;
41
+ = msg
42
+ = yield
@@ -0,0 +1,5 @@
1
+ .page-header
2
+ h1
3
+ | <%= class_name %>#<%= @action %>
4
+ p
5
+ | Find me in <%= @path %>
@@ -0,0 +1,12 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ = link_to @<%= singular_table_name %>, :class => 'btn btn-primary' do
6
+ span.glyphicon.glyphicon-info-sign
7
+ | Show
8
+ h1
9
+ | Editing
10
+ | <%= singular_table_name %>
11
+
12
+ = render 'form'
@@ -0,0 +1,31 @@
1
+ .page-header
2
+ = link_to new_<%= singular_table_name %>_path, :class => 'btn btn-primary' do
3
+ span.glyphicon.glyphicon-plus
4
+ | New <%= human_name %>
5
+ h1
6
+ | Listing <%= plural_table_name %>
7
+
8
+ .table-responsive
9
+ table.table.table-striped.table-bordered.table-hover
10
+ thead
11
+ tr
12
+ <%- for attribute in attributes -%>
13
+ th
14
+ | <%= attribute.human_name %>
15
+ <%- end -%>
16
+ th
17
+ th
18
+ th
19
+ tbody
20
+ - @<%= plural_table_name %>.each do | <%= singular_table_name %> |
21
+ tr
22
+ <%- for attribute in attributes -%>
23
+ td
24
+ = <%= singular_table_name %>.<%= attribute.name %>
25
+ <%- end -%>
26
+ td
27
+ = link_to 'Show', <%= singular_table_name %>
28
+ td
29
+ = link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
30
+ td
31
+ = link_to 'Destroy', <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }
@@ -0,0 +1,9 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ h1
6
+ | New
7
+ | <%= singular_table_name %>
8
+
9
+ = render 'form'
@@ -0,0 +1,16 @@
1
+ .page-header
2
+ = link_to <%= index_helper %>_path, :class => 'btn btn-default' do
3
+ span.glyphicon.glyphicon-list-alt
4
+ | Back
5
+ = link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class => 'btn btn-primary' do
6
+ span.glyphicon.glyphicon-pencil
7
+ | Edit
8
+ h1
9
+ | Show <%= singular_table_name %>
10
+ dl.dl-horizontal
11
+ <%- for attribute in attributes -%>
12
+ dt
13
+ | <%= attribute.human_name %>:
14
+ dd
15
+ = @<%= singular_table_name %>.<%= attribute.name %>
16
+ <%- end -%>
@@ -14,13 +14,24 @@ class InstallGeneratorTest < Rails::Generators::TestCase
14
14
 
15
15
  assert_file "lib/templates/erb/controller/view.html.erb"
16
16
  assert_no_file "lib/templates/haml/controller/view.html.haml"
17
+ assert_no_file "lib/templates/slim/controller/view.html.slim"
17
18
  end
18
19
 
20
+ test "should copy controller slim templates" do
21
+ run_generator %w(--template-engine slim)
22
+
23
+ assert_file "lib/templates/slim/controller/view.html.slim"
24
+ assert_no_file "lib/templates/erb/controller/view.html.erb"
25
+ assert_no_file "lib/templates/haml/controller/view.html.haml"
26
+ end
27
+
28
+
19
29
  test "should copy controller haml templates" do
20
30
  run_generator %w(--template-engine haml)
21
31
 
22
32
  assert_file "lib/templates/haml/controller/view.html.haml"
23
33
  assert_no_file "lib/templates/erb/controller/view.html.erb"
34
+ assert_no_file "lib/templates/slim/controller/view.html.slim"
24
35
  end
25
36
 
26
37
  test "should copy scaffold erb templates" do
@@ -29,15 +40,28 @@ class InstallGeneratorTest < Rails::Generators::TestCase
29
40
  %w(index edit new show _form).each { |view|
30
41
  assert_file "lib/templates/erb/scaffold/#{view}.html.erb"
31
42
  assert_no_file "lib/templates/haml/scaffold/#{view}.html.haml"
43
+ assert_no_file "lib/templates/slim/scaffold/#{view}.html.slim"
32
44
  }
33
45
  end
34
46
 
47
+ test "should copy scaffold slim templates" do
48
+ run_generator %w(--template-engine slim)
49
+
50
+ %w(index edit new show _form).each { |view|
51
+ assert_file "lib/templates/slim/scaffold/#{view}.html.slim"
52
+ assert_no_file "lib/templates/erb/scaffold/#{view}.html.erb"
53
+ assert_no_file "lib/templates/haml/scaffold/#{view}.html.haml"
54
+ }
55
+ end
56
+
57
+
35
58
  test "should copy scaffold haml templates" do
36
59
  run_generator %w(--template-engine haml)
37
60
 
38
61
  %w(index edit new show _form).each { |view|
39
62
  assert_file "lib/templates/haml/scaffold/#{view}.html.haml"
40
63
  assert_no_file "lib/templates/erb/scaffold/#{view}.html.erb"
64
+ assert_no_file "lib/templates/slim/scaffold/#{view}.html.slim"
41
65
  }
42
66
  end
43
67
 
@@ -75,8 +99,14 @@ class InstallGeneratorTest < Rails::Generators::TestCase
75
99
  assert_file "app/assets/stylesheets/bootstrap-variables.less"
76
100
  end
77
101
 
102
+ test "should create slim layout" do
103
+ run_generator %w(--template-engine slim)
104
+
105
+ assert_file "app/views/layouts/application.html.slim"
106
+ end
107
+
78
108
  test "should create erb layout" do
79
- run_generator
109
+ run_generator
80
110
 
81
111
  assert_file "app/views/layouts/application.html.erb"
82
112
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2.1
4
+ version: 3.0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Décio Ferreira
@@ -91,8 +91,10 @@ files:
91
91
  - lib/generators/bootstrap/install/templates/assets/stylesheets/starter.scss
92
92
  - lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.erb
93
93
  - lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.haml
94
+ - lib/generators/bootstrap/install/templates/form_builders/form_builder/_form.html.slim
94
95
  - lib/generators/bootstrap/install/templates/layouts/starter.html.erb
95
96
  - lib/generators/bootstrap/install/templates/layouts/starter.html.haml
97
+ - lib/generators/bootstrap/install/templates/layouts/starter.html.slim
96
98
  - lib/generators/bootstrap/install/templates/lib/templates/erb/controller/view.html.erb
97
99
  - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/edit.html.erb
98
100
  - lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/index.html.erb
@@ -103,6 +105,11 @@ files:
103
105
  - lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/index.html.haml
104
106
  - lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/new.html.haml
105
107
  - lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/show.html.haml
108
+ - lib/generators/bootstrap/install/templates/lib/templates/slim/controller/view.html.slim
109
+ - lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/edit.html.slim
110
+ - lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/index.html.slim
111
+ - lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/new.html.slim
112
+ - lib/generators/bootstrap/install/templates/lib/templates/slim/scaffold/show.html.slim
106
113
  - readme-template.md.erb
107
114
  - test/fixtures/application.js
108
115
  - test/fixtures/routes.rb