thecore_ui_rails_admin 3.1.6 → 3.2.0
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/views/rails_admin/main/change_password.html.erb +32 -0
- data/config/initializers/after_initialize.rb +1 -0
- data/config/initializers/concern_user.rb +2 -2
- data/config/locales/en.rails_admin.yml +11 -4
- data/config/locales/it.rails_admin.yml +6 -0
- data/lib/member_actions/change_password.rb +27 -0
- data/lib/thecore_ui_rails_admin/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 780e74c963f949fbc4f0600a0eeb68d1090c78205f8f481da5dbde8d45ca5f1d
|
4
|
+
data.tar.gz: 92c87402538dd7b41a173d0b21a8c22f3660c0b221f79f3c3d565d5265afbc00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ae757f51afe65c51e0021df64e4557b2d5f0297779c418800583a8116c7251e623d66ab41e7d0c4fdf93875463d0469749275fc3b9300a3fd01e091119d0396
|
7
|
+
data.tar.gz: 45164b9d4b3c310739b7b497d8f2768f5c80505859fd484f5a3484a947bde98e20e5025f28d0aa2cea007fcf64877eb7d123de0313bb3d95232f5104c5fc163c
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<%= form_for(@object, url: change_password_path, html: { method: :patch }, class: "main") do |f| %>
|
2
|
+
|
3
|
+
<fieldset>
|
4
|
+
<div class="control-group row mb-3 string_type password_field " id="user_password_field">
|
5
|
+
<label class="col-sm-2 col-form-label text-md-end" for="user_password">Password</label>
|
6
|
+
<div class="col-sm-10 controls">
|
7
|
+
<input class="form-control" required="required" size="50" type="password" name="user[password]" id="user_password">
|
8
|
+
<div class="form-text"><%=t('admin.form.required')%></div>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div class="control-group row mb-3 string_type password_confirmation_field " id="user_password_confirmation_field">
|
12
|
+
<label class="col-sm-2 col-form-label text-md-end" for="user_password_confirmation">Password Confirmation</label>
|
13
|
+
<div class="col-sm-10 controls">
|
14
|
+
<input class="form-control" required="required" size="50" type="password" name="user[password_confirmation]" id="user_password_confirmation">
|
15
|
+
<div class="form-text"><%=t('admin.form.required')%></div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</fieldset>
|
19
|
+
<div class="form-actions row justify-content-end my-3">
|
20
|
+
<div class="col-sm-10">
|
21
|
+
<input name="return_to" type="hidden" value="<%=edit_path(@abstract_model, @object.id)%>">
|
22
|
+
<button class="btn btn-primary" data-disable-with="Save" name="_save" type="submit">
|
23
|
+
<i class="fas fa-check"></i>
|
24
|
+
Save
|
25
|
+
</button>
|
26
|
+
<button class="btn btn-light" data-disable-with="Cancel" formnovalidate="true" name="_continue" type="submit">
|
27
|
+
<i class="fas fa-times"></i>
|
28
|
+
Cancel
|
29
|
+
</button>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
@@ -1,12 +1,19 @@
|
|
1
1
|
en:
|
2
2
|
admin:
|
3
|
+
misc:
|
4
|
+
reset_filters: Remove Filters
|
3
5
|
actions:
|
6
|
+
index:
|
7
|
+
no_records: No records to show
|
4
8
|
active_job_monitor:
|
5
9
|
menu: Async Worker Monitor
|
6
10
|
title: Async Worker Monitor
|
7
11
|
breadcrumb: Async Worker Monitor
|
8
|
-
|
9
|
-
|
12
|
+
change_password:
|
13
|
+
title: Change Password
|
14
|
+
breadcrumb: Change Password
|
15
|
+
menu: Change Password
|
16
|
+
success: Your password has been changed successfully
|
17
|
+
error: An error occurred while changing your password
|
10
18
|
scopes:
|
11
|
-
_all:
|
12
|
-
|
19
|
+
_all: All
|
@@ -9,5 +9,11 @@ it:
|
|
9
9
|
menu: Async Worker Monitor
|
10
10
|
title: Async Worker Monitor
|
11
11
|
breadcrumb: Async Worker Monitor
|
12
|
+
change_password:
|
13
|
+
title: Cambia Password
|
14
|
+
breadcrumb: Cambia Password
|
15
|
+
menu: Cambia Password
|
16
|
+
success: La tua password è stata cambiata con successo
|
17
|
+
error: Si è verificato un errore durante il cambio della password
|
12
18
|
scopes:
|
13
19
|
_all: Tutti
|
@@ -0,0 +1,27 @@
|
|
1
|
+
RailsAdmin::Config::Actions.add_action "change_password", :base, :member do
|
2
|
+
|
3
|
+
link_icon 'fas fa-shield'
|
4
|
+
|
5
|
+
http_methods [:get, :patch]
|
6
|
+
|
7
|
+
# Visible only for the User model
|
8
|
+
visible do
|
9
|
+
bindings[:object].is_a?(::User)
|
10
|
+
end
|
11
|
+
# Adding the controller which is needed to compute calls from the ui
|
12
|
+
controller do
|
13
|
+
proc do
|
14
|
+
# if it's a form submission, then update the password
|
15
|
+
if request.patch?
|
16
|
+
if ::User.find(@object.id).update(password: params[:user][:password], password_confirmation: params[:user][:password_confirmation])
|
17
|
+
flash[:success] = I18n.t("admin.actions.change_password.success")
|
18
|
+
else
|
19
|
+
# Add errors to the object
|
20
|
+
flash[:error] = I18n.t("admin.actions.change_password.error")
|
21
|
+
end
|
22
|
+
# Redirect to the object
|
23
|
+
redirect_to index_path(model_name: @abstract_model.to_param)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thecore_ui_rails_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06
|
11
|
+
date: 2023-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_ui_commons
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- app/views/rails_admin/main/_dashboard_block.html.erb
|
84
84
|
- app/views/rails_admin/main/_form_boolean.html.erb
|
85
85
|
- app/views/rails_admin/main/active_job_monitor.html.erb
|
86
|
+
- app/views/rails_admin/main/change_password.html.erb
|
86
87
|
- app/views/rails_admin/main/dashboard.html.erb
|
87
88
|
- config/initializers/abilities.rb
|
88
89
|
- config/initializers/add_to_db_migrations.rb
|
@@ -106,6 +107,7 @@ files:
|
|
106
107
|
- config/locales/it.rails_admin.yml
|
107
108
|
- config/locales/it.rollincode.yml
|
108
109
|
- db/seeds.rb
|
110
|
+
- lib/member_actions/change_password.rb
|
109
111
|
- lib/root_actions/active_job_monitor.rb
|
110
112
|
- lib/tasks/thecore_ui_rails_admin_tasks.rake
|
111
113
|
- lib/thecore_ui_rails_admin.rb
|