madmin 1.2.9 → 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/views/madmin/application/_javascript.html.erb +31 -0
- data/app/views/madmin/application/edit.html.erb +2 -2
- data/app/views/madmin/application/index.html.erb +4 -4
- data/app/views/madmin/application/new.html.erb +1 -1
- data/app/views/madmin/application/show.html.erb +2 -2
- data/app/views/madmin/fields/attachment/_show.html.erb +1 -1
- data/app/views/madmin/fields/attachments/_show.html.erb +1 -1
- data/app/views/madmin/fields/belongs_to/_show.html.erb +1 -1
- data/app/views/madmin/fields/decimal/_form.html.erb +1 -1
- data/app/views/madmin/fields/file/_form.html.erb +1 -1
- data/app/views/madmin/fields/file/_show.html.erb +1 -1
- data/app/views/madmin/fields/float/_form.html.erb +1 -1
- data/app/views/madmin/fields/has_many/_show.html.erb +1 -1
- data/app/views/madmin/fields/integer/_form.html.erb +1 -1
- data/app/views/madmin/fields/integer/_index.html.erb +1 -1
- data/app/views/madmin/fields/json/_form.html.erb +1 -1
- data/app/views/madmin/fields/nested_has_many/_show.html.erb +1 -1
- data/app/views/madmin/fields/password/_form.html.erb +1 -1
- data/app/views/madmin/fields/polymorphic/_show.html.erb +1 -1
- data/app/views/madmin/fields/rich_text/_form.html.erb +1 -1
- data/app/views/madmin/fields/string/_form.html.erb +1 -1
- data/app/views/madmin/fields/text/_form.html.erb +1 -1
- data/lib/generators/madmin/field/templates/_form.html.erb +1 -1
- data/lib/madmin/version.rb +1 -1
- metadata +2 -3
- data/app/views/madmin/pagy/_nav.html.erb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56db4d11f4d580cf81ae930792f465deefff47373903e5f98503d53314e30eeb
|
4
|
+
data.tar.gz: 7fbf045417bde2b39a4abcf98f86900dd60d3e7e99670139e1fdbec9a1ecf43d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 047cd4d1eceabc2328638b13ee9cb59225b563bd396c02887e89b6a4f6aae3fab5ce38252e7d35981feb1e6cbd76bbc5058c3d9fe686577705a4c48720a9903c
|
7
|
+
data.tar.gz: 96340f347076e77f481482fd1f34fcac7fcb4d3bd22d62ba22957ac58f14375e5641cb8dac30fff8f9c0ac963d1be5e220df3c721666978b4341ec958953094c
|
@@ -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-
|
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-
|
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-
|
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-
|
55
|
-
<%= link_to "Edit", resource.edit_path(record), class: "text-
|
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
|
-
<%==
|
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-
|
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-
|
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-
|
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-
|
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-
|
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-
|
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,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.number_field field.attribute_name, step: :any, class: "form-input" %>
|
4
|
+
<%= form.number_field field.attribute_name, step: :any, class: "flex-grow form-input" %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.file_field field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.file_field field.attribute_name, class: "flex-grow form-input" %>
|
@@ -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-
|
3
|
+
<%= link_to value.url, value.url, target: :_blank, class: "text-blue-500 underline" %>
|
4
4
|
<% else %>
|
5
5
|
<%= value %>
|
6
6
|
<% end %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.number_field field.attribute_name, step: :any, class: "form-input" %>
|
4
|
+
<%= form.number_field field.attribute_name, step: :any, class: "flex-grow form-input" %>
|
@@ -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-
|
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,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.number_field field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.number_field field.attribute_name, class: "flex-grow form-input" %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<% if field.attribute_name == :id %>
|
2
|
-
<%= link_to field.value(record), resource.show_path(record), class: "text-
|
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,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.text_area field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.text_area field.attribute_name, class: "flex-grow form-input" %>
|
@@ -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-
|
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,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.password_field field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.password_field field.attribute_name, class: "flex-grow form-input" %>
|
@@ -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-
|
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,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.text_field field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.text_field field.attribute_name, class: "flex-grow form-input" %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.text_area field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.text_area field.attribute_name, class: "flex-grow form-input" %>
|
@@ -1,4 +1,4 @@
|
|
1
1
|
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
2
|
<%= render "madmin/shared/label", form: form, field: field %>
|
3
3
|
</div>
|
4
|
-
<%= form.text_field field.attribute_name, class: "form-input" %>
|
4
|
+
<%= form.text_field field.attribute_name, class: "flex-grow form-input" %>
|
data/lib/madmin/version.rb
CHANGED
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.
|
4
|
+
version: 1.2.11
|
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-
|
12
|
+
date: 2024-06-12 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 ("‹ Prev", "Next ›", "…").
|
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 -%>
|