madmin 1.2.2 → 1.2.3

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: '05151328dcf6fdd8c23755a1b1f3f14b9dcceadc8215e6f102e133d915e95be6'
4
- data.tar.gz: 305bf51253018fa0c871d0314e9ecd69339c510160cdacf1439c2fd361a95a97
3
+ metadata.gz: 63c8373097cef566d74e69fdd3cefa259506ece6ae8d14a3eae6052f5617cb80
4
+ data.tar.gz: 96e90e7d34a19801137436b2e8310889ac68a959420579d3b746b46bc5158d8d
5
5
  SHA512:
6
- metadata.gz: 625d77d1c5ee5bd30462c2609a8b53b7c5d321fb97e0951a95b852eca019189d468c596fcda77e170ed996bd25707feea787a3668faf318a542a65f03d75e488
7
- data.tar.gz: b594b3c324289e44dbdeb3f0acc70a532b391f8c46faa4854ea5654e9dfe648c88062e24c29433bb476165134a0d79fdbbca526000bbf6c148e9c2c28777f0ed
6
+ metadata.gz: 342c5a04997ca4ded7f8722559934d0c827aeb078799d743465950e0c04a5cfb7ed112943088bda099faf0251d28079f236cfb3a49f79c43ed949b42ded2cc55
7
+ data.tar.gz: 335b28a9e53d9472c6724b72fc6109ef365e0d4edf732854793c96d3a2f947560ad6dc123307e1ff2e114f2cc126c42008fa1ee3351f5fd6a4452db4b53fb899
@@ -3,7 +3,7 @@
3
3
  <%= stylesheet_link_tag "https://unpkg.com/tom-select/dist/css/tom-select.min.css", "data-turbo-track": "reload" %>
4
4
 
5
5
  <script type="module">
6
- import { Application, Controller } from 'https://cdn.skypack.dev/stimulus'
6
+ import { Application, Controller } from 'https://cdn.skypack.dev/@hotwired/stimulus'
7
7
  const application = Application.start()
8
8
 
9
9
  import { Dropdown } from "https://cdn.skypack.dev/tailwindcss-stimulus-components"
@@ -27,33 +27,33 @@
27
27
  <%= link_to scope.to_s.humanize, resource.index_path(scope: scope), class: class_names("p-2 rounded", {"bg-gray-100" => params[:scope] == scope.to_s}) %>
28
28
  <% end %>
29
29
  </div>
30
-
31
- <table class="min-w-full divide-y divide-gray-200">
32
- <thead>
33
- <tr class="border-b border-gray-200">
34
- <% resource.attributes.values.each do |attribute| %>
35
- <% next if attribute.field.nil? %>
36
- <% next unless attribute.field.visible?(action_name) %>
37
-
38
- <th class="py-2 px-4 text-left text-xs text-gray-500 font-medium uppercase whitespace-nowrap"><%= sortable attribute.name, attribute.name.to_s.titleize %></th>
39
- <% end %>
40
- <th class="py-2 px-4 text-left text-xs text-gray-500 font-medium uppercase">Actions</th>
41
- </tr>
42
- </thead>
43
-
44
- <tbody class="text-sm divide-y">
45
- <% @records.each do |record| %>
46
- <tr>
30
+ <div class="min-w-full max-w-xl overflow-x-auto pb-4">
31
+ <table class="min-w-full divide-y divide-gray-200">
32
+ <thead>
33
+ <tr class="border-b border-gray-200">
47
34
  <% resource.attributes.values.each do |attribute| %>
48
35
  <% next if attribute.field.nil? %>
49
36
  <% next unless attribute.field.visible?(action_name) %>
50
- <td class="px-4 py-2"><%= render partial: attribute.field.to_partial_path("index"), locals: { field: attribute.field, record: record } %></td>
51
- <% end %>
52
37
 
53
- <td class="px-4 py-2 text-center"><%= link_to "View", resource.show_path(record), class: "text-indigo-500" %></td>
38
+ <th class="py-2 px-4 text-left text-xs text-gray-500 font-medium uppercase whitespace-nowrap"><%= sortable attribute.name, attribute.name.to_s.titleize %></th>
39
+ <% end %>
40
+ <th class="py-2 px-4 text-left text-xs text-gray-500 font-medium uppercase">Actions</th>
54
41
  </tr>
55
- <% end %>
56
- </tbody>
57
- </table>
58
-
42
+ </thead>
43
+
44
+ <tbody class="text-sm divide-y">
45
+ <% @records.each do |record| %>
46
+ <tr>
47
+ <% resource.attributes.values.each do |attribute| %>
48
+ <% next if attribute.field.nil? %>
49
+ <% next unless attribute.field.visible?(action_name) %>
50
+ <td class="px-4 py-2"><%= render partial: attribute.field.to_partial_path("index"), locals: { field: attribute.field, record: record } %></td>
51
+ <% end %>
52
+
53
+ <td class="px-4 py-2 text-center"><%= link_to "View", resource.show_path(record), class: "text-indigo-500" %></td>
54
+ </tr>
55
+ <% end %>
56
+ </tbody>
57
+ </table>
58
+ </div>
59
59
  <%== pagy_nav(@pagy) if @pagy.pages > 1 %>
@@ -1,5 +1,5 @@
1
- <%= content_tag :div, class: "nested-fields bg-gray-100 rounded-t-xl p-5", data: { new_record: f.object.new_record? } do %>
2
- <% field.nested_attributes.each do |nested_attribute| %>
1
+ <%= content_tag :div, class: "nested-fields border border-gray-200 rounded-lg p-5", data: { new_record: f.object.new_record? } do %>
2
+ <% field.nested_attributes.each do |name, nested_attribute| %>
3
3
  <% next if nested_attribute[:field].nil? %>
4
4
  <% next unless nested_attribute[:field].visible?(action_name) %>
5
5
  <% next unless nested_attribute[:field].visible?(:form) %>
@@ -14,5 +14,4 @@
14
14
  <small><%= link_to "Remove", "#", data: { action: "click->nested-form#remove_association" } %></small>
15
15
 
16
16
  <%= f.hidden_field :_destroy %>
17
-
18
17
  <% end %>
@@ -3,7 +3,7 @@ module Madmin
3
3
  class NestedHasMany < Field
4
4
  DEFAULT_ATTRIBUTES = %w[_destroy id].freeze
5
5
  def nested_attributes
6
- resource.attributes.reject { |i| skipped_fields.include?(i[:name]) }
6
+ resource.attributes.reject { |name, attribute| skipped_fields.include?(name) }
7
7
  end
8
8
 
9
9
  def resource
@@ -1,3 +1,3 @@
1
1
  module Madmin
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-23 00:00:00.000000000 Z
12
+ date: 2021-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails