lesli_shield 1.0.0 → 1.0.2
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/assets/stylesheets/lesli_shield/passwords.css +1 -1
- data/app/assets/stylesheets/lesli_shield/registrations.css +1 -1
- data/app/assets/stylesheets/lesli_shield/sessions.css +1 -1
- data/app/controllers/lesli_shield/role/actions_controller.rb +38 -5
- data/app/controllers/lesli_shield/roles_controller.rb +1 -1
- data/app/controllers/users/confirmations_controller.rb +1 -1
- data/app/controllers/users/registrations_controller.rb +2 -2
- data/app/interfaces/lesli_shield/authorization_interface.rb +2 -2
- data/app/models/lesli_shield/account.rb +44 -0
- data/app/models/lesli_shield/dashboard.rb +33 -24
- data/app/operators/lesli_shield/user_registration_operator.rb +123 -0
- data/app/services/lesli_shield/tokens.rb +39 -0
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/sessions/new.html.erb +2 -0
- data/app/views/lesli_shield/roles/_form-privileges.html.erb +29 -3
- data/app/views/lesli_shield/roles/show.html.erb +3 -3
- data/app/views/lesli_shield/users/_information-card.html.erb +3 -3
- data/app/views/lesli_shield/users/show.html.erb +1 -1
- data/lib/lesli_shield/engine.rb +0 -4
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/scss/_devise-simple.scss +1 -1
- data/lib/scss/_devise.scss +1 -19
- data/lib/scss/registrations.scss +32 -0
- data/lib/scss/sessions.scss +31 -0
- data/lib/tasks/lesli_shield_tasks.rake +3 -4
- data/readme.md +31 -17
- metadata +9 -6
@@ -1,13 +1,46 @@
|
|
1
1
|
module LesliShield
|
2
2
|
class Role::ActionsController < ApplicationController
|
3
|
-
|
3
|
+
before_action :set_role_action, only: %i[update destroy ]
|
4
4
|
|
5
5
|
def update
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
# check saved
|
7
|
+
if @role_action.result.recover
|
8
|
+
success("Role privileges added successfully!")
|
9
|
+
respond_to do |format|
|
10
|
+
format.turbo_stream
|
11
|
+
render turbo_stream: turbo_stream.replace("application-lesli-notifications", partial: "lesli/partials/application-lesli-notifications")
|
12
|
+
#format.html { redirect_to role_path(@role_action.role_id) }
|
13
|
+
end
|
14
|
+
else
|
15
|
+
respond_with_error(@user.errors)
|
10
16
|
end
|
11
17
|
end
|
18
|
+
|
19
|
+
def destroy
|
20
|
+
# check saved
|
21
|
+
if @role_action.result.destroy
|
22
|
+
# success("Role privileges removed successfully!")
|
23
|
+
# respond_to do |format|
|
24
|
+
# format.turbo_stream
|
25
|
+
# #format.html { redirect_to role_path(@role_action.role_id) }
|
26
|
+
# end
|
27
|
+
return true
|
28
|
+
else
|
29
|
+
respond_with_error(@user.errors)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
# Use callbacks to share common setup or constraints between actions.
|
36
|
+
def set_role_action
|
37
|
+
@role_action = Lesli::Role::ActionService.new(current_user).find(params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
def role_action_params
|
41
|
+
params.require(:role_action).permit(
|
42
|
+
:role_id
|
43
|
+
)
|
44
|
+
end
|
12
45
|
end
|
13
46
|
end
|
@@ -40,7 +40,7 @@ module LesliShield
|
|
40
40
|
|
41
41
|
def show
|
42
42
|
@role = @role.show
|
43
|
-
@role_actions = Lesli::Role::ActionService.new(current_user, query).index(
|
43
|
+
@role_actions = Lesli::Role::ActionService.new(current_user, query).index(@role.id)
|
44
44
|
end
|
45
45
|
|
46
46
|
# @return [HTML] HTML view for creating a new role
|
@@ -26,7 +26,7 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
|
|
26
26
|
activity = user.activities.create({ title: "user_confirmation", description: "Confirmation process started" })
|
27
27
|
|
28
28
|
|
29
|
-
registration_operator =
|
29
|
+
registration_operator = LesliShield::UserRegistrationOperator.new(user)
|
30
30
|
|
31
31
|
# confirm the user
|
32
32
|
registration_operator.confirm
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
Lesli
|
6
6
|
|
7
|
-
Copyright (c)
|
7
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
8
8
|
|
9
9
|
This program is free software: you can redistribute it and/or modify
|
10
10
|
it under the terms of the GNU General Public License as published by
|
@@ -21,7 +21,7 @@ along with this program. If not, see http://www.gnu.org/licenses/.
|
|
21
21
|
|
22
22
|
Lesli · Ruby on Rails SaaS Development Framework.
|
23
23
|
|
24
|
-
Made with ♥ by
|
24
|
+
Made with ♥ by LesliTech
|
25
25
|
Building a better future, one line of code at a time.
|
26
26
|
|
27
27
|
@contact hello@lesli.tech
|
@@ -28,12 +28,12 @@ module LesliShield
|
|
28
28
|
# privilege for object not found
|
29
29
|
if granted.blank?
|
30
30
|
current_user.activities.create({ title: "privilege_not_found", description: request.path })
|
31
|
-
return respond_with_unauthorized({ controller: params[:controller],
|
31
|
+
return respond_with_unauthorized({ controller: params[:controller], action: params[:action] })
|
32
32
|
end
|
33
33
|
|
34
34
|
unless granted
|
35
35
|
current_user.activities.create({ title: "privilege_not_granted", description: request.path })
|
36
|
-
return respond_with_unauthorized({ controller: params[:controller],
|
36
|
+
return respond_with_unauthorized({ controller: params[:controller], action: params[:action] })
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
module LesliShield
|
34
|
+
class Account < ApplicationRecord
|
35
|
+
belongs_to :account, class_name: "Lesli::Account"
|
36
|
+
has_many :dashboards
|
37
|
+
|
38
|
+
after_create :initialize_account
|
39
|
+
|
40
|
+
def initialize_account
|
41
|
+
Dashboard.initialize_account(self)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -1,31 +1,40 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
1
33
|
module LesliShield
|
2
34
|
class Dashboard < Lesli::Shared::Dashboard
|
3
35
|
self.table_name = "lesli_shield_dashboards"
|
4
36
|
belongs_to :account
|
5
37
|
|
6
|
-
|
7
|
-
accepts_nested_attributes_for :components, allow_destroy: true
|
8
|
-
|
9
|
-
def self.initialize_account(account)
|
10
|
-
self.create!(
|
11
|
-
account: account,
|
12
|
-
name: "Audit Default Dashboard",
|
13
|
-
default: true,
|
14
|
-
main: false,
|
15
|
-
components_attributes: [{
|
16
|
-
name: "Total users",
|
17
|
-
component_id: "audit-users",
|
18
|
-
layout: 3,
|
19
|
-
query_configuration: {},
|
20
|
-
custom_configuration: {}
|
21
|
-
}, {
|
22
|
-
name: "Roles",
|
23
|
-
component_id: "audit-roles",
|
24
|
-
layout: 3,
|
25
|
-
query_configuration: {},
|
26
|
-
custom_configuration: {}
|
27
|
-
}]
|
28
|
-
)
|
29
|
-
end
|
38
|
+
COMPONENTS = %i[]
|
30
39
|
end
|
31
40
|
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails Development Platform.
|
21
|
+
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
module LesliShield
|
35
|
+
class UserRegistrationOperator < Lesli::ApplicationLesliService
|
36
|
+
|
37
|
+
def initialize(current_user)
|
38
|
+
@resource = current_user
|
39
|
+
@current_user = current_user
|
40
|
+
end
|
41
|
+
|
42
|
+
def confirm
|
43
|
+
|
44
|
+
if current_user.blank?
|
45
|
+
failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
|
46
|
+
return self
|
47
|
+
end
|
48
|
+
|
49
|
+
# confirm the user
|
50
|
+
current_user.confirm
|
51
|
+
|
52
|
+
# force token deletion so we are sure nobody will be able to use the token again
|
53
|
+
resource.update(confirmation_token: nil)
|
54
|
+
|
55
|
+
# send a welcome email to user as is confirmed
|
56
|
+
Lesli::DeviseMailer.with(user: resource).welcome.deliver_later
|
57
|
+
|
58
|
+
# initialize user dependencies
|
59
|
+
current_user.after_confirmation
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def create_account
|
64
|
+
|
65
|
+
if resource.blank?
|
66
|
+
failures.push(I18n.t("core.shared.messages_warning_user_not_found"))
|
67
|
+
return self
|
68
|
+
end
|
69
|
+
|
70
|
+
if resource.account
|
71
|
+
failures.push(I18n.t("core.users.messages_info_user_already_belongs_to_account"))
|
72
|
+
return self
|
73
|
+
end
|
74
|
+
|
75
|
+
# check if instance is for multi-account
|
76
|
+
allow_multiaccount = Lesli.config.security.dig(:allow_multiaccount)
|
77
|
+
|
78
|
+
# create new account for the new user only if multi-account is allowed
|
79
|
+
if allow_multiaccount === true
|
80
|
+
account = Lesli::Account.create!({
|
81
|
+
user: resource, # set user as owner of his just created account
|
82
|
+
name: "Lesli", # temporary company name
|
83
|
+
email: resource.email,
|
84
|
+
status: :active # account is active due user already confirmed his email
|
85
|
+
})
|
86
|
+
end
|
87
|
+
|
88
|
+
# if multi-account is not allowed user belongs to the first account in instance
|
89
|
+
if allow_multiaccount === false
|
90
|
+
account = Lesli::Account.first
|
91
|
+
end
|
92
|
+
|
93
|
+
# add user to his own account
|
94
|
+
resource.account = account
|
95
|
+
|
96
|
+
# add owner role to user only if multi-account is allowed
|
97
|
+
if allow_multiaccount == true
|
98
|
+
resource.roles.create({ role: account.roles.find_by(name: "owner") })
|
99
|
+
end
|
100
|
+
|
101
|
+
# add profile role to user only if multi-account is allowed
|
102
|
+
if allow_multiaccount == false
|
103
|
+
# Assigning default role if defined in account settings
|
104
|
+
# Otherwise, the default role is "limited"
|
105
|
+
#default_role_id = account.settings.find_by(:name => "default_role_id")&.value
|
106
|
+
default_role_id = nil
|
107
|
+
|
108
|
+
if default_role_id.present?
|
109
|
+
resource.roles.create({ role: account.roles.find_by(:id => default_role_id)})
|
110
|
+
else
|
111
|
+
resource.roles.create({ role: account.roles.find_by(name: "limited") })
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
# update user :)
|
116
|
+
resource.save
|
117
|
+
|
118
|
+
# initialize user dependencies
|
119
|
+
resource.after_account_assignation
|
120
|
+
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Lesli
|
4
|
+
|
5
|
+
Copyright (c) 2025, Lesli Technologies, S. A.
|
6
|
+
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
8
|
+
it under the terms of the GNU General Public License as published by
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
10
|
+
(at your option) any later version.
|
11
|
+
|
12
|
+
This program is distributed in the hope that it will be useful,
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
+
GNU General Public License for more details.
|
16
|
+
|
17
|
+
You should have received a copy of the GNU General Public License
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
19
|
+
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
21
|
+
|
22
|
+
Made with ♥ by LesliTech
|
23
|
+
Building a better future, one line of code at a time.
|
24
|
+
|
25
|
+
@contact hello@lesli.tech
|
26
|
+
@website https://www.lesli.tech
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
28
|
+
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
31
|
+
=end
|
32
|
+
|
33
|
+
module LesliShield
|
34
|
+
class Tokens < Lesli::ApplicationLesliService
|
35
|
+
def self.friendly_token(length:40)
|
36
|
+
Devise.friendly_token(length)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -17,7 +17,7 @@
|
|
17
17
|
label: "Enter your email address you use in Lesli. We'll send instructions for setting a new password to your email.")
|
18
18
|
%>
|
19
19
|
|
20
|
-
<%= form.field_control_button("Send me reset password instructions", icon:"
|
20
|
+
<%= form.field_control_button("Send me reset password instructions", icon:"mail") %>
|
21
21
|
|
22
22
|
<% if Lesli.config.security.dig(:allow_registration) %>
|
23
23
|
<p class="account has-text-centered">
|
@@ -65,9 +65,9 @@ columns = [{
|
|
65
65
|
<% row.with_cell do %>
|
66
66
|
<% if action %>
|
67
67
|
<%= button_to role_action_path(action),
|
68
|
-
method: :patch,
|
69
|
-
|
70
|
-
|
68
|
+
method: (action[:active] == 1 ? :delete : :patch),
|
69
|
+
class: "mini-toggle #{action[:active] == 1 ? 'active' : ''}",
|
70
|
+
form: { "x-data" => "toggleForm", "x-on:submit.prevent" => "submit($el)" } do %>
|
71
71
|
<span class="mini-toggle-slider"></span>
|
72
72
|
<% end %>
|
73
73
|
<% end %>
|
@@ -76,3 +76,29 @@ columns = [{
|
|
76
76
|
<% end %>
|
77
77
|
<% end %>
|
78
78
|
<% end %>
|
79
|
+
<script>
|
80
|
+
document.addEventListener('alpine:init', () => {
|
81
|
+
Alpine.data('toggleForm', () => ({
|
82
|
+
submit(form) {
|
83
|
+
const method = form.querySelector('input[name="_method"]')?.value?.toUpperCase() || form.method.toUpperCase();
|
84
|
+
fetch(form.action, {
|
85
|
+
method: method,
|
86
|
+
headers: {
|
87
|
+
'X-CSRF-Token': document.querySelector('meta[name="csrf-token"]').content,
|
88
|
+
'Accept': 'text/vnd.turbo-stream.html' // or 'application/json'
|
89
|
+
},
|
90
|
+
//body: new URLSearchParams(new FormData(form))
|
91
|
+
}).then(response => {
|
92
|
+
if (!response.ok) throw new Error("Request failed");
|
93
|
+
return response.text();
|
94
|
+
}).then(() => {
|
95
|
+
// Success! Toggle the class
|
96
|
+
form.querySelector('button')?.classList.toggle('active');
|
97
|
+
}).catch(err => {
|
98
|
+
console.error("Error:", err);
|
99
|
+
alert("Something went wrong");
|
100
|
+
});
|
101
|
+
}
|
102
|
+
}))
|
103
|
+
});
|
104
|
+
</script>
|
@@ -3,11 +3,11 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<%= render LesliView::Components::Tabs.new() do |tabs| %>
|
6
|
-
<% tabs.with_tab(title:"information", icon:"info_outline") do %>
|
7
|
-
<%= render "form-information" %>
|
8
|
-
<% end %>
|
9
6
|
<% tabs.with_tab(title:"privileges", icon:"security") do %>
|
10
7
|
<%= render "form-privileges" %>
|
11
8
|
<% end %>
|
9
|
+
<% tabs.with_tab(title:"information", icon:"info_outline") do %>
|
10
|
+
<%= render "form-information" %>
|
11
|
+
<% end %>
|
12
12
|
<% end %>
|
13
13
|
<% end %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<a class="level-item"
|
17
17
|
href="'mailto:'+storeUser.user.email">
|
18
18
|
<span class="icon is-small mr-2">
|
19
|
-
<span class="material-
|
19
|
+
<span class="material-symbols">
|
20
20
|
email
|
21
21
|
</span>
|
22
22
|
</span>
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<a class="level-item mx-2"
|
26
26
|
href="'tel:'+storeUser.user.telephone">
|
27
27
|
<span class="icon is-small mr-2">
|
28
|
-
<span class="material-
|
28
|
+
<span class="material-symbols">
|
29
29
|
phone
|
30
30
|
</span>
|
31
31
|
</span>
|
@@ -35,7 +35,7 @@
|
|
35
35
|
<!-- Show the max role -->
|
36
36
|
<p class="level-item" v-if="storeUser.role_names">
|
37
37
|
<span class="icon is-small mr-2">
|
38
|
-
<span class="material-
|
38
|
+
<span class="material-symbols">
|
39
39
|
security
|
40
40
|
</span>
|
41
41
|
</span>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
<%= render LesliView::Components::Tabs.new() do |tabs| %>
|
6
6
|
|
7
|
-
<% tabs.with_tab(title:"information", icon:"
|
7
|
+
<% tabs.with_tab(title:"information", icon:"info") do %>
|
8
8
|
<%= render "information-form" %>
|
9
9
|
<% end %>
|
10
10
|
<% tabs.with_tab(title:"Privileges", icon:"security") do %>
|
data/lib/lesli_shield/engine.rb
CHANGED
data/lib/lesli_shield/version.rb
CHANGED
data/lib/scss/_devise.scss
CHANGED
@@ -34,7 +34,7 @@ Building a better future, one line of code at a time.
|
|
34
34
|
|
35
35
|
// ·
|
36
36
|
@use "lesli-css" as lesli;
|
37
|
-
@use "LesliAssets/lib/
|
37
|
+
@use "LesliAssets/lib/lesli_assets_styles/templates/public";
|
38
38
|
|
39
39
|
|
40
40
|
// ·
|
@@ -45,23 +45,6 @@ Building a better future, one line of code at a time.
|
|
45
45
|
}
|
46
46
|
|
47
47
|
|
48
|
-
// · reusable background styles
|
49
|
-
@mixin lesli-login-background() {
|
50
|
-
background: linear-gradient(0deg,
|
51
|
-
rgba(49, 106, 255, 0.4),
|
52
|
-
rgba(49, 106, 255, 0.4)),
|
53
|
-
url("lesli/brand/login-background.jpg");
|
54
|
-
background-position: center;
|
55
|
-
background-size: cover;
|
56
|
-
}
|
57
|
-
|
58
|
-
|
59
|
-
// column with image background right side
|
60
|
-
.column.background {
|
61
|
-
@include lesli-login-background;
|
62
|
-
}
|
63
|
-
|
64
|
-
|
65
48
|
// login form container
|
66
49
|
.column.login-form {
|
67
50
|
max-width: 550px;
|
@@ -144,7 +127,6 @@ Building a better future, one line of code at a time.
|
|
144
127
|
.column.login-form {
|
145
128
|
width: 100%;
|
146
129
|
max-width: 100%;
|
147
|
-
@include lesli-login-background;
|
148
130
|
|
149
131
|
.hero {
|
150
132
|
padding: 2rem 0;
|
data/lib/scss/registrations.scss
CHANGED
@@ -31,5 +31,37 @@ Building a better future, one line of code at a time.
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
|
34
|
+
|
35
|
+
// ·
|
36
|
+
@use "lesli-css" as lesli;
|
37
|
+
|
38
|
+
|
34
39
|
// ·
|
35
40
|
@use "devise";
|
41
|
+
|
42
|
+
|
43
|
+
// ·
|
44
|
+
@mixin lesli-register-background() {
|
45
|
+
background: linear-gradient(0deg,
|
46
|
+
rgba(49, 106, 255, 0.4),
|
47
|
+
rgba(49, 106, 255, 0.4)),
|
48
|
+
url("/lesli/brand/register-background.jpg");
|
49
|
+
background-position: center;
|
50
|
+
background-size: cover;
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
// ·
|
55
|
+
.column.background {
|
56
|
+
@include lesli-register-background;
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
// ·
|
61
|
+
@include lesli.lesli-breakpoint-until-tablet() {
|
62
|
+
|
63
|
+
// login column must be full width on mobile
|
64
|
+
.column.login-form {
|
65
|
+
@include lesli-register-background;
|
66
|
+
}
|
67
|
+
}
|
data/lib/scss/sessions.scss
CHANGED
@@ -31,5 +31,36 @@ Building a better future, one line of code at a time.
|
|
31
31
|
*/
|
32
32
|
|
33
33
|
|
34
|
+
// ·
|
35
|
+
@use "lesli-css" as lesli;
|
36
|
+
|
37
|
+
|
34
38
|
// ·
|
35
39
|
@use "devise";
|
40
|
+
|
41
|
+
|
42
|
+
// ·
|
43
|
+
@mixin lesli-login-background() {
|
44
|
+
background: linear-gradient(0deg,
|
45
|
+
rgba(49, 106, 255, 0.4),
|
46
|
+
rgba(49, 106, 255, 0.4)),
|
47
|
+
url("/lesli/brand/login-background.jpg");
|
48
|
+
background-position: center;
|
49
|
+
background-size: cover;
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
// ·
|
54
|
+
.column.background {
|
55
|
+
@include lesli-login-background;
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
// ·
|
60
|
+
@include lesli.lesli-breakpoint-until-tablet() {
|
61
|
+
|
62
|
+
// login column must be full width on mobile
|
63
|
+
.column.login-form {
|
64
|
+
@include lesli-login-background;
|
65
|
+
}
|
66
|
+
}
|
@@ -34,16 +34,15 @@ namespace :lesli_shield do
|
|
34
34
|
|
35
35
|
desc "Syncing privileges for all the available roles"
|
36
36
|
task :privileges => :environment do |task, args|
|
37
|
-
|
37
|
+
lesli_shield_privileges()
|
38
38
|
end
|
39
39
|
|
40
40
|
# Drop, build, migrate & seed database (development only)
|
41
|
-
def
|
41
|
+
def lesli_shield_privileges
|
42
42
|
|
43
43
|
Lesli::Role.all.each do |role|
|
44
|
+
L2.info("LesliShield: Syncing privileges for #{role.name} role.")
|
44
45
|
Lesli::RoleOperator.new(role).synchronize
|
45
46
|
end
|
46
|
-
|
47
|
-
L2.msg("LesliShield: Syncing privileges for all the available roles")
|
48
47
|
end
|
49
48
|
end
|