draft_generators 0.0.6 → 0.0.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65ecce33b187d9753531ef6dbcefea0bd1e69daf0c1794fa2e7e5207f4cf1cbc
4
- data.tar.gz: fa9ae86f0ae1fb1958026bfe4ff690ec562469e985439e67b6885d45810caef5
3
+ metadata.gz: 3354edf9392d768ed4b0651cbe2e417282b0938f310081559c1730ffd8f4fdb2
4
+ data.tar.gz: 5cebddd1e8e7920e28fa3b5ca8895bc4eb7b75b39ff8aa10f3930b3b7aaf4639
5
5
  SHA512:
6
- metadata.gz: 76a8f0d41386fb37cae6338d14466175e222ecba71c6eb80ffa684627be8ef1a11ed22349ac8cc8a5ba4d2794e4a40b52dc4ffa9246eceb345f6b5e680b4cacb
7
- data.tar.gz: f92466be845487a7e8eb1027c4e04d18b74fbbdc6c01a0e481e50efa0c1bddaecabd2af47a6d9c6fa3c8e1f22a2a7d48480c0d97b2362b57416e84b99e152ccd
6
+ metadata.gz: e2bb35a35b221cd8f1bdb9939e4e9df456dd8bd74fe2cbc105b4ae48bb21f50cb3b58cab84a5d967a3d67417c5097b247f24753f198097d5e798cd09cd1d3a15
7
+ data.tar.gz: 923249f07997b666c50aa0dc05dc56ad8bac9dcc7c6068c9079e7dfd557bdfc4ea867ecc1e4e77d42bfcb2ebe0753383e0817f19fd5184c811cc0193b094a281
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "draft_generators".freeze
9
- s.version = "0.0.6"
9
+ s.version = "0.0.7"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
@@ -61,7 +61,7 @@
61
61
  <% end -%>
62
62
 
63
63
  <% end -%>
64
- <button>
64
+ <button type="submit">
65
65
  Create <%= singular_table_name.humanize.downcase %>
66
66
  </button>
67
67
  </form>
@@ -1,13 +1,26 @@
1
- <h1>You created <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!</h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
4
+ <li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
2
7
 
3
- <p>
4
- There are now <%%= @current_count %> <%= plural_table_name.humanize.downcase %>.
5
- </p>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ You created <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
12
+ </h1>
13
+ </header>
6
14
 
7
- <p>
8
- <a href="/<%= @plural_table_name.underscore %>">
9
- Click here
10
- </a>
15
+ <p>
16
+ There are now <%%= @current_count %> <%= plural_table_name.humanize.downcase %>.
17
+ </p>
11
18
 
12
- to go back.
13
- </p>
19
+ <p>
20
+ <a href="/<%= plural_table_name.underscore %>">
21
+ Click here
22
+ </a>
23
+
24
+ to go back.
25
+ </p>
26
+ </div>
@@ -1,13 +1,26 @@
1
- <h1>You deleted <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!</h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
4
+ <li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
2
7
 
3
- <p>
4
- There are now <%%= @remaining_count %> <%= plural_table_name.humanize.downcase %>.
5
- </p>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ You deleted <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
12
+ </h1>
13
+ </header>
6
14
 
7
- <p>
8
- <a href="/<%= @plural_table_name.underscore %>">
9
- Click here
10
- </a>
15
+ <p>
16
+ There are now <%%= @remaining_count %> <%= plural_table_name.humanize.downcase %>.
17
+ </p>
11
18
 
12
- to go back.
13
- </p>
19
+ <p>
20
+ <a href="/<%= plural_table_name.underscore %>">
21
+ Click here
22
+ </a>
23
+
24
+ to go back.
25
+ </p>
26
+ </div>
@@ -1,72 +1,75 @@
1
- <h1>
2
- Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
3
- </h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
4
+ <li>Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
4
7
 
5
- <hr>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
12
+ </h1>
13
+ </header>
6
14
 
7
15
  <% if with_sentinels? -%>
8
- <!-- Form <%= singular_table_name %> start -->
16
+ <!-- Form <%= singular_table_name %> start -->
9
17
  <% end -%>
10
- <form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
18
+ <form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
11
19
  <% if with_sentinels? -%>
12
- <!-- Form <%= singular_table_name %> end -->
20
+ <!-- Form <%= singular_table_name %> end -->
13
21
  <% end -%>
14
22
 
15
23
  <% attributes.each do |attribute| -%>
16
24
  <% if with_sentinels? -%>
17
- <!-- Label and input for <%= attribute.column_name %> start -->
25
+ <!-- Label and input for <%= attribute.column_name %> start -->
18
26
  <% end -%>
19
27
  <% if [:check_box, :checkbox].include?(attribute.field_type) -%>
20
- <div>
21
- <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
28
+ <div>
29
+ <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
22
30
  <% if with_sentinels? -%>
23
- <!-- Input for <%= attribute.column_name %> start -->
31
+ <!-- Input for <%= attribute.column_name %> start -->
24
32
  <% end -%>
25
- <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
33
+ <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
26
34
  <% if with_sentinels? -%>
27
- <!-- Input for <%= attribute.column_name %> end -->
35
+ <!-- Input for <%= attribute.column_name %> end -->
28
36
  <% end -%>
29
- <label for="<%= attribute.column_name %>_field">
30
- <%= attribute.column_name.humanize %>
31
- </label>
32
- </div>
37
+ <label for="<%= attribute.column_name %>_field">
38
+ <%= attribute.column_name.humanize %>
39
+ </label>
40
+ </div>
33
41
  <% else -%>
34
- <div>
35
- <label for="<%= attribute.column_name %>_field">
36
- <%= attribute.column_name.humanize %>
37
- </label>
42
+ <div>
43
+ <label for="<%= attribute.column_name %>_field">
44
+ <%= attribute.column_name.humanize %>
45
+ </label>
38
46
 
39
47
  <% if [:text_area, :textarea].include?(attribute.field_type) -%>
40
48
  <% if with_sentinels? -%>
41
- <!-- Input for <%= attribute.column_name %> start -->
49
+ <!-- Input for <%= attribute.column_name %> start -->
42
50
  <% end -%>
43
- <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
51
+ <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
44
52
  <% if with_sentinels? -%>
45
- <!-- Input for <%= attribute.column_name %> end -->
53
+ <!-- Input for <%= attribute.column_name %> end -->
46
54
  <% end -%>
47
55
  <% else -%>
48
56
  <% if with_sentinels? -%>
49
- <!-- Input for <%= attribute.column_name %> start -->
57
+ <!-- Input for <%= attribute.column_name %> start -->
50
58
  <% end -%>
51
- <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
59
+ <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
52
60
  <% if with_sentinels? -%>
53
- <!-- Input for <%= attribute.column_name %> end -->
61
+ <!-- Input for <%= attribute.column_name %> end -->
54
62
  <% end -%>
55
63
  <% end -%>
56
- </div>
64
+ </div>
57
65
  <% if with_sentinels? -%>
58
- <!-- Label and input for <%= attribute.column_name %> end -->
66
+ <!-- Label and input for <%= attribute.column_name %> end -->
59
67
  <% end -%>
60
68
  <% end -%>
61
69
 
62
70
  <% end -%>
63
- <button>
64
- Update <%= singular_table_name.humanize.downcase %>
65
- </button>
66
- </form>
67
-
68
- <hr>
69
-
70
- <a href="/<%= plural_table_name %>">
71
- Go back
72
- </a>
71
+ <button type="submit">
72
+ Update <%= singular_table_name.humanize.downcase %>
73
+ </button>
74
+ </form>
75
+ </div>
@@ -1,85 +1,88 @@
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
4
+ <li>Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
7
+
1
8
  <% unless skip_validation_alerts? -%>
2
9
  <% if with_sentinels? -%>
3
10
  <!-- Validation failure messages -->
4
11
  <% end -%>
5
12
  <%% if @<%= singular_table_name %>.errors.any? %>
6
13
  <%% @<%= singular_table_name %>.errors.full_messages.each do |message| %>
7
- <div>
14
+ <div class="text-red-600">
8
15
  <%%= message %>
9
16
  </div>
10
17
  <%% end %>
11
18
  <%% end %>
12
19
 
13
20
  <% end -%>
14
- <h1>
15
- Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
16
- </h1>
17
-
18
- <hr>
21
+ <div class="card">
22
+ <header>
23
+ <h1>
24
+ Edit <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>
25
+ </h1>
26
+ </header>
19
27
 
20
28
  <% if with_sentinels? -%>
21
- <!-- Form <%= singular_table_name %> start -->
29
+ <!-- Form <%= singular_table_name %> start -->
22
30
  <% end -%>
23
- <form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
31
+ <form action="/update_<%= singular_table_name %>/<%%= @<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
24
32
  <% if with_sentinels? -%>
25
- <!-- Form <%= singular_table_name %> end -->
33
+ <!-- Form <%= singular_table_name %> end -->
26
34
  <% end -%>
27
35
 
28
36
  <% attributes.each do |attribute| -%>
29
37
  <% if with_sentinels? -%>
30
- <!-- Label and input for <%= attribute.column_name %> start -->
38
+ <!-- Label and input for <%= attribute.column_name %> start -->
31
39
  <% end -%>
32
40
  <% if [:check_box, :checkbox].include?(attribute.field_type) -%>
33
- <div>
34
- <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
41
+ <div>
42
+ <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
35
43
  <% if with_sentinels? -%>
36
- <!-- Input for <%= attribute.column_name %> start -->
44
+ <!-- Input for <%= attribute.column_name %> start -->
37
45
  <% end -%>
38
- <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
46
+ <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" value="1" <%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %>>
39
47
  <% if with_sentinels? -%>
40
- <!-- Input for <%= attribute.column_name %> end -->
48
+ <!-- Input for <%= attribute.column_name %> end -->
41
49
  <% end -%>
42
- <label for="<%= attribute.column_name %>_field">
43
- <%= attribute.column_name.humanize %>
44
- </label>
45
- </div>
50
+ <label for="<%= attribute.column_name %>_field">
51
+ <%= attribute.column_name.humanize %>
52
+ </label>
53
+ </div>
46
54
  <% else -%>
47
- <div>
48
- <label for="<%= attribute.column_name %>_field">
49
- <%= attribute.column_name.humanize %>
50
- </label>
55
+ <div>
56
+ <label for="<%= attribute.column_name %>_field">
57
+ <%= attribute.column_name.humanize %>
58
+ </label>
51
59
 
52
60
  <% if [:text_area, :textarea].include?(attribute.field_type) -%>
53
61
  <% if with_sentinels? -%>
54
- <!-- Input for <%= attribute.column_name %> start -->
62
+ <!-- Input for <%= attribute.column_name %> start -->
55
63
  <% end -%>
56
- <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
64
+ <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
57
65
  <% if with_sentinels? -%>
58
- <!-- Input for <%= attribute.column_name %> end -->
66
+ <!-- Input for <%= attribute.column_name %> end -->
59
67
  <% end -%>
60
68
  <% else -%>
61
69
  <% if with_sentinels? -%>
62
- <!-- Input for <%= attribute.column_name %> start -->
70
+ <!-- Input for <%= attribute.column_name %> start -->
63
71
  <% end -%>
64
- <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
72
+ <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>">
65
73
  <% if with_sentinels? -%>
66
- <!-- Input for <%= attribute.column_name %> end -->
74
+ <!-- Input for <%= attribute.column_name %> end -->
67
75
  <% end -%>
68
76
  <% end -%>
69
- </div>
77
+ </div>
70
78
  <% if with_sentinels? -%>
71
- <!-- Label and input for <%= attribute.column_name %> end -->
79
+ <!-- Label and input for <%= attribute.column_name %> end -->
72
80
  <% end -%>
73
81
  <% end -%>
74
82
 
75
83
  <% end -%>
76
- <button>
77
- Update <%= singular_table_name.humanize.downcase %>
78
- </button>
79
- </form>
80
-
81
- <hr>
82
-
83
- <a href="/<%= plural_table_name %>">
84
- Go back
85
- </a>
84
+ <button type="submit">
85
+ Update <%= singular_table_name.humanize.downcase %>
86
+ </button>
87
+ </form>
88
+ </div>
@@ -1,10 +1,22 @@
1
- <h1>
2
- List of all <%= plural_table_name.humanize.downcase %>
3
- </h1>
1
+ <div class="card">
2
+ <header>
3
+ <h1>
4
+ List of all <%= plural_table_name.humanize.downcase %>
5
+ </h1>
6
+ </header>
4
7
 
5
- <hr>
8
+ <ul>
9
+ <%% @list_of_<%= plural_table_name %>.each do |<%= singular_table_name.indefinitize.gsub(" ", "_") %>| %>
10
+ <li>
11
+ <a href="/<%= plural_table_name.underscore %>/<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>">
12
+ <%= singular_table_name.humanize %> #<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>
13
+ </a>
14
+ </li>
15
+ <%% end %>
16
+ </ul>
17
+ </div>
6
18
 
7
- <article>
19
+ <div class="card">
8
20
  <header>
9
21
  <h2>
10
22
  Add a new <%= singular_table_name.humanize.downcase %>
@@ -47,20 +59,4 @@
47
59
  Create <%= singular_table_name.humanize.downcase %>
48
60
  </button>
49
61
  </form>
50
- </article>
51
-
52
- <hr>
53
-
54
- <article>
55
- <ul>
56
- <%% @list_of_<%= plural_table_name %>.each do |<%= singular_table_name.indefinitize.gsub(" ", "_") %>| %>
57
- <li>
58
- <a href="/<%= plural_table_name.underscore %>/<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>">
59
- <%= singular_table_name.humanize %> #<%%= <%= singular_table_name.indefinitize.gsub(" ", "_") %>.id %>
60
- </a>
61
- </li>
62
- <%% end %>
63
- </ul>
64
- </article>
65
-
66
- <hr>
62
+ </div>
@@ -1,73 +1,75 @@
1
- <h1>
2
- Add a new <%= singular_table_name.humanize.downcase %>
3
- </h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
4
+ <li>New <%= singular_table_name.humanize.downcase %></li>
5
+ </ul>
6
+ </nav>
4
7
 
5
-
6
- <hr>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ Add a new <%= singular_table_name.humanize.downcase %>
12
+ </h1>
13
+ </header>
7
14
 
8
15
  <% if with_sentinels? -%>
9
- <!-- Form <%= singular_table_name %> start -->
16
+ <!-- Form <%= singular_table_name %> start -->
10
17
  <% end -%>
11
- <form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
18
+ <form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
12
19
  <% if with_sentinels? -%>
13
- <!-- Form <%= singular_table_name %> end -->
20
+ <!-- Form <%= singular_table_name %> end -->
14
21
  <% end -%>
15
22
 
16
23
  <% attributes.each do |attribute| -%>
17
24
  <% if with_sentinels? -%>
18
- <!-- Label and input for <%= attribute.column_name %> start -->
25
+ <!-- Label and input for <%= attribute.column_name %> start -->
19
26
  <% end -%>
20
27
  <% if [:check_box, :checkbox].include?(attribute.field_type) -%>
21
- <div>
22
- <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
28
+ <div>
29
+ <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
23
30
  <% if with_sentinels? -%>
24
- <!-- Input for <%= attribute.column_name %> start -->
31
+ <!-- Input for <%= attribute.column_name %> start -->
25
32
  <% end -%>
26
- <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox">
33
+ <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox">
27
34
  <% if with_sentinels? -%>
28
- <!-- Input for <%= attribute.column_name %> end -->
35
+ <!-- Input for <%= attribute.column_name %> end -->
29
36
  <% end -%>
30
- <label for="<%= attribute.column_name %>_field">
31
- <%= attribute.column_name.humanize %>
32
- </label>
33
- </div>
37
+ <label for="<%= attribute.column_name %>_field">
38
+ <%= attribute.column_name.humanize %>
39
+ </label>
40
+ </div>
34
41
  <% else -%>
35
- <div>
36
- <label for="<%= attribute.column_name %>_field">
37
- <%= attribute.column_name.humanize %>
38
- </label>
42
+ <div>
43
+ <label for="<%= attribute.column_name %>_field">
44
+ <%= attribute.column_name.humanize %>
45
+ </label>
39
46
 
40
47
  <% if [:text_area, :textarea].include?(attribute.field_type) -%>
41
48
  <% if with_sentinels? -%>
42
- <!-- Input for <%= attribute.column_name %> start -->
49
+ <!-- Input for <%= attribute.column_name %> start -->
43
50
  <% end -%>
44
- <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"></textarea>
51
+ <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"></textarea>
45
52
  <% if with_sentinels? -%>
46
- <!-- Input for <%= attribute.column_name %> end -->
53
+ <!-- Input for <%= attribute.column_name %> end -->
47
54
  <% end -%>
48
55
  <% else -%>
49
56
  <% if with_sentinels? -%>
50
- <!-- Input for <%= attribute.column_name %> start -->
57
+ <!-- Input for <%= attribute.column_name %> start -->
51
58
  <% end -%>
52
- <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
59
+ <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param">
53
60
  <% if with_sentinels? -%>
54
- <!-- Input for <%= attribute.column_name %> end -->
61
+ <!-- Input for <%= attribute.column_name %> end -->
55
62
  <% end -%>
56
63
  <% end -%>
57
- </div>
64
+ </div>
58
65
  <% if with_sentinels? -%>
59
- <!-- Label and input for <%= attribute.column_name %> end -->
66
+ <!-- Label and input for <%= attribute.column_name %> end -->
60
67
  <% end -%>
61
68
  <% end -%>
62
69
 
63
70
  <% end -%>
64
- <button>
65
- Create <%= singular_table_name.humanize.downcase %>
66
- </button>
67
- </form>
68
-
69
- <hr>
70
-
71
- <a href="/<%= plural_table_name %>">
72
- Go back
73
- </a>
71
+ <button type="submit">
72
+ Create <%= singular_table_name.humanize.downcase %>
73
+ </button>
74
+ </form>
75
+ </div>
@@ -1,9 +1,16 @@
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
4
+ <li>New <%= singular_table_name.humanize.downcase %></li>
5
+ </ul>
6
+ </nav>
7
+
1
8
  <% unless skip_validation_alerts? -%>
2
9
  <!-- Validation failure messages -->
3
10
  <%% if @<%= singular_table_name %>.present? %>
4
11
  <%% if @<%= singular_table_name %>.errors.any? %>
5
12
  <%% @<%= singular_table_name %>.errors.full_messages.each do |message| %>
6
- <div>
13
+ <div class="text-red-600">
7
14
  <%%= message %>
8
15
  </div>
9
16
  <%% end %>
@@ -11,76 +18,71 @@
11
18
  <%% end %>
12
19
 
13
20
  <% end -%>
14
- <h1>
15
- Add a new <%= singular_table_name.humanize.downcase %>
16
- </h1>
17
-
18
-
19
- <hr>
21
+ <div class="card">
22
+ <header>
23
+ <h1>
24
+ Add a new <%= singular_table_name.humanize.downcase %>
25
+ </h1>
26
+ </header>
20
27
 
21
28
  <% if with_sentinels? -%>
22
- <!-- Form <%= singular_table_name %> start -->
29
+ <!-- Form <%= singular_table_name %> start -->
23
30
  <% end -%>
24
- <form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
31
+ <form action="/create_<%= singular_table_name %>"<% unless skip_post? -%> method="post"<% end -%>>
25
32
  <% if with_sentinels? -%>
26
- <!-- Form <%= singular_table_name %> end -->
33
+ <!-- Form <%= singular_table_name %> end -->
27
34
  <% end -%>
28
35
 
29
36
  <% attributes.each do |attribute| -%>
30
37
  <% if with_sentinels? -%>
31
- <!-- Label and input for <%= attribute.column_name %> start -->
38
+ <!-- Label and input for <%= attribute.column_name %> start -->
32
39
  <% end -%>
33
40
  <% if [:check_box, :checkbox].include?(attribute.field_type) -%>
34
- <div>
35
- <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
41
+ <div>
42
+ <input type="hidden" value="0" name="<%= attribute.column_name %>_param">
36
43
  <% if with_sentinels? -%>
37
- <!-- Input for <%= attribute.column_name %> start -->
44
+ <!-- Input for <%= attribute.column_name %> start -->
38
45
  <% end -%>
39
- <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" <% unless skip_validation_alerts? -%><%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>>
46
+ <input id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" type="checkbox" <% unless skip_validation_alerts? -%><%%= "checked" if @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%>>
40
47
  <% if with_sentinels? -%>
41
- <!-- Input for <%= attribute.column_name %> end -->
48
+ <!-- Input for <%= attribute.column_name %> end -->
42
49
  <% end -%>
43
- <label for="<%= attribute.column_name %>_field">
44
- <%= attribute.column_name.humanize %>
45
- </label>
46
- </div>
50
+ <label for="<%= attribute.column_name %>_field">
51
+ <%= attribute.column_name.humanize %>
52
+ </label>
53
+ </div>
47
54
  <% else -%>
48
- <div>
49
- <label for="<%= attribute.column_name %>_field">
50
- <%= attribute.column_name.humanize %>
51
- </label>
55
+ <div>
56
+ <label for="<%= attribute.column_name %>_field">
57
+ <%= attribute.column_name.humanize %>
58
+ </label>
52
59
 
53
60
  <% if [:text_area, :textarea].include?(attribute.field_type) -%>
54
61
  <% if with_sentinels? -%>
55
- <!-- Input for <%= attribute.column_name %> start -->
62
+ <!-- Input for <%= attribute.column_name %> start -->
56
63
  <% end -%>
57
- <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><% unless skip_validation_alerts? -%><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%></textarea>
64
+ <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" rows="3"><% unless skip_validation_alerts? -%><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %><% end -%></textarea>
58
65
  <% if with_sentinels? -%>
59
- <!-- Input for <%= attribute.column_name %> end -->
66
+ <!-- Input for <%= attribute.column_name %> end -->
60
67
  <% end -%>
61
68
  <% else -%>
62
69
  <% if with_sentinels? -%>
63
- <!-- Input for <%= attribute.column_name %> start -->
70
+ <!-- Input for <%= attribute.column_name %> start -->
64
71
  <% end -%>
65
- <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" <% unless skip_validation_alerts? -%> value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>>
72
+ <input type="text" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" <% unless skip_validation_alerts? -%> value="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> %>"<% end -%>>
66
73
  <% if with_sentinels? -%>
67
- <!-- Input for <%= attribute.column_name %> end -->
74
+ <!-- Input for <%= attribute.column_name %> end -->
68
75
  <% end -%>
69
76
  <% end -%>
70
- </div>
77
+ </div>
71
78
  <% if with_sentinels? -%>
72
- <!-- Label and input for <%= attribute.column_name %> end -->
79
+ <!-- Label and input for <%= attribute.column_name %> end -->
73
80
  <% end -%>
74
81
  <% end -%>
75
82
 
76
83
  <% end -%>
77
- <button>
78
- Create <%= singular_table_name.humanize.downcase %>
79
- </button>
80
- </form>
81
-
82
- <hr>
83
-
84
- <a href="/<%= plural_table_name %>">
85
- Go back
86
- </a>
84
+ <button type="submit">
85
+ Create <%= singular_table_name.humanize.downcase %>
86
+ </button>
87
+ </form>
88
+ </div>
@@ -1,40 +1,30 @@
1
- <h1>
2
- <%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details
3
- </h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name %>"><%= plural_table_name.humanize %></a></li>
4
+ <li><%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
4
7
 
5
- <article>
6
- <div>
7
- <a href="/<%= plural_table_name %>">
8
- Go back
9
- </a>
10
- </div>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ <%= singular_table_name.humanize %> #<%%= @the_<%= singular_table_name %>.id %> details
12
+ </h1>
13
+ </header>
11
14
 
12
- <% unless read_only? -%>
13
- <% if with_sentinels? -%>
14
- <!-- Delete link <%= singular_table_name %> start -->
15
- <% end -%>
16
- <div>
17
- <a href="/delete_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>">
18
- Delete <%= singular_table_name.humanize.downcase %>
19
- </a>
20
- </div>
21
- <% if with_sentinels? -%>
22
- <!-- Delete link <%= singular_table_name %> end -->
23
- <% end -%>
24
- <% end -%>
25
15
  <dl>
26
16
  <% attributes.each do |attribute| -%>
27
17
  <dt>
28
18
  <%= attribute.human_name %>
29
19
  </dt>
30
20
  <% if with_sentinels? -%>
31
- <!-- Display the_<%= attribute.column_name %> start -->
21
+ <!-- Display the_<%= attribute.column_name %> start -->
32
22
  <% end -%>
33
23
  <dd>
34
24
  <%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>
35
25
  </dd>
36
26
  <% if with_sentinels? -%>
37
- <!-- Display the_<%= attribute.column_name %> end -->
27
+ <!-- Display the_<%= attribute.column_name %> end -->
38
28
  <% end -%>
39
29
 
40
30
  <% end -%>
@@ -42,53 +32,66 @@
42
32
  Created at
43
33
  </dt>
44
34
  <% if with_sentinels? -%>
45
- <!-- Display created_at start -->
35
+ <!-- Display created_at start -->
46
36
  <% end -%>
47
37
  <dd>
48
38
  <%%= time_ago_in_words(@the_<%= singular_table_name %>.created_at) %> ago
49
39
  </dd>
50
40
  <% if with_sentinels? -%>
51
- <!-- Display created_at end -->
41
+ <!-- Display created_at end -->
52
42
  <% end -%>
53
43
 
54
44
  <dt>
55
45
  Updated at
56
46
  </dt>
57
47
  <% if with_sentinels? -%>
58
- <!-- Display updated_at start -->
48
+ <!-- Display updated_at start -->
59
49
  <% end -%>
60
50
  <dd>
61
51
  <%%= time_ago_in_words(@the_<%= singular_table_name %>.updated_at) %> ago
62
52
  </dd>
63
53
  <% if with_sentinels? -%>
64
- <!-- Display updated_at end -->
54
+ <!-- Display updated_at end -->
65
55
  <% end -%>
66
56
  </dl>
67
- </article>
68
-
69
- <hr>
57
+ <% unless read_only? -%>
70
58
 
71
59
  <% if with_sentinels? -%>
60
+ <!-- Delete link <%= singular_table_name %> start -->
61
+ <% end -%>
62
+ <p>
63
+ <a href="/delete_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>" class="btn btn-outline">
64
+ Delete <%= singular_table_name.humanize.downcase %>
65
+ </a>
66
+ </p>
67
+ <% if with_sentinels? -%>
68
+ <!-- Delete link <%= singular_table_name %> end -->
69
+ <% end -%>
70
+ <% end -%>
71
+ </div>
72
+ <% if with_sentinels? -%>
73
+
72
74
  <!-- Show Page Customization starts -->
73
75
 
74
76
  <!-- Show Page Customization end -->
75
77
  <% end -%>
78
+ <% unless read_only? -%>
76
79
 
77
- <article>
80
+ <div class="card">
78
81
  <header>
79
82
  <h2>
80
83
  Edit <%= singular_table_name.humanize.downcase %>
81
84
  </h2>
82
85
  </header>
83
86
 
84
- <form action="/modify_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>" <% unless skip_post? -%> method="post" <% end -%>>
87
+ <form action="/modify_<%= singular_table_name %>/<%%= @the_<%= singular_table_name %>.id %>"<% unless skip_post? -%> method="post"<% end -%>>
85
88
  <% attributes.each do |attribute| -%>
86
89
  <% if [:check_box, :checkbox].include?(attribute.field_type) -%>
87
90
  <div>
88
91
  <input type="checkbox" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="1" <%%= "checked" if @the_<%= singular_table_name %>.<%= attribute.column_name %> %>>
89
92
 
90
93
  <label for="<%= attribute.column_name %>_field">
91
- <%= attribute.column_name.humanize %>
94
+ <%= attribute.column_name.humanize %>
92
95
  </label>
93
96
  </div>
94
97
 
@@ -101,8 +104,7 @@
101
104
  <% if [:text_area, :textarea].include?(attribute.field_type) -%>
102
105
  <textarea id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param"><%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %></textarea>
103
106
  <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :datetime -%>
104
- <input type="datetime-local" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param"
105
- value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
107
+ <input type="datetime-local" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
106
108
  <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :date -%>
107
109
  <input type="date" id="<%= attribute.column_name %>_field" name="<%= attribute.column_name %>_param" value="<%%= @the_<%= singular_table_name %>.<%= attribute.column_name %> %>">
108
110
  <% elsif attribute.field_type.to_s.gsub(/_.*/, "").to_sym == :time -%>
@@ -120,6 +122,5 @@
120
122
  Update <%= singular_table_name.humanize.downcase %>
121
123
  </button>
122
124
  </form>
123
- </article>
124
-
125
- <hr>
125
+ </div>
126
+ <% end -%>
@@ -1,9 +1,22 @@
1
- <h1>You updated <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!</h1>
1
+ <nav aria-label="breadcrumb">
2
+ <ul>
3
+ <li><a href="/<%= plural_table_name.underscore %>"><%= plural_table_name.humanize %></a></li>
4
+ <li><%= singular_table_name.humanize %> #<%%= @<%= singular_table_name %>.id %></li>
5
+ </ul>
6
+ </nav>
2
7
 
3
- <p>
4
- <a href="/<%= plural_table_name.underscore %>/<%%= @<%= singular_table_name.underscore %>.id %>">
5
- Click here
6
- </a>
8
+ <div class="card">
9
+ <header>
10
+ <h1>
11
+ You updated <%= singular_table_name.humanize.downcase %> #<%%= @<%= singular_table_name %>.id %>!
12
+ </h1>
13
+ </header>
7
14
 
8
- to check it out.
9
- </p>
15
+ <p>
16
+ <a href="/<%= plural_table_name.underscore %>/<%%= @<%= singular_table_name.underscore %>.id %>">
17
+ Click here
18
+ </a>
19
+
20
+ to check it out.
21
+ </p>
22
+ </div>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draft_generators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raghu Betina