jav_madmin 2.6.4 → 2.6.5
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 +0 -9
- data/app/views/madmin/application/_navigation.html.erb +3 -3
- 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 +9 -1
- data/lib/madmin/resource.rb +2 -2
- 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: bdca12e732cb02bb6a5627f86c80dfc392990e96f6e3170af55981ae3de3d247
|
|
4
|
+
data.tar.gz: 6725ea9f24078be1a59d0fd7c003c261bdd5f21d60d033a2f7d21d3849841176
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0b6000f7c185be369897bfb77396424e44f1492fe499e8ad52d89a1fc6b6d81317a3b3c8afba26c96b8367f20ea1682d63287e8d630c8492e3f7e1757d2cb22
|
|
7
|
+
data.tar.gz: 352f7789b1edff23e396b35ac69f8abf9b4ccd4d7737493df6f519ccab621f77a1919761d4bab23431c2a9fe237385b96414e560c9e3af4b03aeb21a62d1e922
|
|
@@ -27,13 +27,4 @@ module Madmin::NavHelper
|
|
|
27
27
|
|
|
28
28
|
link_to name, url, html_options
|
|
29
29
|
end
|
|
30
|
-
|
|
31
|
-
# label default is model i18n_key, is a Symbol
|
|
32
|
-
def menu_label(label)
|
|
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
|
|
38
|
-
end
|
|
39
30
|
end
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
<% Madmin.menu.render do |item| %>
|
|
5
5
|
<% if item.url %>
|
|
6
|
-
<%= nav_link_to
|
|
6
|
+
<%= nav_link_to item.human_label, item.url, starts_with: item.url %>
|
|
7
7
|
<% else %>
|
|
8
|
-
<h4><%=
|
|
8
|
+
<h4><%= item.human_label %></h4>
|
|
9
9
|
<% end %>
|
|
10
10
|
|
|
11
11
|
<% item.items.each do |item| %>
|
|
12
|
-
<%= nav_link_to
|
|
12
|
+
<%= nav_link_to item.human_label, item.url, starts_with: item.url %>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% end %>
|
|
15
15
|
</nav>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
4
|
<h1>
|
|
5
|
-
<%= link_to resource.friendly_name(count: 2
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2), 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(count: 2
|
|
1
|
+
<%= content_for :title, resource.friendly_name(count: 2) %>
|
|
2
2
|
|
|
3
3
|
<header class="header">
|
|
4
|
-
<h1><%= resource.friendly_name(count: 2
|
|
4
|
+
<h1><%= resource.friendly_name(count: 2) %></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(count: 2
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2) , 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(count: 2
|
|
5
|
+
<%= link_to resource.friendly_name(count: 2), 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.
|
|
47
|
+
result = a.human_label <=> b.human_label if result == 0 # sort alphabetically for the same position
|
|
48
48
|
result
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -65,6 +65,14 @@ module Madmin
|
|
|
65
65
|
@if = options.delete(:if)
|
|
66
66
|
@children = {}
|
|
67
67
|
end
|
|
68
|
+
|
|
69
|
+
def human_label
|
|
70
|
+
@human_label ||= if label.is_a?(Symbol)
|
|
71
|
+
I18n.t("activerecord.models.#{label}", count: 2, default: [:"madmin.navigation.#{label}", label.to_s.pluralize(I18n.locale).titleize])
|
|
72
|
+
else
|
|
73
|
+
label
|
|
74
|
+
end
|
|
75
|
+
end
|
|
68
76
|
end
|
|
69
77
|
end
|
|
70
78
|
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(count: 1
|
|
87
|
-
model.model_name.human(count: count, default:
|
|
86
|
+
def friendly_name(count: 1)
|
|
87
|
+
model.model_name.human(count: count, default: model_name.titleize.pluralize(count, I18n.locale))
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
# Support for isolated namespaces
|
data/lib/madmin/version.rb
CHANGED