tailwind_rails_scaffold 0.1.6 → 0.1.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 +4 -4
- data/lib/generators/tailwind_rails_scaffold/erb/templates/_form.html.erb.tt +3 -0
- data/lib/generators/tailwind_rails_scaffold/erb/templates/edit.html.erb.tt +1 -1
- data/lib/generators/tailwind_rails_scaffold/erb/templates/index.html.erb.tt +6 -6
- data/lib/generators/tailwind_rails_scaffold/erb/templates/new.html.erb.tt +9 -2
- data/lib/generators/tailwind_rails_scaffold/erb/templates/show.html.erb.tt +6 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c88efe7514b952a9b3a8169b58fcab26970b3c940b143b051bad3e050d19596f
|
4
|
+
data.tar.gz: f10f758f0b8b54174061a77994e61aa8d206d8cd08f0f40729ed902b16558a32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 982b27b00b1e288d94b308ca4c86217c45e0470664f889e8a7fed217701df69cbbf386e78a89b797702a2d22b3b262ef51df6cc4f9e193f413c2d633bcd424fa
|
7
|
+
data.tar.gz: 0750d31cbf604049b07f4bb71d5610699805ec8b54497f9c6f409262bf0bce4b45e6a83914ccf6864ba09499d7c333562aec3626be045309b6ee3a1aa7084d45
|
@@ -51,6 +51,9 @@
|
|
51
51
|
<% elsif attribute.attachments? -%>
|
52
52
|
<%%= form.label :<%= attribute.column_name %>, :class=>"block text-sm font-extralight text-gray-700" %>
|
53
53
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>,multiple: true, :class=>"shadow-inner focus:shadow-lg bg-gray-100 focus:bg-yellow-100 px-1 py-1 focus:ring-yellow-300 focus:ring-1 focus:outline-none focus:border-0 block w-full sm:text-sm border-gray-300 rounded-md" %>
|
54
|
+
<% elsif attribute.field_type == "datetime_select" -%>
|
55
|
+
<%%= form.label :<%= attribute.column_name %>, :class=>"block text-sm font-extralight text-gray-700" %>
|
56
|
+
<%%= form.<%= attribute.date_field %> :<%= attribute.column_name %>, { behavior: "flatpickr",:class=>"flatpickr shadow-inner focus:shadow-lg bg-gray-100 focus:bg-yellow-100 px-1 py-1 focus:ring-yellow-300 focus:ring-1 focus:outline-none focus:border-0 block w-full sm:text-sm border-gray-300 rounded-md" %>
|
54
57
|
<% else -%>
|
55
58
|
<%%= form.label :<%= attribute.column_name %>, :class=>"block text-sm font-extralight text-gray-700" %>
|
56
59
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, :class=>"shadow-inner focus:shadow-lg bg-gray-100 focus:bg-yellow-100 px-1 py-1 focus:ring-yellow-300 focus:ring-1 focus:outline-none focus:border-0 block w-full sm:text-sm border-gray-300 rounded-md" %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h1 class="text-2xl font-bold text-gray-300 antialiased"
|
1
|
+
<h1 class="text-2xl font-bold text-gray-300 antialiased"><%%= t("edit_<%= singular_table_name %>").titleize %></h1>
|
2
2
|
|
3
3
|
<div id="<%= singular_table_name.titleize %>_form">
|
4
4
|
<%%= render 'form',<%= singular_table_name %>: @<%= singular_table_name %> %>
|
@@ -1,6 +1,6 @@
|
|
1
|
-
<h1 class="text-2xl font-bold text-gray-300 antialiased"
|
1
|
+
<h1 class="text-2xl font-bold text-gray-300 antialiased"><%%= t("<%= plural_table_name %>").titleize %></h1>
|
2
2
|
|
3
|
-
<%%= link_to new_<%= singular_table_name %>_path, :class=> "float-right inline-flex items-center p-2 border border-transparent rounded shadow-md text-gray-300 bg-white hover:text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
3
|
+
<%%= link_to new_<%= singular_table_name %>_path, :class=> "transition duration-500 float-right inline-flex items-center p-2 border border-transparent rounded shadow-md text-gray-300 bg-white hover:text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
4
4
|
|
5
5
|
<svg class="h-7 w-7" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
6
6
|
<path fill-rule="evenodd" d="M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z" clip-rule="evenodd" />
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<tr>
|
20
20
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
21
21
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
|
22
|
-
<%= attribute.human_name %>
|
22
|
+
<%= t(attribute).human_name %>
|
23
23
|
</th>
|
24
24
|
<% end %>
|
25
25
|
<th scope="col" class="relative px-6 py-3">
|
@@ -36,20 +36,20 @@
|
|
36
36
|
</td>
|
37
37
|
<% end %>
|
38
38
|
<td class="text-right text-xs font-extralight">
|
39
|
-
<%%= link_to <%= singular_table_name %>, :class=>"inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-white hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
39
|
+
<%%= link_to <%= singular_table_name %>, :class=>"transition duration-500 inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-white hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
40
40
|
<svg class="h-7 w-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
41
41
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
|
42
42
|
</svg>
|
43
43
|
<%%= t :Details %>
|
44
44
|
<%% end %>
|
45
45
|
|
46
|
-
<%%= link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class=>"inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-black hover:bg-yellow-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
46
|
+
<%%= link_to edit_<%= singular_table_name %>_path(<%= singular_table_name %>), :class=>"transition duration-500 inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-black hover:bg-yellow-300 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
47
47
|
<svg class="w-7 h-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
48
48
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
49
49
|
</svg>
|
50
50
|
<%%= t :Edit %>
|
51
51
|
<%% end %>
|
52
|
-
<%%= link_to <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-white hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
52
|
+
<%%= link_to <%= singular_table_name %>, method: :delete, data: { confirm: 'Are you sure?' }, :class=>"transition duration-500 inline-flex items-center p-2 border-none shadow-inline text-white text-gray-300 hover:text-white hover:bg-red-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" do %>
|
53
53
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-7 h-7" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
54
54
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
|
55
55
|
</svg>
|
@@ -1,8 +1,15 @@
|
|
1
1
|
|
2
|
-
<h1 class="text-2xl font-bold text-gray-300 antialiased"
|
2
|
+
<h1 class="text-2xl font-bold text-gray-300 antialiased"><%%= t("new_<%= singular_table_name %>").titleize %></h1>
|
3
3
|
|
4
4
|
<div id="<%= singular_table_name.titleize %>_form">
|
5
5
|
<%%= render 'form',<%= singular_table_name %>: @<%= singular_table_name %> %>
|
6
6
|
</div>
|
7
7
|
|
8
|
-
|
8
|
+
|
9
|
+
<%%= link_to <%= plural_table_name %>_path, :class=>"transition duration-500 relative hover:bg-indigo-500 hover:text-white inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-gray-700 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" do %>
|
10
|
+
<svg class="w-7 h-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
11
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" />
|
12
|
+
</svg>
|
13
|
+
<%%= t :Back %>
|
14
|
+
<%% end %>
|
15
|
+
|
@@ -1,7 +1,8 @@
|
|
1
1
|
<p id="notice"><%%= notice %></p>
|
2
2
|
|
3
|
-
<h1 class="text-2xl font-bold text-gray-300 antialiased"
|
4
|
-
|
3
|
+
<h1 class="text-2xl font-bold text-gray-300 antialiased"><%%= t("show_<%= singular_table_name %>").titleize %></h1>
|
4
|
+
|
5
|
+
<div class="md:grid md:grid-cols-3 md:gap-6">
|
5
6
|
<div class="md:col-span-1">
|
6
7
|
<div class="px-4 sm:px-0">
|
7
8
|
</div>
|
@@ -12,7 +13,7 @@
|
|
12
13
|
<% attributes.reject(&:password_digest?).each do |attribute| -%>
|
13
14
|
<div class="<%%= cycle("bg-white", "bg-grey-50") -%> px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
14
15
|
<dt class="text-sm font-light text-gray-500">
|
15
|
-
<%= attribute.human_name %>
|
16
|
+
<%%= t("<%= attribute.human_name %>") %>
|
16
17
|
</dt>
|
17
18
|
<dd class="mt-1 text-sm font-medium text-gray-900 sm:mt-0 sm:col-span-2">
|
18
19
|
<% if attribute.attachment? -%>
|
@@ -31,13 +32,13 @@
|
|
31
32
|
|
32
33
|
<div class="pt-10">
|
33
34
|
<span class="relative z-0 inline-flex shadow-md rounded-md text-xs font-extralight">
|
34
|
-
<%%= link_to <%= plural_table_name %>_path, :class=>"relative hover:bg-indigo-500 hover:text-white inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-gray-700 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" do %>
|
35
|
+
<%%= link_to <%= plural_table_name %>_path, :class=>"transition duration-500 relative hover:bg-indigo-500 hover:text-white inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white text-gray-700 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" do %>
|
35
36
|
<svg class="w-7 h-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
36
37
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 15l-3-3m0 0l3-3m-3 3h8M3 12a9 9 0 1118 0 9 9 0 01-18 0z" />
|
37
38
|
</svg>
|
38
39
|
<%%= t :Back %>
|
39
40
|
<%% end %>
|
40
|
-
<%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class=>"relative inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white hover:text-black hover:bg-yellow-300 text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" do%>
|
41
|
+
<%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), :class=>"transition duration-500 relative inline-flex items-center px-4 py-2 rounded-l-md border border-gray-300 bg-white hover:text-black hover:bg-yellow-300 text-gray-700 hover:bg-gray-50 focus:z-10 focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500" do%>
|
41
42
|
<svg class="w-7 h-7" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
42
43
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" />
|
43
44
|
</svg>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tailwind_rails_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roger Heykoop
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Tailwind Rails Scaffold generator for Rails 6.1
|
14
14
|
email: roger@heykoop.nl
|