madmin 1.2.9 → 1.2.10

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: d4711c582952084164bfafbad483a4b5cb520ff505f96c0f9a87a7b61732068c
4
- data.tar.gz: 3eed3f7cbd6969f14b499c3c51bc91cacf423b9554c590c612000d23ccafea8f
3
+ metadata.gz: 1f28056e0049fbd6d19f4b686b9742d1a0d81e61bea220e0a815870be83fd426
4
+ data.tar.gz: ccd99dd6809870a31934bc822a4b05a506b0485a42b87b031f2b96deeea9ade9
5
5
  SHA512:
6
- metadata.gz: 3464c6efd9b1561a49c437b8f994616e212d88ba0ec37eebbdac78cccaa0f700ef28bb5c90c20133eea98dfbc71cd7f008b8db38e055602bacc7a7bddcafb0e8
7
- data.tar.gz: dff80cd6e7c84008618f61381ec0551519305f6ab8434d0742a85f37e50202740a5d146beb27989308426f8bd7ffd218fb86bf0903074bb4d89ec2238b55dbf2
6
+ metadata.gz: bcc1478dd032b27ef03c7707ff15bb390b44e452169404b936274971a68c72cbbd83bdcccab4498dd385f0a4c0f22d1481cbccf970596d7cc1ef44a3ccc255bf
7
+ data.tar.gz: c55e2a66753ca675a7906a7c12114fdc956f68da3deb1119bd83761f47c3fd42396c658baab2c5a57b7c1d42047c7f0d34f95d29c1f99dc305c95d0b96ae73f9
@@ -2,6 +2,37 @@
2
2
  <%= stylesheet_link_tag "https://unpkg.com/flatpickr/dist/flatpickr.min.css", "data-turbo-track": "reload" %>
3
3
  <%= stylesheet_link_tag "https://unpkg.com/trix/dist/trix.css", "data-turbo-track": "reload" %>
4
4
  <%= stylesheet_link_tag "https://unpkg.com/tom-select/dist/css/tom-select.min.css", "data-turbo-track": "reload" %>
5
+ <style type="text/tailwindcss">
6
+ .pagy {
7
+ @apply isolate inline-flex rounded-md;
8
+
9
+ a:first-child {
10
+ @apply rounded-l-md;
11
+ }
12
+ a:last-child {
13
+ @apply rounded-r-md;
14
+ }
15
+
16
+ a {
17
+ @apply relative -ml-px inline-flex items-center bg-white px-3 py-2 text-sm font-semibold text-gray-900 ring-1 ring-inset ring-gray-300 hover:bg-gray-100 focus:z-10;
18
+
19
+ &:not([href]) {
20
+ @apply text-gray-300 cursor-default;
21
+ }
22
+
23
+ &.current {
24
+ @apply text-white bg-blue-500 ring-blue-500;
25
+ }
26
+ }
27
+
28
+ label {
29
+ @apply inline-block whitespace-nowrap bg-gray-200 rounded-lg px-3 py-0.5;
30
+ input {
31
+ @apply bg-gray-100 border-none rounded-md;
32
+ }
33
+ }
34
+ }
35
+ </style>
5
36
 
6
37
  <script type="importmap" data-turbo-track="reload">
7
38
  {
@@ -1,7 +1,7 @@
1
1
  <h1 class="text-xl mb-4">
2
- <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-indigo-500" %>
2
+ <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-blue-500" %>
3
3
  /
4
- <strong>Edit <%= link_to resource.display_name(@record), resource.show_path(@record), class: "text-indigo-500" %></strong>
4
+ <strong>Edit <%= link_to resource.display_name(@record), resource.show_path(@record), class: "text-blue-500" %></strong>
5
5
  </h1>
6
6
 
7
7
  <%= render partial: "form", locals: { record: @record, resource: resource } %>
@@ -4,7 +4,7 @@
4
4
  <div class="flex-grow flex md:justify-end gap-4">
5
5
  <form class="flex items-center gap-2 relative">
6
6
  <%= hidden_field_tag :page, params[:page], value: 1, class: "hidden" %>
7
- <%= search_field_tag :q, params[:q], placeholder: "Search", class: "rounded-full px-4 focus:bg-white focus:border-indigo-500" %>
7
+ <%= search_field_tag :q, params[:q], placeholder: "Search", class: "rounded-full px-4 focus:bg-white focus:border-blue-500" %>
8
8
  <%= link_to clear_search_params, class: "absolute top-1/2 right-3 text-gray-500 bg-white transform -translate-y-1/2" do %>
9
9
  <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
10
10
  <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd" />
@@ -51,12 +51,12 @@
51
51
  <% end %>
52
52
 
53
53
  <td class="px-4 py-2 text-center">
54
- <%= link_to "View", resource.show_path(record), class: "text-indigo-500" %>
55
- <%= link_to "Edit", resource.edit_path(record), class: "text-indigo-500" %>
54
+ <%= link_to "View", resource.show_path(record), class: "text-blue-500" %>
55
+ <%= link_to "Edit", resource.edit_path(record), class: "text-blue-500" %>
56
56
  </td>
57
57
  </tr>
58
58
  <% end %>
59
59
  </tbody>
60
60
  </table>
61
61
  </div>
62
- <%== render(partial: 'madmin/pagy/nav', locals: { pagy: @pagy }) if @pagy.pages > 1 %>
62
+ <%== pagy_nav @pagy %>
@@ -1,5 +1,5 @@
1
1
  <h1 class="text-xl mb-4">
2
- <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-indigo-500" %>
2
+ <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-blue-500" %>
3
3
  /
4
4
  <strong>New <%= resource.friendly_name %></strong>
5
5
  </h1>
@@ -1,8 +1,8 @@
1
1
  <div class="md:flex items-center justify-between mb-4">
2
2
  <h1 class="text-xl">
3
- <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-indigo-500" %>
3
+ <%= link_to resource.friendly_name.pluralize, resource.index_path, class: "text-blue-500" %>
4
4
  /
5
- <%= link_to resource.display_name(@record), resource.show_path(@record), class: "text-indigo-500 font-bold" %>
5
+ <%= link_to resource.display_name(@record), resource.show_path(@record), class: "text-blue-500 font-bold" %>
6
6
  </h1>
7
7
 
8
8
  <div class="flex gap-2 items-center px-4">
@@ -4,6 +4,6 @@
4
4
  <%= image_tag main_app.url_for(attachment), class: "max-h-32" %>
5
5
  <% end %>
6
6
  <% else %>
7
- <%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-indigo-500 underline" %>
7
+ <%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-blue-500 underline" %>
8
8
  <% end %>
9
9
  <% end %>
@@ -5,7 +5,7 @@
5
5
  <%= image_tag main_app.url_for(attachment), class: "max-h-32" %>
6
6
  <% end %>
7
7
  <% else %>
8
- <%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-indigo-500 underline" %>
8
+ <%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-blue-500 underline" %>
9
9
  <% end %>
10
10
  <% end %>
11
11
  <% end %>
@@ -1,3 +1,3 @@
1
1
  <% if (object = field.value(record)) %>
2
- <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-indigo-500 underline" %>
2
+ <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-blue-500 underline" %>
3
3
  <% end %>
@@ -1,6 +1,6 @@
1
1
  <% value = field.value(record) %>
2
2
  <% if value.respond_to?(:url) %>
3
- <%= link_to value.url, value.url, target: :_blank, class: "text-indigo-500 underline" %>
3
+ <%= link_to value.url, value.url, target: :_blank, class: "text-blue-500 underline" %>
4
4
  <% else %>
5
5
  <%= value %>
6
6
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% field.value(record).each do |object| %>
2
2
  <div>
3
- <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-indigo-500 underline" %>
3
+ <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-blue-500 underline" %>
4
4
  </div>
5
5
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% if field.attribute_name == :id %>
2
- <%= link_to field.value(record), resource.show_path(record), class: "text-indigo-500 underline" %>
2
+ <%= link_to field.value(record), resource.show_path(record), class: "text-blue-500 underline" %>
3
3
  <% else %>
4
4
  <%= field.value(record) %>
5
5
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <% field.value(record).each do |object| %>
2
2
  <div>
3
- <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-indigo-500 underline" %>
3
+ <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-blue-500 underline" %>
4
4
  </div>
5
5
  <% end %>
@@ -1,3 +1,3 @@
1
1
  <% if (object = field.value(record)) %>
2
- <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-indigo-500 underline" %>
2
+ <%= link_to Madmin.resource_for(object).display_name(object), Madmin.resource_for(object).show_path(object), class: "text-blue-500 underline" %>
3
3
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module Madmin
2
- VERSION = "1.2.9"
2
+ VERSION = "1.2.10"
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.9
4
+ version: 1.2.10
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: 2024-04-28 00:00:00.000000000 Z
12
+ date: 2024-05-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -134,7 +134,6 @@ files:
134
134
  - app/views/madmin/fields/time/_form.html.erb
135
135
  - app/views/madmin/fields/time/_index.html.erb
136
136
  - app/views/madmin/fields/time/_show.html.erb
137
- - app/views/madmin/pagy/_nav.html.erb
138
137
  - app/views/madmin/shared/_label.html.erb
139
138
  - lib/generators/madmin/field/field_generator.rb
140
139
  - lib/generators/madmin/field/templates/_form.html.erb
@@ -1,20 +0,0 @@
1
- <%#
2
- This template is i18n-ready: if you don't use i18n, then you can replace the pagy_t
3
- calls with the actual strings ("&lsaquo; Prev", "Next &rsaquo;", "&hellip;").
4
- The link variable is set to a proc that returns the link tag.
5
- Usage: link.call( page_number [, text [, extra_attributes_string ]])
6
- -%>
7
- <% link = pagy_link_proc(pagy) -%>
8
- <%# -%><nav aria-label="pager" class="space-x-1 px-2 py-1" role="navigation">
9
- <% if pagy.prev -%> <span><%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="text-white bg-indigo-500 rounded-2xl px-3 py-1.5"') %></span>
10
- <% else -%> <span class="text-gray-400 bg-gray-100 rounded-2xl px-3 py-1.5 cursor-not-allowed"><%== pagy_t('pagy.nav.prev') %></span>
11
- <% end -%>
12
- <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
13
- <% if item.is_a?(Integer) -%> <span><%== link.call(item, item, 'class="text-gray-400 rounded-full px-2.5 py-1.5 hover:bg-indigo-200 hover:text-indigo-500"') %></span>
14
- <% elsif item.is_a?(String) -%> <span class="text-indigo-500 font-semibold px-2.5 py-1.5"><%= item %></span>
15
- <% elsif item == :gap -%> <span class="text-gray-400 text-xl px-1.5 py-1.5"><%== pagy_t('pagy.nav.gap') %></span>
16
- <% end -%>
17
- <% end -%>
18
- <% if pagy.next -%> <span><%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next" class="text-white bg-indigo-500 rounded-2xl px-3 py-1.5"') %></span>
19
- <% else -%> <span class="text-gray-400 bg-gray-100 rounded-2xl px-3 py-1.5 cursor-not-allowed"><%== pagy_t('pagy.nav.next') %></span>
20
- <% end -%>