lotus_admin 1.5.3 → 1.5.8
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/lotus_admin/resource_controller.rb +33 -15
- data/app/controllers/lotus_admin/users_controller.rb +1 -1
- data/app/helpers/lotus_admin/link_helpers.rb +4 -4
- data/app/views/lotus_admin/shared/filters/_modal.html.haml +5 -3
- data/lib/lotus_admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2831babc787ade51626bda751e5d640af336f640413a3d3a6cf8da991046a862
|
4
|
+
data.tar.gz: '09f3ba2f70b0350b68b9b7eba027c250730890a98261373db837cd6203e3b00d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa99bfe18665c700aaf3083355e8a3369336338682bfd7e990fb797f9dc54fe8d9d17accdb1f5a152834e27e85d425b189d17c2138d94efe5d338f836b51b0e1
|
7
|
+
data.tar.gz: d64d541c9598fd6993a47f04554a6a32d674c7a3e9e9d2f6541b527ff933a27aa4dc53e576df547519c782d1f663c29998f8d048b76d58242ac67b8236e34989
|
@@ -32,7 +32,7 @@ class LotusAdmin::ResourceController < LotusAdmin::AuthenticatedController
|
|
32
32
|
format.html
|
33
33
|
|
34
34
|
if block.present?
|
35
|
-
block.call
|
35
|
+
block.call(format)
|
36
36
|
else
|
37
37
|
if resource.save
|
38
38
|
redirect_to after_create_redirect, notice: "Created new #{ resource_class.model_name.human } successfully"
|
@@ -56,13 +56,17 @@ class LotusAdmin::ResourceController < LotusAdmin::AuthenticatedController
|
|
56
56
|
def update(&block)
|
57
57
|
authorize(resource) if using_pundit?
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
if
|
63
|
-
|
59
|
+
respond_to do |format|
|
60
|
+
format.html
|
61
|
+
|
62
|
+
if block.present?
|
63
|
+
block.call(format)
|
64
64
|
else
|
65
|
-
|
65
|
+
if resource.update(permitted_params)
|
66
|
+
redirect_to after_update_redirect, notice: "Updated #{ resource_class.model_name.human } successfully"
|
67
|
+
else
|
68
|
+
render :edit
|
69
|
+
end
|
66
70
|
end
|
67
71
|
end
|
68
72
|
end
|
@@ -77,20 +81,34 @@ class LotusAdmin::ResourceController < LotusAdmin::AuthenticatedController
|
|
77
81
|
end
|
78
82
|
end
|
79
83
|
|
80
|
-
def show
|
84
|
+
def show(&block)
|
81
85
|
authorize(resource) if using_pundit?
|
86
|
+
|
87
|
+
respond_to do |format|
|
88
|
+
format.html
|
89
|
+
|
90
|
+
block.call(format) if block.present?
|
91
|
+
end
|
82
92
|
end
|
83
93
|
|
84
|
-
def destroy
|
94
|
+
def destroy(&block)
|
85
95
|
authorize(resource) if using_pundit?
|
86
96
|
|
87
|
-
|
88
|
-
|
89
|
-
else
|
90
|
-
flash[:error] = "There was an error removing that #{ resource_class.model_name.human }"
|
91
|
-
end
|
97
|
+
respond_to do |format|
|
98
|
+
format.html
|
92
99
|
|
93
|
-
|
100
|
+
if block.present?
|
101
|
+
block.call(format)
|
102
|
+
else
|
103
|
+
if resource.destroy
|
104
|
+
flash[:notice] = "#{ resource_class.model_name.human } has been removed"
|
105
|
+
else
|
106
|
+
flash[:error] = "There was an error removing that #{ resource_class.model_name.human }"
|
107
|
+
end
|
108
|
+
|
109
|
+
redirect_to after_destroy_redirect
|
110
|
+
end
|
111
|
+
end
|
94
112
|
end
|
95
113
|
|
96
114
|
private
|
@@ -33,25 +33,25 @@ module LotusAdmin
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def view_link(resource)
|
36
|
-
link_to lotus_admin.polymorphic_path(undecorated(resource)) do
|
36
|
+
link_to lotus_admin.polymorphic_path(undecorated(resource)), title: 'View Details' do
|
37
37
|
content_tag(:i, nil, class: 'zmdi zmdi-eye')
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def new_link(parent = nil)
|
42
|
-
link_to lotus_admin.new_polymorphic_path([parent, resource_class].compact) do
|
42
|
+
link_to lotus_admin.new_polymorphic_path([parent, resource_class].compact), title: 'New' do
|
43
43
|
content_tag(:i, nil, class: 'zmdi zmdi-plus-circle')
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
47
|
def edit_link(resource)
|
48
|
-
link_to lotus_admin.edit_polymorphic_path(undecorated(resource)) do
|
48
|
+
link_to lotus_admin.edit_polymorphic_path(undecorated(resource)), title: 'Edit' do
|
49
49
|
content_tag(:i, nil, class: 'zmdi zmdi-edit')
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
53
|
def destroy_link(resource)
|
54
|
-
link_to lotus_admin.polymorphic_path(undecorated(resource)), data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
|
54
|
+
link_to lotus_admin.polymorphic_path(undecorated(resource)), title: 'Delete', data: { method: :delete, confirm: "Are you sure you want to remove this #{ resource.model_name.human }?" } do
|
55
55
|
content_tag(:i, nil, class: 'zmdi zmdi-delete')
|
56
56
|
end
|
57
57
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#filter-modal.modal.fade
|
2
|
-
.modal-dialog
|
2
|
+
.modal-dialog.modal-lg
|
3
3
|
.modal-content
|
4
4
|
= search_form_for ransack_object, url: collection_path, class: 'filter-form' do |f|
|
5
5
|
.modal-header
|
@@ -9,8 +9,10 @@
|
|
9
9
|
%h4.modal-title= t('lotus_admin.filters.modal.title')
|
10
10
|
|
11
11
|
.modal-body
|
12
|
-
- filters.each do |
|
13
|
-
|
12
|
+
- filters.in_groups_of(2, false).each do |group|
|
13
|
+
.row
|
14
|
+
- group.each do |filter|
|
15
|
+
.col-sm-6= filter.render(f)
|
14
16
|
|
15
17
|
.modal-footer
|
16
18
|
= link_to t('lotus_admin.filters.modal.reset_btn'), collection_path, class: 'btn btn-link pull-left'
|
data/lib/lotus_admin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lotus_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Millsaps-Brewer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|