adminpanel 2.3.0 → 2.3.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 +4 -4
- data/.travis.yml +1 -1
- data/CONTRIBUTING.md +8 -5
- data/LICENSE.txt +1 -1
- data/app/models/concerns/adminpanel/base.rb +10 -1
- data/app/views/adminpanel/shared/edit.html.erb +1 -1
- data/app/views/adminpanel/shared/index.html.erb +2 -2
- data/app/views/adminpanel/shared/new.html.erb +1 -1
- data/app/views/adminpanel/shared/show.html.erb +1 -1
- data/app/views/layouts/adminpanel/_side_menu.html.erb +9 -3
- data/config/locales/en.yml +2 -2
- data/lib/adminpanel/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1417bec9885c7f685524fceea628b7c79865ae67
|
4
|
+
data.tar.gz: 9c53619401e07fea797f1967059d8373dc8842af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4f9aa5c9059bbd9752fdf286c48d513551e1491faf8e608e72a8465d4e76b7653b5f5905cb3c76ea030848440626ab5836d24755588af0d13581896c1c8c660
|
7
|
+
data.tar.gz: 0c78dfe91781b13aa9e70677d24b3f87ef80347546659e9b72c573af48654c19dbfb88d610230a9302d37b2690aacaa1ea7cee6ae3fae612e7819894695a6595
|
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
CHANGED
@@ -7,16 +7,19 @@ Consider starting the commit message with an applicable emoji:
|
|
7
7
|
* :fire:`:fire:` when removing code or files
|
8
8
|
* :green_heart:`:green_heart:` when fixing the CI build
|
9
9
|
* :white_check_mark:`:white_check_mark:` when adding tests
|
10
|
+
* :arrow_up: `:arrow_up:` when upgrading dependencies
|
11
|
+
* :arrow_down: `:arrow_down:` when downgrading dependencies
|
10
12
|
|
11
|
-
Favor single quotes when not concatenating, double quotes are prefered when
|
13
|
+
Favor single quotes when not concatenating, double quotes are prefered when
|
14
|
+
concatenating, escaping characters or using a single quote in the string:
|
12
15
|
|
13
16
|
Single Quotes:
|
14
|
-
`puts 'hello
|
17
|
+
`puts 'hello adminpanel'`
|
15
18
|
Double Quotes:
|
16
|
-
```
|
19
|
+
```ruby
|
17
20
|
h = 'hello'
|
18
|
-
|
19
|
-
puts "#{h}, #{
|
21
|
+
a = 'adminpanel'
|
22
|
+
puts "#{h}, #{a}"
|
20
23
|
puts "\n hi"
|
21
24
|
puts "it's 6 am"
|
22
25
|
```
|
data/LICENSE.txt
CHANGED
@@ -10,6 +10,7 @@ module Adminpanel
|
|
10
10
|
accepts_nested_attributes_for relation, allow_destroy: true
|
11
11
|
end
|
12
12
|
|
13
|
+
# implementing cache by default.
|
13
14
|
def belongs_to(name, scope = nil, options = {})
|
14
15
|
super(name, scope, options.reverse_merge!({touch: true}))
|
15
16
|
end
|
@@ -18,10 +19,18 @@ module Adminpanel
|
|
18
19
|
[]
|
19
20
|
end
|
20
21
|
|
22
|
+
# The name that is going to be shown in the new button and that is going
|
23
|
+
# to be pluralized (if not overwritten) to generate collection_name
|
21
24
|
def display_name
|
22
25
|
'please overwrite self.display_name'
|
23
26
|
end
|
24
27
|
|
28
|
+
# The word that is going to be shown in the side menu, routes and
|
29
|
+
# breadcrumb.
|
30
|
+
def collection_name
|
31
|
+
display_name.pluralize(I18n.default_locale)
|
32
|
+
end
|
33
|
+
|
25
34
|
def get_attribute_label(field)
|
26
35
|
form_attributes.each do |attribute|
|
27
36
|
attribute.each do |name, properties|
|
@@ -96,7 +105,7 @@ module Adminpanel
|
|
96
105
|
end
|
97
106
|
|
98
107
|
def routes_options
|
99
|
-
{ path:
|
108
|
+
{ path: collection_name.parameterize }
|
100
109
|
end
|
101
110
|
|
102
111
|
def has_route?(route)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<% provide(:page_title, @model.
|
1
|
+
<% provide(:page_title, @model.collection_name) -%>
|
2
2
|
<div class="row-fluid">
|
3
3
|
<%= render 'adminpanel/shared/new_resource_button' %>
|
4
4
|
</div>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<div class="widget-header">
|
8
8
|
<%= content_tag(:i, nil, class: "fa fa-#{@model.icon}") %>
|
9
9
|
<h5>
|
10
|
-
<%= @model.
|
10
|
+
<%= @model.collection_name %>
|
11
11
|
</h5>
|
12
12
|
</div>
|
13
13
|
<div class="widget-body">
|
@@ -18,11 +18,17 @@
|
|
18
18
|
<div class="accordion-heading">
|
19
19
|
<%= link_to(
|
20
20
|
[route_symbol(resource.to_s)],
|
21
|
-
data: {
|
21
|
+
data: {
|
22
|
+
no_transition_cache: true
|
23
|
+
},
|
22
24
|
class: "accordion-toggle accordion-navigation #{is_current_section?(resource_class.display_name)} spinner-link"
|
23
25
|
) do %>
|
24
|
-
<%= content_tag
|
25
|
-
|
26
|
+
<%= content_tag(
|
27
|
+
:i,
|
28
|
+
nil,
|
29
|
+
class: "fa fa-#{resource_class.icon}"
|
30
|
+
) %>
|
31
|
+
<%= resource_class.collection_name %>
|
26
32
|
<% end %>
|
27
33
|
</div>
|
28
34
|
</div>
|
data/config/locales/en.yml
CHANGED
data/lib/adminpanel/version.rb
CHANGED