lotus_admin 1.5.3 → 1.5.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0009428266da5d0d9c3ea09cbbea1c6f4f2e7f09c9da6a5792c5f2891f9f7f09'
4
- data.tar.gz: 8e0480793bc75ea33106336c1a5fb75d79c09ef1e93fc4b596c92761019fdf93
3
+ metadata.gz: 2831babc787ade51626bda751e5d640af336f640413a3d3a6cf8da991046a862
4
+ data.tar.gz: '09f3ba2f70b0350b68b9b7eba027c250730890a98261373db837cd6203e3b00d'
5
5
  SHA512:
6
- metadata.gz: 7a92fecdde33a23f2fb010d551aaf90f3db1688d767c01154f0c6d6394a3adc3fa1092edc9575b9a4cce5375a7f8e18f3b1e0bb32241acf8b0d726a9f7f4c971
7
- data.tar.gz: 5ffdaafacaba4d838bab07471d727614ff17cacd4da9fae3f75b3aab13254050be2986aa7b57fc80ff8ce0b7678161ee6e6a37637dea2bdf8fe362aa8e8c1c64
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
- if block.present?
60
- block.call
61
- else
62
- if resource.update(permitted_params)
63
- redirect_to after_update_redirect, notice: "Updated #{ resource_class.model_name.human } successfully"
59
+ respond_to do |format|
60
+ format.html
61
+
62
+ if block.present?
63
+ block.call(format)
64
64
  else
65
- render :edit
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
- if resource.destroy
88
- flash[:notice] = "#{ resource_class.model_name.human } has been removed"
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
- redirect_to after_destroy_redirect
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
@@ -12,7 +12,7 @@ module LotusAdmin
12
12
  filter :last_sign_in_at
13
13
 
14
14
  def create
15
- super do
15
+ super do |format|
16
16
  resource.password = Devise.friendly_token.first(8)
17
17
 
18
18
  if resource.save
@@ -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 |filter|
13
- = filter.render(f)
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'
@@ -1,3 +1,3 @@
1
1
  module LotusAdmin
2
- VERSION = '1.5.3'
2
+ VERSION = '1.5.8'
3
3
  end
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.3
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-06-25 00:00:00.000000000 Z
11
+ date: 2020-07-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails