bootstrap-generators 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/bootstrap/generators/version.rb +1 -1
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/controller/view.html.haml +3 -0
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/_form.html.haml +17 -0
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/edit.html.haml +6 -0
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/index.html.haml +23 -0
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/new.html.haml +5 -0
- data/lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/show.html.haml +10 -0
- data/test/lib/generators/bootstrap/install_generator_test.rb +14 -2
- data/vendor/assets/javascripts/bootstrap.js +7 -1
- metadata +16 -10
data/README.md
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
= form_for @<%= singular_table_name %> do |f|
|
2
|
+
-if @<%= singular_table_name %>.errors.any?
|
3
|
+
.alert-message.block-message.error
|
4
|
+
%p= "#{pluralize(@<%= singular_table_name %>.errors.count, "error")} prohibited this <%= singular_table_name %> from being saved:"
|
5
|
+
|
6
|
+
%ul
|
7
|
+
- @<%= singular_table_name %>.errors.full_messages.each do |msg|
|
8
|
+
%li= msg
|
9
|
+
|
10
|
+
<% for attribute in attributes -%>
|
11
|
+
.clearfix
|
12
|
+
= f.label :<%= attribute.name %>
|
13
|
+
.input
|
14
|
+
= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "<%= [:datetime_select, :date_select].include?(attribute.field_type) ? 'small' : 'xxlarge' %>"
|
15
|
+
<% end -%>
|
16
|
+
.actions
|
17
|
+
= f.submit :class => 'btn primary'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.page-header
|
2
|
+
= link_to 'New <%= human_name %>', new_<%= singular_table_name %>_path, :class => 'btn primary'
|
3
|
+
%h1 Listing <%= plural_table_name %>
|
4
|
+
|
5
|
+
%table.zebra-striped
|
6
|
+
%thead
|
7
|
+
%tr
|
8
|
+
<% for attribute in attributes -%>
|
9
|
+
%th <%= attribute.human_name %>
|
10
|
+
<% end -%>
|
11
|
+
%th
|
12
|
+
%th
|
13
|
+
%th
|
14
|
+
|
15
|
+
%tbody
|
16
|
+
- @<%= plural_table_name %>.each do |<%= singular_table_name %>|
|
17
|
+
%tr
|
18
|
+
<% for attribute in attributes -%>
|
19
|
+
%td= <%= singular_table_name %>.<%= attribute.name %>
|
20
|
+
<% end -%>
|
21
|
+
%td= link_to 'Show', <%= singular_table_name %>
|
22
|
+
%td= link_to 'Edit', edit_<%= singular_table_name %>_path(<%= singular_table_name %>)
|
23
|
+
%td= link_to 'Destroy', <%= singular_table_name %>, :confirm => 'Are you sure?', :method => :delete
|
@@ -0,0 +1,10 @@
|
|
1
|
+
.page-header
|
2
|
+
= link_to 'Back', <%= index_helper %>_path, :class => 'btn', :class => 'btn primary'
|
3
|
+
= link_to 'Edit', edit_<%= singular_table_name %>_path(@<%= singular_table_name %>)
|
4
|
+
%h1 Listing <%= plural_table_name %>
|
5
|
+
|
6
|
+
%dl
|
7
|
+
<%- for attribute in attributes -%>
|
8
|
+
%dt <%= attribute.human_name %>:
|
9
|
+
%dd= @<%= singular_table_name %>.<%= attribute.name %>
|
10
|
+
<%- end -%>
|
@@ -7,15 +7,27 @@ class Bootstrap::Generators::InstallGeneratorTest < ::Rails::Generators::TestCas
|
|
7
7
|
setup :prepare_destination
|
8
8
|
setup :copy_routes
|
9
9
|
|
10
|
-
test "should copy controller templates" do
|
10
|
+
test "should copy controller erb templates" do
|
11
11
|
run_generator
|
12
12
|
|
13
13
|
assert_file "lib/templates/erb/controller/view.html.erb"
|
14
14
|
end
|
15
15
|
|
16
|
-
test "should copy
|
16
|
+
test "should copy controller haml templates" do
|
17
|
+
run_generator
|
18
|
+
|
19
|
+
assert_file "lib/templates/haml/controller/view.html.haml"
|
20
|
+
end
|
21
|
+
|
22
|
+
test "should copy scaffold erb templates" do
|
17
23
|
run_generator
|
18
24
|
|
19
25
|
%w(index edit new show _form).each { |view| assert_file "lib/templates/erb/scaffold/#{view}.html.erb" }
|
20
26
|
end
|
27
|
+
|
28
|
+
test "should copy scaffold haml templates" do
|
29
|
+
run_generator
|
30
|
+
|
31
|
+
%w(index edit new show _form).each { |view| assert_file "lib/templates/haml/scaffold/#{view}.html.haml" }
|
32
|
+
end
|
21
33
|
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: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-10-
|
12
|
+
date: 2011-10-13 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
16
|
-
requirement: &
|
16
|
+
requirement: &2153119940 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.0.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2153119940
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: test-unit
|
27
|
-
requirement: &
|
27
|
+
requirement: &2153119500 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2153119500
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rails
|
38
|
-
requirement: &
|
38
|
+
requirement: &2153118560 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '3.0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2153118560
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: railties
|
49
|
-
requirement: &
|
49
|
+
requirement: &2153117360 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '3.0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2153117360
|
58
58
|
description: Bootstrap-generators provides Twitter Bootstrap generators for Rails
|
59
59
|
3. Bootstrap is a toolkit from Twitter designed to kickstart development of webapps
|
60
60
|
and sites. Checkout http://twitter.github.com/bootstrap.
|
@@ -83,6 +83,12 @@ files:
|
|
83
83
|
- lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/index.html.erb
|
84
84
|
- lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/new.html.erb
|
85
85
|
- lib/generators/bootstrap/install/templates/lib/templates/erb/scaffold/show.html.erb
|
86
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/controller/view.html.haml
|
87
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/_form.html.haml
|
88
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/edit.html.haml
|
89
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/index.html.haml
|
90
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/new.html.haml
|
91
|
+
- lib/generators/bootstrap/install/templates/lib/templates/haml/scaffold/show.html.haml
|
86
92
|
- test/fixtures/routes.rb
|
87
93
|
- test/lib/generators/bootstrap/install_generator_test.rb
|
88
94
|
- test/test_helper.rb
|