BootstrapMan 0.1.3 → 0.1.4
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 +4 -4
- data/README.md +1 -1
- data/lib/BootstrapMan/version.rb +1 -1
- data/lib/generators/bootstrap/install/install_generator.rb +4 -1
- data/lib/templates/erb/scaffold/_form.html.erb +46 -0
- data/lib/templates/erb/scaffold/edit.html.erb +3 -0
- data/lib/templates/erb/scaffold/index.html.erb +51 -0
- data/lib/templates/erb/scaffold/new.html.erb +3 -0
- data/lib/templates/erb/scaffold/show.html.erb +19 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 765f621ad2c8ac71288a758a82f448ba2d4e4540724c1740f4777a89e41a65d1
|
4
|
+
data.tar.gz: 05bbb01b680566f331a6c912bce65e47f47706a8fd6e4a2edc2110ddcae19d81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce7330149634c380f90fff8fe09ce73f34943b605a82c7f9be25fdae066c31bf3a431d61a726124ebdd0d6faca3db1f10920cc63263b9c058d09a3c785e91e77
|
7
|
+
data.tar.gz: f45af3d358df9c2cc3b0ac2935ae3d45e79c092ae82951c3c142471b721f6d1eca6488c310e2d865f437c2add31d2fd4179ab14d4b5c32ff0aad609c2fab0fa1
|
data/README.md
CHANGED
data/lib/BootstrapMan/version.rb
CHANGED
@@ -8,7 +8,7 @@ module Bootstrap
|
|
8
8
|
attr_reader :app_name
|
9
9
|
|
10
10
|
def setup
|
11
|
-
# Adding
|
11
|
+
# Adding Assets
|
12
12
|
js_manifest = 'app/assets/javascripts/application.js'
|
13
13
|
|
14
14
|
if File.exist?(js_manifest)
|
@@ -43,6 +43,9 @@ module Bootstrap
|
|
43
43
|
template "_navbar.html.#{ext}", "app/views/shared/_navbar.html.#{ext}"
|
44
44
|
template "_footer.html.#{ext}", "app/views/shared/_footer.html.#{ext}"
|
45
45
|
|
46
|
+
# Adding Templates Folder for future Generators
|
47
|
+
directory 'lib', 'lib/templates'
|
48
|
+
|
46
49
|
append_to_file "Gemfile", "# Adding gems required by BootstrapMan\ngem 'jquery-rails'\ngem 'bootstrap'\ngem 'font-awesome-rails'\ngem 'bootstrap_form'\n"
|
47
50
|
end
|
48
51
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<%%= form_with(model: <%= model_resource_name %>, local: true) do |form| %>
|
2
|
+
<%% if <%= singular_table_name %>.errors.any? %>
|
3
|
+
<div id="error_explanation">
|
4
|
+
<h2><%%= pluralize(<%= singular_table_name %>.errors.count, "error") %> prohibited this <%= singular_table_name %> from being saved:</h2>
|
5
|
+
|
6
|
+
<ul>
|
7
|
+
<%% <%= singular_table_name %>.errors.full_messages.each do |message| %>
|
8
|
+
<li><%%= message %></li>
|
9
|
+
<%% end %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
<%% end %>
|
13
|
+
|
14
|
+
<% attributes.each do |attribute| -%>
|
15
|
+
<div class="form-group">
|
16
|
+
<% if attribute.password_digest? -%>
|
17
|
+
<%%= form.label :password %>
|
18
|
+
<%%= form.password_field :password, class: 'form-control' %>
|
19
|
+
</div>
|
20
|
+
|
21
|
+
<div class="form-group">
|
22
|
+
<%%= form.label :password_confirmation %>
|
23
|
+
<%%= form.password_field :password_confirmation, class: 'form-control' %>
|
24
|
+
<% else -%>
|
25
|
+
<%%= form.label :<%= attribute.column_name %> %>
|
26
|
+
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: 'form-control' %>
|
27
|
+
<% end -%>
|
28
|
+
</div>
|
29
|
+
|
30
|
+
<% end -%>
|
31
|
+
<div class="form-group">
|
32
|
+
<%% if <%= model_resource_name %>.persisted? %>
|
33
|
+
<div class="float-right">
|
34
|
+
<%%= link_to 'Destroy', <%= model_resource_name %>, method: :delete, class: "text-danger", data: { confirm: 'Are you sure?' } %>
|
35
|
+
</div>
|
36
|
+
<%% end %>
|
37
|
+
|
38
|
+
<%%= form.submit class: 'btn btn-primary' %>
|
39
|
+
|
40
|
+
<%% if <%= model_resource_name %>.persisted? %>
|
41
|
+
<%%= link_to "Cancel", <%= model_resource_name %>, class: "btn btn-link" %>
|
42
|
+
<%% else %>
|
43
|
+
<%%= link_to "Cancel", <%= index_helper %>_path, class: "btn btn-link" %>
|
44
|
+
<%% end %>
|
45
|
+
</div>
|
46
|
+
<%% end %>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
<% name_attribute = attributes.find{ |a| a.name == "name" } %>
|
2
|
+
<% has_name = !!name_attribute %>
|
3
|
+
|
4
|
+
<div class="row">
|
5
|
+
<div class="col-sm-6">
|
6
|
+
<h1><%= plural_table_name.capitalize %></h1>
|
7
|
+
</div>
|
8
|
+
|
9
|
+
<div class="col-sm-6 text-right">
|
10
|
+
<%%= link_to new_<%= singular_table_name %>_path, class: 'btn btn-primary' do %>
|
11
|
+
Add New <%= human_name %>
|
12
|
+
<%% end %>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="table-responsive">
|
17
|
+
<table class="table table-striped table-bordered table-hover">
|
18
|
+
<thead>
|
19
|
+
<tr>
|
20
|
+
<% if has_name %>
|
21
|
+
<th>Name</th>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<% attributes.without(name_attribute).each do |attribute| -%>
|
25
|
+
<th><%= attribute.human_name %></th>
|
26
|
+
<% end -%>
|
27
|
+
<% unless has_name %>
|
28
|
+
<th></th>
|
29
|
+
<% end %>
|
30
|
+
</tr>
|
31
|
+
</thead>
|
32
|
+
|
33
|
+
<tbody>
|
34
|
+
<%% @<%= plural_table_name%>.each do |<%= singular_table_name %>| %>
|
35
|
+
<%%= content_tag :tr, id: dom_id(<%= singular_table_name %>), class: dom_class(<%= singular_table_name %>) do %>
|
36
|
+
<% if has_name %>
|
37
|
+
<td><%%= link_to <%= singular_table_name %>.name, <%= singular_table_name %> %></td>
|
38
|
+
<% end %>
|
39
|
+
|
40
|
+
<% attributes.without(name_attribute).each do |attribute| -%>
|
41
|
+
<td><%%= <%= singular_table_name %>.<%= attribute.name %> %></td>
|
42
|
+
<% end -%>
|
43
|
+
|
44
|
+
<% unless has_name %>
|
45
|
+
<td><%%= link_to 'Show', <%= singular_table_name %> %></td>
|
46
|
+
<% end %>
|
47
|
+
<%% end %>
|
48
|
+
<%% end %>
|
49
|
+
</tbody>
|
50
|
+
</table>
|
51
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="page-header">
|
2
|
+
<%%= link_to <%= index_helper %>_path, class: 'btn btn-default' do %>
|
3
|
+
<span class="glyphicon glyphicon-list-alt"></span>
|
4
|
+
All <%= plural_table_name.capitalize %>
|
5
|
+
<%% end %>
|
6
|
+
<%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-primary' do %>
|
7
|
+
<span class="glyphicon glyphicon-pencil"></span>
|
8
|
+
Edit
|
9
|
+
<%% end %>
|
10
|
+
<h1>Show <%= singular_table_name %></h1>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<dl class="dl-horizontal">
|
14
|
+
<%- attributes.each do |attribute| -%>
|
15
|
+
<dt><%= attribute.human_name %>:</dt>
|
16
|
+
<dd><%%= @<%= singular_table_name %>.<%= attribute.name %> %></dd>
|
17
|
+
|
18
|
+
<%- end -%>
|
19
|
+
</dl>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: BootstrapMan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMental
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -162,6 +162,11 @@ files:
|
|
162
162
|
- lib/generators/bootstrap/strapify/templates/show.html.erb
|
163
163
|
- lib/generators/bootstrap/strapify/templates/show.html.haml
|
164
164
|
- lib/generators/bootstrap/strapify/templates/show.html.slim
|
165
|
+
- lib/templates/erb/scaffold/_form.html.erb
|
166
|
+
- lib/templates/erb/scaffold/edit.html.erb
|
167
|
+
- lib/templates/erb/scaffold/index.html.erb
|
168
|
+
- lib/templates/erb/scaffold/new.html.erb
|
169
|
+
- lib/templates/erb/scaffold/show.html.erb
|
165
170
|
homepage: https://github.com/AndyMental/bootstrap-man
|
166
171
|
licenses:
|
167
172
|
- MIT
|
@@ -181,8 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
186
|
- !ruby/object:Gem::Version
|
182
187
|
version: '0'
|
183
188
|
requirements: []
|
184
|
-
|
185
|
-
rubygems_version: 2.7.6
|
189
|
+
rubygems_version: 3.0.3
|
186
190
|
signing_key:
|
187
191
|
specification_version: 4
|
188
192
|
summary: Tool to setup Bootstrap with Bootstrap View Generators including Bootstrap
|