semantic-administrate 0.10.0 → 0.10.1
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5da26692fe8c8502e3b229f34e8e3fe1001ee5d
|
|
4
|
+
data.tar.gz: de4a3c1383bb31f5073f0746d47c2523e1060d1a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 27e73b6a7beda0711a4c80dcfb8982f9fa0a1757e257023e5bfc5af1d4891885ca6a0c38ea5054d51d0bc6100b4e027a60a5c604bb9a4a89599b2480d18f2a7c
|
|
7
|
+
data.tar.gz: 4eeb2cbc37ffb7faaca3cfa854d59818a0cf1b9d04b791ab8a28602c7cb6843a5dc2ae7ce729c3510ce408ca710fab276c4b469d83ad8e442225a1301a2bfe99
|
|
@@ -6,7 +6,7 @@ By default, the navigation contains navigation links
|
|
|
6
6
|
for all resources in the admin dashboard,
|
|
7
7
|
as defined by the routes in the `admin/` namespace
|
|
8
8
|
%>
|
|
9
|
-
<% Administrate::Namespace.new(namespace).
|
|
9
|
+
<% Administrate::Namespace.new(namespace).index_resources.each do |resource| %>
|
|
10
10
|
<%= link_to(
|
|
11
11
|
[namespace, resource_index_route_key(resource)],
|
|
12
12
|
class: "nav-drawer__menu-item nav-drawer__menu-item--#{nav_link_state(resource)}"
|
|
@@ -10,6 +10,22 @@ module Administrate
|
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
def index_resources
|
|
14
|
+
@index_resources ||= begin
|
|
15
|
+
index_routes = routes.select do |_path, action|
|
|
16
|
+
action == "index"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
index_routes.uniq!
|
|
20
|
+
|
|
21
|
+
index_routes.map do |route|
|
|
22
|
+
path = route[0]
|
|
23
|
+
|
|
24
|
+
::Administrate::Namespace::Resource.new(namespace, path)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
13
29
|
def routes
|
|
14
30
|
@routes ||= all_routes.select do |controller, _action|
|
|
15
31
|
controller.starts_with?("#{namespace}/")
|
data/lib/administrate/version.rb
CHANGED