lesli_bell 0.1.0 → 0.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/assets/images/lesli_bell/bell-logo.svg +1 -0
- data/app/assets/javascripts/lesli_bell/application.js +2629 -1127
- data/app/assets/javascripts/lesli_bell/application.js.LICENSE.txt +250 -0
- data/app/assets/stylesheets/lesli_bell/application.css +4 -15
- data/app/controllers/lesli_bell/notifications_controller.rb +6 -2
- data/app/services/lesli_bell/notification_service.rb +17 -17
- data/app/views/lesli_bell/notifications/index.html.erb +2 -2
- data/app/views/lesli_bell/notifications/new.html.erb +30 -6
- data/app/views/lesli_bell/partials/_engine-navigation.html.erb +2 -2
- data/config/locales/translations.en.yml +27 -0
- data/config/locales/translations.es.yml +27 -0
- data/config/locales/translations.fr.yml +27 -0
- data/config/locales/translations.it.yml +27 -0
- data/config/locales/translations.pt.yml +27 -0
- data/config/routes.rb +33 -1
- data/db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb +25 -11
- data/db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb +24 -11
- data/db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb +25 -11
- data/db/seed/development.rb +34 -11
- data/db/seeds.rb +32 -12
- data/lib/lesli_bell/version.rb +2 -2
- data/lib/scss/application.scss +0 -0
- data/lib/vue/application.js +41 -19
- data/lib/vue/apps/notifications/components/notification-form.vue +45 -23
- data/lib/vue/apps/notifications/index.vue +54 -35
- data/lib/vue/apps/notifications/new.vue +32 -21
- data/lib/vue/stores/notification.js +56 -23
- data/lib/vue/stores/translations.json +192 -0
- data/license +674 -0
- data/readme.md +61 -18
- metadata +44 -7
- data/db/migrate/v1.0/0308100210_create_lesli_bell_notification_activities.rb +0 -17
@@ -1,20 +1,33 @@
|
|
1
1
|
=begin
|
2
2
|
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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/.
|
17
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
|
+
// ·
|
18
31
|
=end
|
19
32
|
|
20
33
|
class CreateLesliBellNotifications < ActiveRecord::Migration[7.0]
|
@@ -31,8 +44,8 @@ class CreateLesliBellNotifications < ActiveRecord::Migration[7.0]
|
|
31
44
|
t.string :media
|
32
45
|
t.json :payload
|
33
46
|
|
34
|
-
t.timestamps
|
35
47
|
t.datetime :deleted_at, index: true
|
48
|
+
t.timestamps
|
36
49
|
end
|
37
50
|
|
38
51
|
add_reference(:lesli_bell_notifications, :user, foreign_key: { to_table: :lesli_users })
|
@@ -1,27 +1,40 @@
|
|
1
1
|
=begin
|
2
2
|
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
17
28
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
18
31
|
=end
|
19
32
|
|
20
33
|
class CreateLesliBellAnnouncements < ActiveRecord::Migration[6.0]
|
21
34
|
def change
|
22
35
|
create_table :lesli_bell_announcements do |t|
|
23
|
-
t.string :url, index: true
|
24
36
|
t.string :name
|
37
|
+
t.string :url, index: true
|
25
38
|
t.string :category
|
26
39
|
t.string :base_path
|
27
40
|
t.text :message
|
@@ -29,6 +42,7 @@ class CreateLesliBellAnnouncements < ActiveRecord::Migration[6.0]
|
|
29
42
|
t.datetime :start_at
|
30
43
|
t.datetime :end_at
|
31
44
|
t.boolean :can_be_closed, :default => true
|
45
|
+
|
32
46
|
t.datetime :deleted_at, index: true
|
33
47
|
t.timestamps
|
34
48
|
end
|
data/db/seed/development.rb
CHANGED
@@ -1,23 +1,46 @@
|
|
1
1
|
=begin
|
2
2
|
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
16
30
|
// ·
|
17
31
|
=end
|
18
32
|
|
19
|
-
|
20
|
-
|
33
|
+
|
34
|
+
# ·
|
35
|
+
::Lesli::User.all.each do |current_user|
|
36
|
+
next if current_user.notifications.length > 0
|
37
|
+
LesliBell::NotificationService.new(current_user).create("New standard notification")
|
38
|
+
LesliBell::NotificationService.new(current_user).create("New info notification created", category: "info")
|
39
|
+
LesliBell::NotificationService.new(current_user).create("New success notification created", category: "success")
|
40
|
+
LesliBell::NotificationService.new(current_user).create("New warning notification created", category: "warning")
|
41
|
+
LesliBell::NotificationService.new(current_user).create("New danger notification created", category: "danger")
|
42
|
+
end
|
43
|
+
|
21
44
|
# Courier::Bell::Notification.new(current_user, "New notification created")
|
22
45
|
# Courier::Bell::Notification.new(current_user, "New info notification created", category: "info")
|
23
46
|
# Courier::Bell::Notification.new(current_user, "New success notification created", category: "success")
|
data/db/seeds.rb
CHANGED
@@ -1,25 +1,45 @@
|
|
1
1
|
=begin
|
2
2
|
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
16
30
|
// ·
|
17
31
|
=end
|
18
32
|
|
19
33
|
|
20
|
-
# IMPORTANT:
|
21
|
-
#
|
34
|
+
# IMPORTANT:
|
35
|
+
# Seed files are only for development, if you need to create default resources for production
|
36
|
+
# you must use the initializer method in the Engine account model
|
22
37
|
if Rails.env.development?
|
23
|
-
L2.msg(
|
38
|
+
L2.msg(
|
39
|
+
"LesliSupport",
|
40
|
+
"Version: #{LesliBell::VERSION}",
|
41
|
+
"Build: #{LesliBell::BUILD}")
|
42
|
+
|
43
|
+
# · load specific environment seeds
|
24
44
|
load LesliBell::Engine.root.join("db", "seed", "#{ Rails.env.downcase }.rb")
|
25
45
|
end
|
data/lib/lesli_bell/version.rb
CHANGED
File without changes
|
data/lib/vue/application.js
CHANGED
@@ -1,47 +1,69 @@
|
|
1
1
|
/*
|
2
2
|
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
17
28
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
30
|
+
// ·
|
18
31
|
*/
|
19
32
|
|
20
33
|
|
21
|
-
// · Import
|
22
|
-
import application from "Lesli/application"
|
34
|
+
// · Import Lesli builders
|
35
|
+
import application from "Lesli/vue/application"
|
36
|
+
import translation from "Lesli/vue/translation"
|
37
|
+
|
38
|
+
|
39
|
+
// · Import engine translations
|
40
|
+
import translations from "LesliBell/vue/stores/translations.json"
|
23
41
|
|
24
42
|
|
25
43
|
// · Import apps and components
|
26
44
|
// import appDashboard from "Lesli/cloud-objects/dashboards/apps/show.vue"
|
27
45
|
|
28
|
-
|
29
|
-
|
46
|
+
import appNotificationsIndex from "./apps/notifications/index.vue"
|
47
|
+
import appNotificationsNew from "./apps/notifications/new.vue"
|
30
48
|
|
31
49
|
// import appAnnouncementsIndex from "./apps/announcements/index.vue"
|
32
50
|
// import appAnnouncementsNew from "./apps/announcements/new.vue"
|
33
51
|
|
34
52
|
|
35
|
-
// ·
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
53
|
+
// · Buil Lesli translations
|
54
|
+
translation(translations)
|
55
|
+
|
56
|
+
|
57
|
+
// · Build a new Lesli application
|
58
|
+
application("LesliBell", [{
|
40
59
|
path: "/notifications",
|
41
60
|
component: appNotificationsIndex
|
42
61
|
}, {
|
43
62
|
path: "/notifications/new",
|
44
63
|
component: appNotificationsNew
|
64
|
+
}/*{
|
65
|
+
path: "/",
|
66
|
+
component: appDashboard
|
45
67
|
}, {
|
46
68
|
path: "/announcements",
|
47
69
|
component: appAnnouncementsIndex
|
@@ -1,66 +1,88 @@
|
|
1
1
|
<script setup>
|
2
2
|
/*
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
+
// ·
|
17
31
|
*/
|
18
32
|
|
33
|
+
|
19
34
|
// · import vue tools
|
20
35
|
import { onMounted, inject } from "vue"
|
21
36
|
|
37
|
+
|
22
38
|
// · import store
|
23
|
-
import { useBellNotification } from "LesliBell/stores/notification"
|
39
|
+
import { useBellNotification } from "LesliBell/vue/stores/notification"
|
40
|
+
|
24
41
|
|
25
42
|
// · import vue router composable
|
26
43
|
import { useRouter, useRoute } from "vue-router"
|
27
44
|
|
45
|
+
|
28
46
|
// · implement store
|
29
47
|
const notificationStore = useBellNotification()
|
30
48
|
|
49
|
+
|
31
50
|
// . Defining translations
|
32
51
|
const translations = {
|
33
|
-
|
34
|
-
shared:
|
52
|
+
lesli: {
|
53
|
+
shared: i18n.t("lesli.shared")
|
35
54
|
},
|
36
55
|
bell: {
|
37
|
-
notifications:
|
56
|
+
notifications: i18n.t("lesli_bell.notifications")
|
57
|
+
},
|
58
|
+
|
59
|
+
core: {
|
60
|
+
shared: I18n.t("core.shared")
|
38
61
|
}
|
39
62
|
}
|
40
63
|
|
64
|
+
|
41
65
|
// · initialize/inject plugins
|
42
66
|
const router = useRouter()
|
43
67
|
|
68
|
+
|
44
69
|
// · initializing
|
45
70
|
onMounted(() => {
|
46
71
|
notificationStore.getUsers()
|
47
72
|
notificationStore.getRoles()
|
48
73
|
})
|
49
74
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
const onCreate = () => {
|
75
|
+
|
76
|
+
// ·
|
77
|
+
function onCreate() {
|
54
78
|
notificationStore.createNotification().then(() => {
|
55
79
|
router.push(notificationStore.url.bell('notifications').toString())
|
56
80
|
})
|
57
81
|
}
|
58
82
|
|
59
83
|
</script>
|
60
|
-
|
61
84
|
<template>
|
62
|
-
<lesli-
|
63
|
-
<form @submit.prevent="onCreate" class="card py-4" v-else>
|
85
|
+
<lesli-form @submit="onCreate">
|
64
86
|
<div class="columns is-marginless has-border-bottom">
|
65
87
|
<div class="column is-4">
|
66
88
|
<label class="label">
|
@@ -142,8 +164,8 @@ const onCreate = () => {
|
|
142
164
|
type="submit"
|
143
165
|
class="button is-fullwidth has-text-centered submit-button is-primary"
|
144
166
|
>
|
145
|
-
{{ translations.
|
167
|
+
{{ translations.lesli.shared.button_save }}
|
146
168
|
</button>
|
147
169
|
</div>
|
148
|
-
</form>
|
170
|
+
</lesli-form>
|
149
171
|
</template>
|
@@ -1,25 +1,44 @@
|
|
1
1
|
<script setup>
|
2
2
|
/*
|
3
|
-
|
3
|
+
Lesli
|
4
4
|
|
5
|
-
|
6
|
-
industrial property, intellectual property, copyright and relative international laws.
|
7
|
-
All intellectual or industrial property rights of the code, texts, trade mark, design,
|
8
|
-
pictures and any other information belongs to the owner of this platform.
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
9
6
|
|
10
|
-
|
11
|
-
|
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.
|
12
11
|
|
13
|
-
|
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.
|
14
16
|
|
15
|
-
|
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
|
+
// ·
|
17
31
|
*/
|
18
32
|
|
19
33
|
|
20
34
|
// · import vue tools
|
21
35
|
import { ref, reactive, onMounted, watch, computed, inject } from "vue"
|
22
|
-
import { useRouter, useRoute } from
|
36
|
+
import { useRouter, useRoute } from "vue-router"
|
37
|
+
|
38
|
+
import dayjs from "dayjs"
|
39
|
+
import relativeTime from 'dayjs/plugin/relativeTime'
|
40
|
+
|
41
|
+
dayjs.extend(relativeTime)
|
23
42
|
|
24
43
|
|
25
44
|
// · initialize/inject plugins
|
@@ -30,7 +49,7 @@ const date = inject("date")
|
|
30
49
|
|
31
50
|
|
32
51
|
// · import lesli stores
|
33
|
-
import { useBellNotification } from "LesliBell/stores/notification"
|
52
|
+
import { useBellNotification } from "LesliBell/vue/stores/notification"
|
34
53
|
|
35
54
|
|
36
55
|
// · implement stores
|
@@ -39,11 +58,13 @@ const storeNotification = useBellNotification()
|
|
39
58
|
|
40
59
|
// ·
|
41
60
|
const translations = {
|
61
|
+
shared: i18n.t("lesli.shared"),
|
62
|
+
bell: {
|
63
|
+
notifications: i18n.t("lesli_bell.notifications")
|
64
|
+
},
|
65
|
+
|
42
66
|
core: {
|
43
67
|
shared: I18n.t("core.shared")
|
44
|
-
},
|
45
|
-
bell: {
|
46
|
-
notifications: I18n.t("bell.notifications")
|
47
68
|
}
|
48
69
|
}
|
49
70
|
|
@@ -65,25 +86,35 @@ const columns = [{
|
|
65
86
|
label: "Sent at"
|
66
87
|
}]
|
67
88
|
|
89
|
+
|
68
90
|
// · initializing
|
69
91
|
onMounted(() => {
|
70
92
|
storeNotification.fetch()
|
93
|
+
// console.log(dayjs("2024-04-14 16:27:55.636").fromNow())
|
94
|
+
// console.log(date.date("2024-04-14 16:27:55.636"))
|
95
|
+
// console.log(date.time("2024-04-14 16:27:55.636"))
|
71
96
|
})
|
72
97
|
|
98
|
+
|
73
99
|
</script>
|
74
100
|
<template>
|
75
|
-
<
|
101
|
+
<lesli-application-container>
|
76
102
|
|
77
|
-
<lesli-header :title="translations.bell.notifications.
|
78
|
-
<lesli-button
|
79
|
-
{{ translations.
|
103
|
+
<lesli-header :title="translations.bell.notifications.view_title">
|
104
|
+
<lesli-button icon="refresh">
|
105
|
+
{{ translations.shared.button_reload }}
|
80
106
|
</lesli-button>
|
107
|
+
<!--
|
108
|
+
<lesli-link button solid icon="add" :to="url.bell('notifications/new')">
|
109
|
+
{{ translations.shared.button_add_new }}
|
110
|
+
</lesli-link>
|
111
|
+
-->
|
81
112
|
</lesli-header>
|
82
113
|
|
83
114
|
<lesli-table
|
84
115
|
:columns="columns"
|
85
|
-
:records="storeNotification.records"
|
86
|
-
:pagination="storeNotification.pagination"
|
116
|
+
:records="storeNotification.index.records"
|
117
|
+
:pagination="storeNotification.index.pagination"
|
87
118
|
@paginate="storeNotification.paginate">
|
88
119
|
<template #id="{ value, record }">
|
89
120
|
<span :class="['tag', 'is-medium', 'is-' + record.category]">
|
@@ -106,24 +137,12 @@ onMounted(() => {
|
|
106
137
|
</span>
|
107
138
|
</span>
|
108
139
|
<span>
|
109
|
-
{{ date.
|
110
|
-
</span>
|
111
|
-
</span>
|
112
|
-
</p>
|
113
|
-
<p>
|
114
|
-
<span class="icon-text">
|
115
|
-
<span class="icon">
|
116
|
-
<span class="has-text-grey material-icons">
|
117
|
-
schedule
|
118
|
-
</span>
|
119
|
-
</span>
|
120
|
-
<span>
|
121
|
-
{{ date.time(value) }}
|
140
|
+
{{ date.dateTime(value) }}
|
122
141
|
</span>
|
123
142
|
</span>
|
124
143
|
</p>
|
125
144
|
</template>
|
126
145
|
</lesli-table>
|
127
146
|
|
128
|
-
</
|
147
|
+
</lesli-application-container>
|
129
148
|
</template>
|