madmin 1.2.5 → 1.2.6
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/app/controllers/madmin/dashboard_controller.rb +1 -1
- data/app/helpers/madmin/application_helper.rb +1 -1
- data/app/helpers/madmin/sort_helper.rb +1 -1
- data/app/views/madmin/application/_javascript.html.erb +3 -2
- data/app/views/madmin/fields/attachment/_index.html.erb +1 -1
- data/app/views/madmin/fields/attachment/_show.html.erb +4 -4
- data/app/views/madmin/fields/attachments/_show.html.erb +3 -3
- data/app/views/madmin/fields/text/_index.html.erb +1 -1
- data/lib/generators/madmin/field/templates/_form.html.erb +3 -1
- data/lib/madmin/engine.rb +4 -2
- data/lib/madmin/resource.rb +2 -2
- data/lib/madmin/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79be87e2c5e4bb8b7734ebfac9b623459491a836412bbd0faf077033e6a725ff
|
4
|
+
data.tar.gz: a5f93e689c76e156ab396b7da05d47148e19b9ed7bd1f136c4a13b3530c1852a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bde02b65e86325f630bb2de481a3612e1ae5544891ac3e77bc5ffa78eb158eb6f5603967729040ac408a47f337b42375897848ba89e38a7723ff072dbb97703
|
7
|
+
data.tar.gz: c709b74a65fef5383582e3577268dc61e85cb085ce233da6218b586fcf990da32ef5d60cb4991251b3a6b4485f660e018952135233ba23a3bdfeaadfcdbf459a
|
@@ -4,7 +4,7 @@ module Madmin
|
|
4
4
|
matching_column = (column.to_s == sort_column)
|
5
5
|
direction = sort_direction == "asc" ? "desc" : "asc"
|
6
6
|
|
7
|
-
link_to
|
7
|
+
link_to resource.index_path(sort: column, direction: direction), options do
|
8
8
|
concat title
|
9
9
|
if matching_column
|
10
10
|
concat " "
|
@@ -9,7 +9,7 @@
|
|
9
9
|
import { Dropdown } from "https://cdn.skypack.dev/tailwindcss-stimulus-components"
|
10
10
|
application.register("dropdown", Dropdown)
|
11
11
|
|
12
|
-
import stimulusFlatpickr from 'https://cdn.skypack.dev/stimulus-flatpickr'
|
12
|
+
import stimulusFlatpickr from 'https://cdn.skypack.dev/stimulus-flatpickr@3.0.0-0'
|
13
13
|
application.register("flatpickr", stimulusFlatpickr)
|
14
14
|
|
15
15
|
import TomSelect from 'https://cdn.skypack.dev/tom-select'
|
@@ -38,7 +38,8 @@
|
|
38
38
|
labelField: 'name',
|
39
39
|
searchField: 'name',
|
40
40
|
load: (search, callback) => {
|
41
|
-
|
41
|
+
let url = search ? `${this.urlValue}?q=${search}` : this.urlValue;
|
42
|
+
fetch(url)
|
42
43
|
.then(response => response.json())
|
43
44
|
.then(json => {
|
44
45
|
callback(json);
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<% if (attachment = field.value(record)) && attachment.attached? %>
|
2
2
|
<% if attachment.variable? %>
|
3
|
-
<%= link_to attachment, target: :_blank do %>
|
4
|
-
<%= image_tag attachment, class: "max-h-32" %>
|
3
|
+
<%= link_to main_app.url_for(attachment), target: :_blank do %>
|
4
|
+
<%= image_tag main_app.url_for(attachment), class: "max-h-32" %>
|
5
5
|
<% end %>
|
6
6
|
<% else %>
|
7
|
-
<%= link_to attachment.filename, attachment, target: :_blank, class: "text-indigo-500 underline" %>
|
7
|
+
<%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-indigo-500 underline" %>
|
8
8
|
<% end %>
|
9
|
-
<% end %>
|
9
|
+
<% end %>
|
@@ -1,11 +1,11 @@
|
|
1
1
|
<% if (attachments = field.value(record)) && attachments.attached? %>
|
2
2
|
<% attachments.each do |attachment| %>
|
3
3
|
<% if attachment.variable? %>
|
4
|
-
<%= link_to attachment, target: :_blank do %>
|
5
|
-
<%= image_tag attachment, class: "max-h-32" %>
|
4
|
+
<%= link_to main_app.url_for(attachment), target: :_blank do %>
|
5
|
+
<%= image_tag main_app.url_for(attachment), class: "max-h-32" %>
|
6
6
|
<% end %>
|
7
7
|
<% else %>
|
8
|
-
<%= link_to attachment.filename, attachment, target: :_blank, class: "text-indigo-500 underline" %>
|
8
|
+
<%= link_to attachment.filename, main_app.url_for(attachment), target: :_blank, class: "text-indigo-500 underline" %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
11
11
|
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= truncate field.value(record) %>
|
1
|
+
<%= truncate field.value(record).to_s %>
|
@@ -1,2 +1,4 @@
|
|
1
|
-
|
1
|
+
<div class="block md:inline-block md:w-32 flex-shrink-0 text-gray-700">
|
2
|
+
<%= render "madmin/shared/label", form: form, field: field %>
|
3
|
+
</div>
|
2
4
|
<%= form.text_field field.attribute_name, class: "form-input" %>
|
data/lib/madmin/engine.rb
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
module Madmin
|
2
2
|
class Engine < ::Rails::Engine
|
3
|
+
isolate_namespace Madmin
|
4
|
+
|
3
5
|
config.before_configuration do |app|
|
4
|
-
app.config.
|
5
|
-
app.config.
|
6
|
+
app.config.eager_load_paths << File.expand_path("app/madmin/resources", Rails.root)
|
7
|
+
app.config.eager_load_paths << File.expand_path("app/madmin/fields", Rails.root)
|
6
8
|
end
|
7
9
|
|
8
10
|
config.to_prepare do
|
data/lib/madmin/resource.rb
CHANGED
@@ -55,7 +55,7 @@ module Madmin
|
|
55
55
|
end
|
56
56
|
|
57
57
|
def friendly_name
|
58
|
-
model_name.gsub("::", " / ")
|
58
|
+
model_name.gsub("::", " / ").split(/(?=[A-Z])/).join(" ")
|
59
59
|
end
|
60
60
|
|
61
61
|
# Support for isolated namespaces
|
@@ -89,7 +89,7 @@ module Madmin
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def permitted_params
|
92
|
-
attributes.values.
|
92
|
+
attributes.values.filter { |a| a.field.visible?(:form) }.map { |a| a.field.to_param }
|
93
93
|
end
|
94
94
|
|
95
95
|
def display_name(record)
|
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.6
|
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-
|
12
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: '3.5'
|
35
35
|
- - "<"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
37
|
+
version: '6.0'
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -44,7 +44,7 @@ dependencies:
|
|
44
44
|
version: '3.5'
|
45
45
|
- - "<"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '6.0'
|
48
48
|
description: It's an admin, obviously.
|
49
49
|
email:
|
50
50
|
- excid3@gmail.com
|
@@ -211,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
211
211
|
- !ruby/object:Gem::Version
|
212
212
|
version: '0'
|
213
213
|
requirements: []
|
214
|
-
rubygems_version: 3.2.
|
214
|
+
rubygems_version: 3.2.32
|
215
215
|
signing_key:
|
216
216
|
specification_version: 4
|
217
217
|
summary: A modern admin for Ruby on Rails apps
|