jav_madmin 2.6.2 → 2.6.4
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/helpers/madmin/nav_helper.rb +6 -1
- data/app/views/madmin/application/edit.html.erb +1 -1
- data/app/views/madmin/application/index.html.erb +2 -2
- data/app/views/madmin/application/new.html.erb +1 -1
- data/app/views/madmin/application/show.html.erb +1 -1
- data/lib/madmin/menu.rb +1 -1
- data/lib/madmin/resource.rb +3 -3
- data/lib/madmin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42d91356c371216c4e08343abcd8e7c4d3a882bc1e1993c771d538e0b0043f0f
|
|
4
|
+
data.tar.gz: 651a12e2e8630370b245eccee8d971aab0defc877901d80e0054d2bd094330d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0722c8fdb86a609e163a64badc2d699be91cd68603d8bd2f7bf24fd40b1f223a1f5838e47bd3a514d77d5b7fe6be921976ac9fd7e09d980fdbcb390d04538ef5
|
|
7
|
+
data.tar.gz: 71cd257d6d538a7e858eb5d582a92558b8e1769e378e2008de169774559dee841c54f0cc926a6532eac4c174bb6110f71bd287a51f2ec920e2f2ca99a8b7059a
|
|
@@ -28,7 +28,12 @@ module Madmin::NavHelper
|
|
|
28
28
|
link_to name, url, html_options
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
# label default is model i18n_key, is a Symbol
|
|
31
32
|
def menu_label(label)
|
|
32
|
-
|
|
33
|
+
if label.is_a?(Symbol)
|
|
34
|
+
I18n.t("activerecord.models.#{label}", count: 2, default: [:"madmin.navigation.#{label}", label.to_s.pluralize(I18n.locale).titleize])
|
|
35
|
+
else
|
|
36
|
+
label
|
|
37
|
+
end
|
|
33
38
|
end
|
|
34
39
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
4
|
<h1>
|
|
5
|
-
<%= link_to resource.friendly_name.pluralize(I18n.locale), resource.index_path %>
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2, default: resource.model_name.pluralize(I18n.locale)), resource.index_path %>
|
|
6
6
|
/
|
|
7
7
|
<strong><%= t("madmin.actions.edit") %> <%= link_to resource.display_name(@record), resource.show_path(@record) %></strong>
|
|
8
8
|
</h1>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<%= content_for :title, resource.friendly_name.pluralize(I18n.locale) %>
|
|
1
|
+
<%= content_for :title, resource.friendly_name(count: 2, default: resource.model_name.pluralize(I18n.locale)) %>
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
|
-
<h1><%= resource.friendly_name.pluralize(I18n.locale) %></h1>
|
|
4
|
+
<h1><%= resource.friendly_name(count: 2, default: resource.model_name.pluralize(I18n.locale)) %></h1>
|
|
5
5
|
|
|
6
6
|
<div class="actions">
|
|
7
7
|
<form class="search">
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
4
|
<h1>
|
|
5
|
-
<%= link_to resource.friendly_name.pluralize(I18n.locale), resource.index_path %>
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2, default: resource.model_name.pluralize(I18n.locale)) , resource.index_path %>
|
|
6
6
|
/
|
|
7
7
|
<strong><%= t("madmin.titles.new", name: resource.friendly_name) %></strong>
|
|
8
8
|
</h1>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
4
|
<h1>
|
|
5
|
-
<%= link_to resource.friendly_name.pluralize(I18n.locale), resource.index_path %>
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2, default: resource.model_name.pluralize(I18n.locale)), resource.index_path %>
|
|
6
6
|
/
|
|
7
7
|
<%= resource.display_name(@record) %>
|
|
8
8
|
</h1>
|
data/lib/madmin/menu.rb
CHANGED
|
@@ -44,7 +44,7 @@ module Madmin
|
|
|
44
44
|
def items
|
|
45
45
|
@children.values.sort do |a, b|
|
|
46
46
|
result = a.position <=> b.position
|
|
47
|
-
result = a.label <=> b.label if result == 0 # sort alphabetically for the same position
|
|
47
|
+
result = a.label.to_s <=> b.label.to_s if result == 0 # sort alphabetically for the same position
|
|
48
48
|
result
|
|
49
49
|
end
|
|
50
50
|
end
|
data/lib/madmin/resource.rb
CHANGED
|
@@ -83,8 +83,8 @@ module Madmin
|
|
|
83
83
|
|
|
84
84
|
# Returns singular name
|
|
85
85
|
# For example: "Forum::Post" -> "Post"
|
|
86
|
-
def friendly_name
|
|
87
|
-
model.model_name.human
|
|
86
|
+
def friendly_name(count: 1, default: nil)
|
|
87
|
+
model.model_name.human(count: count, default: default)
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Support for isolated namespaces
|
|
@@ -286,7 +286,7 @@ module Madmin
|
|
|
286
286
|
def menu_options
|
|
287
287
|
return false if @menu_options == false
|
|
288
288
|
@menu_options ||= {}
|
|
289
|
-
@menu_options.with_defaults(label: model.model_name.i18n_key
|
|
289
|
+
@menu_options.with_defaults(label: model.model_name.i18n_key, url: index_path)
|
|
290
290
|
end
|
|
291
291
|
end
|
|
292
292
|
|
data/lib/madmin/version.rb
CHANGED