lesli_admin 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +5 -0
- data/app/assets/config/lesli_admin_manifest.js +38 -0
- data/app/assets/javascripts/lesli_admin/application.js +3713 -0
- data/app/assets/stylesheets/lesli_admin/application.css +15 -0
- data/app/controllers/lesli_admin/accounts_controller.rb +125 -0
- data/app/controllers/lesli_admin/application_controller.rb +4 -0
- data/app/controllers/lesli_admin/dashboards_controller.rb +60 -0
- data/app/controllers/lesli_admin/users_controller.rb +244 -0
- data/app/helpers/lesli_admin/application_helper.rb +4 -0
- data/app/helpers/lesli_admin/dashboards_helper.rb +4 -0
- data/app/jobs/lesli_admin/application_job.rb +4 -0
- data/app/mailers/lesli_admin/application_mailer.rb +6 -0
- data/app/models/lesli_admin/account.rb +66 -0
- data/app/models/lesli_admin/application_record.rb +5 -0
- data/app/models/lesli_admin/dashboard.rb +4 -0
- data/app/models/lesli_admin/user.rb +4 -0
- data/app/services/lesli_admin/user_service.rb +300 -0
- data/app/views/layouts/lesli_admin/application.html.erb +15 -0
- data/app/views/lesli_admin/accounts/_account.html.erb +2 -0
- data/app/views/lesli_admin/accounts/_form.html.erb +17 -0
- data/app/views/lesli_admin/accounts/edit.html.erb +10 -0
- data/app/views/lesli_admin/accounts/index.html.erb +34 -0
- data/app/views/lesli_admin/accounts/new.html.erb +9 -0
- data/app/views/lesli_admin/accounts/show.html.erb +34 -0
- data/app/views/lesli_admin/dashboards/_dashboard.html.erb +2 -0
- data/app/views/lesli_admin/dashboards/_form.html.erb +17 -0
- data/app/views/lesli_admin/dashboards/edit.html.erb +10 -0
- data/app/views/lesli_admin/dashboards/index.html.erb +14 -0
- data/app/views/lesli_admin/dashboards/new.html.erb +9 -0
- data/app/views/lesli_admin/dashboards/show.html.erb +1 -0
- data/app/views/lesli_admin/partials/_engine-navigation.html.erb +52 -0
- data/app/views/lesli_admin/users/edit.html.erb +10 -0
- data/app/views/lesli_admin/users/index.html.erb +34 -0
- data/app/views/lesli_admin/users/new.html.erb +34 -0
- data/app/views/lesli_admin/users/show.html.erb +10 -0
- data/config/routes.rb +13 -0
- data/lib/lesli_admin/engine.rb +18 -0
- data/lib/lesli_admin/version.rb +3 -0
- data/lib/lesli_admin.rb +6 -0
- data/lib/tasks/lesli_admin_tasks.rake +4 -0
- data/lib/vue/application.js +153 -0
- data/lib/vue/apps/account/components/address-form.vue +134 -0
- data/lib/vue/apps/account/components/contact-form.vue +162 -0
- data/lib/vue/apps/account/components/form-information.vue +107 -0
- data/lib/vue/apps/account/show.vue +89 -0
- data/lib/vue/apps/dashboard/show.vue +33 -0
- data/lib/vue/apps/profile/components/change-email.vue +38 -0
- data/lib/vue/apps/profile/components/subscriptions.vue +94 -0
- data/lib/vue/apps/profile/show.vue +141 -0
- data/lib/vue/apps/users/components/information-card.vue +119 -0
- data/lib/vue/apps/users/components/information-form.vue +180 -0
- data/lib/vue/apps/users/components/integrations-information.vue +61 -0
- data/lib/vue/apps/users/components/management-roles.vue +109 -0
- data/lib/vue/apps/users/components/management-security.vue +113 -0
- data/lib/vue/apps/users/components/management-sessions.vue +106 -0
- data/lib/vue/apps/users/components/management-settings.vue +94 -0
- data/lib/vue/apps/users/index.vue +201 -0
- data/lib/vue/apps/users/new.vue +181 -0
- data/lib/vue/apps/users/show.vue +101 -0
- data/lib/vue/stores/account.js +113 -0
- data/lib/vue/stores/accountSettings.js +342 -0
- data/lib/vue/stores/descriptor.js +116 -0
- data/lib/vue/stores/descriptors.js +167 -0
- data/lib/vue/stores/integration.js +103 -0
- data/lib/vue/stores/role.js +243 -0
- data/lib/vue/stores/roles.js +89 -0
- data/lib/vue/stores/systemController.js +67 -0
- data/lib/vue/stores/user.js +319 -0
- data/lib/vue/stores/users.js +150 -0
- data/readme.md +28 -0
- metadata +130 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
</script>
|
36
|
+
|
37
|
+
<template>
|
38
|
+
</template>
|
@@ -0,0 +1,94 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
// · import vue tools
|
38
|
+
import { ref, reactive, onMounted, watch, computed } from "vue"
|
39
|
+
|
40
|
+
|
41
|
+
// · import lesli stores
|
42
|
+
import { useUser } from "LesliApp/administration/stores/user"
|
43
|
+
|
44
|
+
// · implement stores
|
45
|
+
const storeUser = useUser()
|
46
|
+
|
47
|
+
const engine = ref({ label:"", value:"" })
|
48
|
+
|
49
|
+
|
50
|
+
onMounted(() => {
|
51
|
+
storeUser.getSubscriptionsOptions ()
|
52
|
+
})
|
53
|
+
|
54
|
+
function selectEngine(){
|
55
|
+
storeUser.getSubscriptions(engine.value.value)
|
56
|
+
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
const translations = {
|
61
|
+
users: I18n.t("core.users"),
|
62
|
+
shared: I18n.t("core.shared")
|
63
|
+
}
|
64
|
+
|
65
|
+
const columns = [{
|
66
|
+
field: 'action',
|
67
|
+
label: 'action'
|
68
|
+
}, {
|
69
|
+
field: 'notification_type',
|
70
|
+
label: 'Notification type'
|
71
|
+
}, {
|
72
|
+
field: 'created_at',
|
73
|
+
label: 'Created at'
|
74
|
+
}]
|
75
|
+
|
76
|
+
</script>
|
77
|
+
<template>
|
78
|
+
|
79
|
+
<div class="block">
|
80
|
+
<lesli-select
|
81
|
+
:options="storeUser.options.engines"
|
82
|
+
@change="selectEngine"
|
83
|
+
v-model="engine">
|
84
|
+
</lesli-select>
|
85
|
+
</div>
|
86
|
+
<lesli-table
|
87
|
+
:columns="columns"
|
88
|
+
:records="storeUser.subscriptions">
|
89
|
+
</lesli-table>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
</template>
|
94
|
+
|
@@ -0,0 +1,141 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
// · import vue tools
|
38
|
+
import { ref, reactive, onMounted, watch, computed, onUnmounted } from "vue"
|
39
|
+
import { useRouter, useRoute } from 'vue-router'
|
40
|
+
|
41
|
+
|
42
|
+
// · import lesli stores
|
43
|
+
import { useUser } from "CloudAdmin/stores/user"
|
44
|
+
import { useProfile } from "Lesli/shared/stores/profile"
|
45
|
+
|
46
|
+
|
47
|
+
// · import profile components
|
48
|
+
import informationCard from "CloudAdmin/apps/users/components/information-card.vue"
|
49
|
+
import informationForm from "CloudAdmin/apps/users/components/information-form.vue"
|
50
|
+
|
51
|
+
import managementSession from "CloudAdmin/apps/users/components/management-sessions.vue"
|
52
|
+
import managementSecurity from "CloudAdmin/apps/users/components/management-security.vue"
|
53
|
+
|
54
|
+
import integrationsInformation from "CloudAdmin/apps/users/components/integrations-information.vue"
|
55
|
+
import settings from "CloudAdmin/apps/users/components/management-settings.vue"
|
56
|
+
/*
|
57
|
+
import cardInformation from "../users/components/information-card.vue"
|
58
|
+
import formInformation from "../users/components/information-form.vue"
|
59
|
+
import managementSession from "../users/components/management-sessions.vue"
|
60
|
+
import integrationsInformation from "../users/components/integrations-information.vue"
|
61
|
+
import subscriptionsComponent from "./components/subscriptions.vue"
|
62
|
+
import settings from "../users/components/settings.vue"
|
63
|
+
import changeEmail from "./components/change-email.vue"
|
64
|
+
*/
|
65
|
+
|
66
|
+
|
67
|
+
// · implement stores
|
68
|
+
const storeUser = useUser()
|
69
|
+
const router = useRouter()
|
70
|
+
const route = useRoute()
|
71
|
+
|
72
|
+
|
73
|
+
// · translations
|
74
|
+
const translations = {
|
75
|
+
core: {
|
76
|
+
roles: I18n.t("core.roles"),
|
77
|
+
users: I18n.t("core.users"),
|
78
|
+
shared: I18n.t("core.shared")
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
|
83
|
+
// ·
|
84
|
+
const tab = ref(0)
|
85
|
+
|
86
|
+
|
87
|
+
// ·
|
88
|
+
onMounted(() => {
|
89
|
+
storeUser.getUser()
|
90
|
+
storeUser.getOptions()
|
91
|
+
})
|
92
|
+
|
93
|
+
</script>
|
94
|
+
<template>
|
95
|
+
<application-component>
|
96
|
+
<information-card></information-card>
|
97
|
+
<lesli-tabs v-model="tab" v-if="storeUser.user.id">
|
98
|
+
<lesli-tab-item icon="info_outline" :title="translations.core.users.view_tab_title_information">
|
99
|
+
<information-form></information-form>
|
100
|
+
</lesli-tab-item>
|
101
|
+
<lesli-tab-item icon="security" :title="translations.core.users.view_tab_title_roles_and_privileges">
|
102
|
+
<!--form-roles></form-roles -->
|
103
|
+
</lesli-tab-item>
|
104
|
+
<lesli-tab-item icon="lock_outline" :title="translations.core.users.view_tab_title_security || 'Security'">
|
105
|
+
<management-security></management-security>
|
106
|
+
</lesli-tab-item>
|
107
|
+
<lesli-tab-item icon="devices" :title="translations.core.users.view_tab_title_session || 'Sessions'" paddingless>
|
108
|
+
<management-session></management-session>
|
109
|
+
</lesli-tab-item>
|
110
|
+
<lesli-tab-item icon="settings" :title="translations.core.users.view_tab_title_settings">
|
111
|
+
<!--settings></settings-->
|
112
|
+
</lesli-tab-item>
|
113
|
+
</lesli-tabs>
|
114
|
+
</application-component>
|
115
|
+
<!--
|
116
|
+
<section class="application-component">
|
117
|
+
<information-card></information-card>
|
118
|
+
<lesli-tabs v-if="storeUser.user.id">
|
119
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_information">
|
120
|
+
<information-form></information-form>
|
121
|
+
</lesli-tab-item>
|
122
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_subscriptions">
|
123
|
+
<subscriptions-component>
|
124
|
+
</subscriptions-component>
|
125
|
+
</lesli-tab-item>
|
126
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_security">
|
127
|
+
<form-security></form-security>
|
128
|
+
</lesli-tab-item>
|
129
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_session_management">
|
130
|
+
<management-session></management-session>
|
131
|
+
</lesli-tab-item>
|
132
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_settings">
|
133
|
+
<settings></settings>
|
134
|
+
</lesli-tab-item>
|
135
|
+
<lesli-tab-item :title="translations.core.users.view_tab_title_integrations">
|
136
|
+
<integrations-information></integrations-information>
|
137
|
+
</lesli-tab-item>
|
138
|
+
</lesli-tabs>
|
139
|
+
</section>
|
140
|
+
-->
|
141
|
+
</template>
|
@@ -0,0 +1,119 @@
|
|
1
|
+
<script setup>
|
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
|
+
|
33
|
+
|
34
|
+
// · import vue tools
|
35
|
+
|
36
|
+
|
37
|
+
// · import lesli stores
|
38
|
+
import { useUser } from "LesliApp/administration/stores/user"
|
39
|
+
|
40
|
+
|
41
|
+
// · implement stores
|
42
|
+
const storeUser = useUser()
|
43
|
+
|
44
|
+
|
45
|
+
// · translations
|
46
|
+
const translations = {
|
47
|
+
core: {
|
48
|
+
users: I18n.t("core.users"),
|
49
|
+
shared: I18n.t("core.shared"),
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
</script>
|
54
|
+
<template>
|
55
|
+
<div class="information-card mb-5">
|
56
|
+
<div class="media is-align-items-center">
|
57
|
+
<div class="media-left">
|
58
|
+
<figure class="image is-128x128">
|
59
|
+
<span class="alternative-avatar">
|
60
|
+
{{ storeUser.initials }}
|
61
|
+
</span>
|
62
|
+
</figure>
|
63
|
+
</div>
|
64
|
+
|
65
|
+
<div class="media-content">
|
66
|
+
<div class="content mb-0">
|
67
|
+
<p>
|
68
|
+
<!--
|
69
|
+
<strong>
|
70
|
+
object_utils.translateEnum(translations.core.shared, 'column_enum_salutation', user.detail_attributes.salutation )
|
71
|
+
{{ storeUser.user.detail_attributes.salutation }}
|
72
|
+
</strong>
|
73
|
+
-->
|
74
|
+
<h5 class="title is-5 mb-0">
|
75
|
+
{{ storeUser.user.first_name }}
|
76
|
+
{{ storeUser.user.last_name }}
|
77
|
+
</h5>
|
78
|
+
<p>{{ storeUser.user.detail_attributes.title }}</p>
|
79
|
+
</p>
|
80
|
+
</div>
|
81
|
+
|
82
|
+
<div class="level is-mobile">
|
83
|
+
<div class="level-left">
|
84
|
+
<a class="level-item mr-4"
|
85
|
+
v-if="storeUser.user.email"
|
86
|
+
:href="'mailto:'+storeUser.user.email">
|
87
|
+
<span class="icon is-small mr-2">
|
88
|
+
<span class="material-icons">
|
89
|
+
email
|
90
|
+
</span>
|
91
|
+
</span>
|
92
|
+
{{ storeUser.user.email }}
|
93
|
+
</a>
|
94
|
+
<a class="level-item mr-4"
|
95
|
+
v-if="storeUser.user.telephone"
|
96
|
+
:href="'tel:'+storeUser.user.telephone">
|
97
|
+
<span class="icon is-small mr-2">
|
98
|
+
<span class="material-icons">
|
99
|
+
phone
|
100
|
+
</span>
|
101
|
+
</span>
|
102
|
+
{{ storeUser.user.telephone }}
|
103
|
+
</a>
|
104
|
+
|
105
|
+
<!-- Show the max role -->
|
106
|
+
<p class="level-item">
|
107
|
+
<span class="icon is-small mr-2">
|
108
|
+
<span class="material-icons">
|
109
|
+
security
|
110
|
+
</span>
|
111
|
+
</span>
|
112
|
+
{{ storeUser.role_names }}
|
113
|
+
</p>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
</div>
|
118
|
+
</div>
|
119
|
+
</template>
|
@@ -0,0 +1,180 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
// · import vue tools
|
38
|
+
import { onMounted, inject } from "vue"
|
39
|
+
|
40
|
+
|
41
|
+
// · import lesli stores
|
42
|
+
import { useUser } from "LesliApp/administration/stores/user"
|
43
|
+
|
44
|
+
|
45
|
+
// · import vue router composable
|
46
|
+
import { useRouter, useRoute } from "vue-router"
|
47
|
+
|
48
|
+
|
49
|
+
// · implement stores
|
50
|
+
const storeUser = useUser()
|
51
|
+
|
52
|
+
|
53
|
+
// · initialize/inject plugins
|
54
|
+
const router = useRouter()
|
55
|
+
const route = useRoute()
|
56
|
+
const url = inject("url")
|
57
|
+
|
58
|
+
|
59
|
+
// ·
|
60
|
+
const translations = {
|
61
|
+
users: I18n.t("core.users"),
|
62
|
+
shared: I18n.t("core.shared")
|
63
|
+
}
|
64
|
+
|
65
|
+
</script>
|
66
|
+
<template>
|
67
|
+
<form class="information" @submit.prevent="storeUser.putUser()">
|
68
|
+
<div class="field is-horizontal">
|
69
|
+
<div class="field-label">
|
70
|
+
<label class="label"> {{ translations.shared.view_text_salutation}} </label>
|
71
|
+
</div>
|
72
|
+
<div class="field-body">
|
73
|
+
<div class="field is-narrow">
|
74
|
+
<div class="control">
|
75
|
+
<label :for="salutation.value" class="radio" v-for="salutation in storeUser.options.salutations" :key="salutation">
|
76
|
+
<input name="user_salutation" type="radio" :id="salutation.value" :value="salutation.value" v-model="storeUser.user.detail_attributes.salutation" />
|
77
|
+
{{salutation.text}}
|
78
|
+
</label>
|
79
|
+
</div>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
</div>
|
83
|
+
|
84
|
+
<div class="field is-horizontal">
|
85
|
+
<div class="field-label is-normal">
|
86
|
+
<label class="label">
|
87
|
+
{{translations.shared.view_text_email}}
|
88
|
+
<span class="is-danger">*</span>
|
89
|
+
</label>
|
90
|
+
</div>
|
91
|
+
<div class="field-body">
|
92
|
+
<div class="field">
|
93
|
+
<div class="control">
|
94
|
+
<input name="user_email" v-model="storeUser.user.email" required="required" type="email" class="input">
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
<div class="field is-horizontal">
|
101
|
+
<div class="field-label is-normal">
|
102
|
+
<label class="label">
|
103
|
+
{{ translations.shared.view_text_first_name }}
|
104
|
+
</label>
|
105
|
+
</div>
|
106
|
+
<div class="field-body">
|
107
|
+
<div class="field">
|
108
|
+
<div class="control">
|
109
|
+
<input name="first_name" v-model="storeUser.user.first_name" type="text" class="input">
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div class="field is-horizontal">
|
116
|
+
<div class="field-label is-normal">
|
117
|
+
<label class="label"> {{ translations.shared.view_text_last_name }} </label>
|
118
|
+
</div>
|
119
|
+
<div class="field-body">
|
120
|
+
<div class="field">
|
121
|
+
<div class="control">
|
122
|
+
<input name="last_name" v-model="storeUser.user.last_name" class="input">
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="field is-horizontal">
|
129
|
+
<div class="field-label is-normal">
|
130
|
+
<label class="label"> {{ translations.shared.view_text_alias }} </label>
|
131
|
+
</div>
|
132
|
+
<div class="field-body">
|
133
|
+
<div class="field">
|
134
|
+
<div class="control">
|
135
|
+
<input name="user_alias" v-model="storeUser.user.alias" class="input">
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="field is-horizontal">
|
142
|
+
<div class="field-label is-normal">
|
143
|
+
<label class="label"> {{ translations.shared.view_text_telephone }} </label>
|
144
|
+
</div>
|
145
|
+
<div class="field-body">
|
146
|
+
<div class="field">
|
147
|
+
<div class="control">
|
148
|
+
<input name="user_number" v-model="storeUser.user.telephone" class="input">
|
149
|
+
</div>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<div class="field is-horizontal">
|
155
|
+
<div class="field-label is-normal">
|
156
|
+
<label class="label"> {{ translations.users.view_text_title }} </label>
|
157
|
+
</div>
|
158
|
+
<div class="field-body">
|
159
|
+
<div class="field">
|
160
|
+
<div class="control">
|
161
|
+
<input name="user_title" v-model="storeUser.user.detail_attributes.title" class="input">
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
</div>
|
165
|
+
</div>
|
166
|
+
<div class="field is-horizontal">
|
167
|
+
<div class="field-label is-normal">
|
168
|
+
</div>
|
169
|
+
<div class="field-body">
|
170
|
+
<div class="field">
|
171
|
+
<div class="control">
|
172
|
+
<lesli-button icon="save">
|
173
|
+
{{ translations.shared.view_btn_save }}
|
174
|
+
</lesli-button>
|
175
|
+
</div>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
</form>
|
180
|
+
</template>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<script setup>
|
2
|
+
/*
|
3
|
+
|
4
|
+
Lesli
|
5
|
+
|
6
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
7
|
+
|
8
|
+
This program is free software: you can redistribute it and/or modify
|
9
|
+
it under the terms of the GNU General Public License as published by
|
10
|
+
the Free Software Foundation, either version 3 of the License, or
|
11
|
+
(at your option) any later version.
|
12
|
+
|
13
|
+
This program is distributed in the hope that it will be useful,
|
14
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
15
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
16
|
+
GNU General Public License for more details.
|
17
|
+
|
18
|
+
You should have received a copy of the GNU General Public License
|
19
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
20
|
+
|
21
|
+
Lesli · Your Smart Business Assistant.
|
22
|
+
|
23
|
+
Made with ♥ by https://www.lesli.tech
|
24
|
+
Building a better future, one line of code at a time.
|
25
|
+
|
26
|
+
@contact hello@lesli.tech
|
27
|
+
@website https://lesli.tech
|
28
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
29
|
+
|
30
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
31
|
+
// ·
|
32
|
+
|
33
|
+
*/
|
34
|
+
|
35
|
+
|
36
|
+
import { useProfile } from "Lesli/shared/stores/profile"
|
37
|
+
|
38
|
+
const storeProfile = useProfile()
|
39
|
+
|
40
|
+
const translations = {
|
41
|
+
core: {
|
42
|
+
roles: I18n.t("core.roles"),
|
43
|
+
users: I18n.t("core.users"),
|
44
|
+
shared: I18n.t("core.shared")
|
45
|
+
}
|
46
|
+
}
|
47
|
+
</script>
|
48
|
+
<template>
|
49
|
+
<section class="application-component">
|
50
|
+
<div class="field is-horizontal">
|
51
|
+
<div class="field-label is-normal">
|
52
|
+
<label class="label">Google account</label>
|
53
|
+
</div>
|
54
|
+
<div class="field-body">
|
55
|
+
<lesli-button icon="google">
|
56
|
+
<a href="/auth/google_oauth2">Connect</a>
|
57
|
+
</lesli-button>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</section>
|
61
|
+
</template>
|