voidable-hotwire 0.5.0 → 0.5.1

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: 03155b66d024c5d6db61d2cdecceac721d81a2c82bce80c7521be918df8d4447
4
- data.tar.gz: a0b079b615a22eb5caa55658125e8312e6d4e69abe34f94ef7a3d710702f0b80
3
+ metadata.gz: 4959c33ee919d4af15bf4b4c21fdb13d0ce7391a5dcbd9afbe42f7b7842c10cb
4
+ data.tar.gz: 47c79d6845e2fd0f16f37ca05f34a3807ca80caacbd4f57c54f88b128528fd8e
5
5
  SHA512:
6
- metadata.gz: de37388aa47a8683f0ffc8ef80056397d885eedc3021172ce8f9bcb453b4b40226afdf9ac893c8b7e80e832a7b511a58630cc566f0f4a49720f72b136ee614de
7
- data.tar.gz: 10eb063c489ab4909b7c66ecaa2dcaad440d2ddc4cdeccf30ba025a1a452d7b065c4ca10dd64ab9d3c9e94cf12259ac517909f3edec2cc62f77fad747d8b6c71
6
+ metadata.gz: 5a9ab0e6f39e7666099b1670bce646b19e34a08b44135a2b62ee3378d447260f899cfcf3b036aa068e8887240e628944f26528bca0f012e4eb5db81fe534a809
7
+ data.tar.gz: b308f7cf89bc31bd8473c4aa046bd201ac4fd8edd4b8fc734f479deecc01e3cc60736ca76c86cde116664d25f086167b97f00e035df9167d94830f715933cc9f
@@ -0,0 +1,3 @@
1
+ <%# show, edit, and new actions all render the index template with the
2
+ appropriate modal open. This file is generated but never rendered;
3
+ leave it empty or delete it. %>
@@ -76,7 +76,28 @@
76
76
  </void-dialog>
77
77
  <%% else %>
78
78
  <void-dialog id="resource-modal" open size="md" heading="<%%= @<%= singular_table_name %>.<%= display_column %>.to_s %>" data-close-href="<%%= <%= index_helper(type: :path) %> %>">
79
- <%%= render "details", <%= singular_table_name %>: @<%= singular_table_name %> %>
79
+ <dl class="detail-grid">
80
+ <% attributes.reject(&:password_digest?).each do |attribute| -%>
81
+ <dt class="detail-label"><%= attribute.human_name %></dt>
82
+ <% if attribute.type == :boolean -%>
83
+ <dd class="detail-value">
84
+ <void-badge color="<%%= @<%= singular_table_name %>.<%= attribute.column_name %> ? 'success' : 'default' %>" variant="outline"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> ? 'Yes' : 'No' %></void-badge>
85
+ </dd>
86
+ <% elsif [:integer, :float, :decimal].include?(attribute.type) -%>
87
+ <dd class="detail-value-mono"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></dd>
88
+ <% elsif attribute.attachment? -%>
89
+ <dd class="detail-value"><%%= link_to @<%= singular_table_name %>.<%= attribute.column_name %>.filename, @<%= singular_table_name %>.<%= attribute.column_name %> if @<%= singular_table_name %>.<%= attribute.column_name %>.attached? %></dd>
90
+ <% elsif attribute.attachments? -%>
91
+ <dd class="detail-value">
92
+ <%% @<%= singular_table_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
93
+ <div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
94
+ <%% end %>
95
+ </dd>
96
+ <% else -%>
97
+ <dd class="detail-value"><%%= @<%= singular_table_name %>.<%= attribute.column_name %> %></dd>
98
+ <% end -%>
99
+ <% end -%>
100
+ </dl>
80
101
  <div class="modal-actions">
81
102
  <void-button variant="outline" size="sm"><a href="<%%= <%= edit_helper(type: :path) %> %>">Edit</a></void-button>
82
103
  <void-button color="error" variant="outline" size="sm" data-open-dialog="resource-delete-dialog">Delete</void-button>
@@ -0,0 +1,3 @@
1
+ <%# show, edit, and new actions all render the index template with the
2
+ appropriate modal open. This file is generated but never rendered;
3
+ leave it empty or delete it. %>
@@ -0,0 +1,3 @@
1
+ <%# show, edit, and new actions all render the index template with the
2
+ appropriate modal open. This file is generated but never rendered;
3
+ leave it empty or delete it. %>
@@ -1,5 +1,5 @@
1
1
  module Voidable
2
2
  module Hotwire
3
- VERSION = "0.5.0"
3
+ VERSION = "0.5.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voidable-hotwire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaz Walker
@@ -57,10 +57,12 @@ files:
57
57
  - lib/generators/voidable/install/templates/voidable-layout-sidebar.css
58
58
  - lib/generators/voidable/install/templates/voidable-layout-topbar.css
59
59
  - lib/generators/voidable/install/templates/voidable-layout.js
60
- - lib/templates/erb/scaffold/_details.html.erb.tt
61
60
  - lib/templates/erb/scaffold/_form.html.erb.tt
61
+ - lib/templates/erb/scaffold/edit.html.erb.tt
62
62
  - lib/templates/erb/scaffold/index.html.erb.tt
63
+ - lib/templates/erb/scaffold/new.html.erb.tt
63
64
  - lib/templates/erb/scaffold/partial.html.erb.tt
65
+ - lib/templates/erb/scaffold/show.html.erb.tt
64
66
  - lib/templates/rails/scaffold_controller/controller.rb.tt
65
67
  - lib/voidable/hotwire.rb
66
68
  - lib/voidable/hotwire/engine.rb
@@ -1,22 +0,0 @@
1
- <dl class="detail-grid">
2
- <% attributes.reject(&:password_digest?).each do |attribute| -%>
3
- <dt class="detail-label"><%= attribute.human_name %></dt>
4
- <% if attribute.type == :boolean -%>
5
- <dd class="detail-value">
6
- <void-badge color="<%%= <%= singular_table_name %>.<%= attribute.column_name %> ? 'success' : 'default' %>" variant="outline"><%%= <%= singular_table_name %>.<%= attribute.column_name %> ? 'Yes' : 'No' %></void-badge>
7
- </dd>
8
- <% elsif [:integer, :float, :decimal].include?(attribute.type) -%>
9
- <dd class="detail-value-mono"><%%= <%= singular_table_name %>.<%= attribute.column_name %> %></dd>
10
- <% elsif attribute.attachment? -%>
11
- <dd class="detail-value"><%%= link_to <%= singular_table_name %>.<%= attribute.column_name %>.filename, <%= singular_table_name %>.<%= attribute.column_name %> if <%= singular_table_name %>.<%= attribute.column_name %>.attached? %></dd>
12
- <% elsif attribute.attachments? -%>
13
- <dd class="detail-value">
14
- <%% <%= singular_table_name %>.<%= attribute.column_name %>.each do |<%= attribute.singular_name %>| %>
15
- <div><%%= link_to <%= attribute.singular_name %>.filename, <%= attribute.singular_name %> %></div>
16
- <%% end %>
17
- </dd>
18
- <% else -%>
19
- <dd class="detail-value"><%%= <%= singular_table_name %>.<%= attribute.column_name %> %></dd>
20
- <% end -%>
21
- <% end -%>
22
- </dl>