BootstrapMan 0.1.3 → 0.1.4

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
  SHA256:
3
- metadata.gz: 6c61c830bf356cd02aec2bbf80ad32058d03b360984c1e16f7301ad90598c930
4
- data.tar.gz: d743f0577b2a956da36637e2616015b20c3bce6e44bb213ce96937570bbe54a2
3
+ metadata.gz: 765f621ad2c8ac71288a758a82f448ba2d4e4540724c1740f4777a89e41a65d1
4
+ data.tar.gz: 05bbb01b680566f331a6c912bce65e47f47706a8fd6e4a2edc2110ddcae19d81
5
5
  SHA512:
6
- metadata.gz: e4f9142ab302fae41ef867cbeb6ba227d8d9dfd6137527654a66097d0658d698d4402ce60d371820fc75bc951f7fb2fac1a9d0a4dbe702fa28ef0def10ab109f
7
- data.tar.gz: 985c6802bb40d7f11b5a54541701a15e0014ad80d2c31da815081ac5567b14f639b4223334ee7b58d0dcf996ac77716b183087a143d1785fc39abe528f07c344
6
+ metadata.gz: ce7330149634c380f90fff8fe09ce73f34943b605a82c7f9be25fdae066c31bf3a431d61a726124ebdd0d6faca3db1f10920cc63263b9c058d09a3c785e91e77
7
+ data.tar.gz: f45af3d358df9c2cc3b0ac2935ae3d45e79c092ae82951c3c142471b721f6d1eca6488c310e2d865f437c2add31d2fd4179ab14d4b5c32ff0aad609c2fab0fa1
data/README.md CHANGED
@@ -9,7 +9,7 @@ You don't need to customize the stylesheets manually, the only gem you need is t
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'BootstrapMan', '~> 0.1.3'
12
+ gem 'BootstrapMan', '~> 0.1.4'
13
13
  ```
14
14
 
15
15
  And then execute:
@@ -1,3 +1,3 @@
1
1
  module BootstrapMan
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -8,7 +8,7 @@ module Bootstrap
8
8
  attr_reader :app_name
9
9
 
10
10
  def setup
11
- # Adding Templates
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,3 @@
1
+ <h1>Edit <%= singular_table_name.capitalize %></h1>
2
+
3
+ <%%= render 'form', <%= singular_table_name %>: @<%= singular_table_name %> %>
@@ -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,3 @@
1
+ <h1>New <%= singular_table_name %></h1>
2
+
3
+ <%%= render 'form', <%= singular_table_name %>: @<%= singular_table_name %> %>
@@ -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.3
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-06 00:00:00.000000000 Z
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
- rubyforge_project:
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