thecore_ui_rails_admin 3.1.6 → 3.2.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c9347e99012db26dc415185e7817f487667788ff191be2bf93abbf919aa0be
|
4
|
+
data.tar.gz: 6454e875e9a20d559d0ac40deb90efdf30eb72b767815b3630e535048b31207f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f39f555471d24bf9816dfad0801b7bfa9af5ddc027640dd700750b336dd8756048cdcefbcefdd9b32a8f033852734bf38f27ebaf31608c54b1bbb968b79dc2c5
|
7
|
+
data.tar.gz: 6fe692c6e591f22d3e89b0aeaa4985e6c651aef2fc678225e1b0a3a354a11a7078faa6c6b0f83d02b397e1d6f796d7b41becc9eb2df959b8d9e7630aab228962
|
@@ -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.1
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriele Tassoni
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thecore_ui_commons
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '3.
|
19
|
+
version: '3.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '3.
|
26
|
+
version: '3.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails_admin
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -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
|
@@ -133,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
135
|
- !ruby/object:Gem::Version
|
134
136
|
version: '0'
|
135
137
|
requirements: []
|
136
|
-
rubygems_version: 3.
|
138
|
+
rubygems_version: 3.5.3
|
137
139
|
signing_key:
|
138
140
|
specification_version: 4
|
139
141
|
summary: Thecore Backend UI based on Rails Admin.
|