lesli_bell 0.1.0 → 1.0.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 +1 -2835
- 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/announcements_controller.rb +16 -1
- data/app/controllers/lesli_bell/dashboards_controller.rb +26 -49
- data/app/controllers/lesli_bell/notifications_controller.rb +7 -8
- data/app/models/lesli_bell/announcement/user.rb +6 -0
- data/app/models/lesli_bell/announcement.rb +12 -2
- data/app/models/lesli_bell/dashboard.rb +38 -2
- data/app/models/lesli_bell/notification.rb +15 -16
- data/app/services/lesli_bell/announcement_service.rb +84 -0
- data/app/services/lesli_bell/notification_service.rb +46 -51
- data/app/views/lesli_bell/announcements/index.html.erb +30 -11
- data/app/views/lesli_bell/dashboards/edit.html.erb +30 -7
- data/app/views/lesli_bell/dashboards/show.html.erb +33 -1
- data/app/views/lesli_bell/notifications/index.html.erb +67 -3
- data/app/views/lesli_bell/notifications/new.html.erb +30 -6
- data/app/views/lesli_bell/partials/{_engine-navigation.html.erb → _navigation.html.erb} +2 -2
- data/config/locales/translations.en.yml +2 -0
- data/config/locales/translations.es.yml +2 -0
- data/config/locales/translations.fr.yml +2 -0
- data/config/locales/translations.it.yml +2 -0
- data/config/locales/translations.pt.yml +2 -0
- data/config/routes.rb +34 -3
- data/db/migrate/v1.0/0308000110_create_lesli_bell_accounts.rb +24 -15
- data/db/migrate/v1.0/0308003010_create_lesli_bell_dashboards.rb +37 -0
- data/db/migrate/v1.0/0308100110_create_lesli_bell_notifications.rb +24 -13
- data/db/migrate/v1.0/0308110110_create_lesli_bell_announcements.rb +26 -12
- data/db/migrate/v1.0/0308110310_create_lesli_bell_announcement_users.rb +6 -7
- data/db/seed/announcements.rb +47 -0
- data/db/seed/notifications.rb +53 -0
- data/db/seed/seeds.json +36 -0
- data/db/seeds.rb +30 -15
- data/lib/lesli_bell/version.rb +2 -2
- data/lib/vue/application.js +42 -20
- data/lib/vue/apps/announcements/index.vue +49 -28
- data/lib/vue/apps/notifications/components/notification-form.vue +45 -23
- data/lib/vue/apps/notifications/index.vue +55 -40
- data/lib/vue/apps/notifications/new.vue +32 -21
- data/lib/vue/stores/announcement.js +36 -31
- data/lib/vue/stores/notification.js +56 -23
- data/lib/vue/stores/translations.json +232 -0
- data/license +674 -0
- data/readme.md +75 -18
- metadata +38 -18
- data/app/views/lesli_bell/announcements/_announcement.html.erb +0 -2
- data/app/views/lesli_bell/announcements/_form.html.erb +0 -17
- data/app/views/lesli_bell/dashboards/_dashboard.html.erb +0 -2
- data/app/views/lesli_bell/dashboards/_form.html.erb +0 -17
- data/app/views/lesli_bell/dashboards/index.html.erb +0 -14
- data/app/views/lesli_bell/dashboards/new.html.erb +0 -9
- data/db/migrate/v1.0/0308100210_create_lesli_bell_notification_activities.rb +0 -17
- data/db/seed/development.rb +0 -36
- data/db/seed/test.rb +0 -0
- /data/{db/seed/production.rb → lib/scss/application.scss} +0 -0
@@ -1,12 +1,11 @@
|
|
1
1
|
class CreateLesliBellAnnouncementUsers < ActiveRecord::Migration[7.0]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
# end
|
3
|
+
create_table :lesli_bell_announcement_users do |t|
|
4
|
+
t.timestamps
|
5
|
+
t.datetime :deleted_at, index: true
|
6
|
+
end
|
8
7
|
|
9
|
-
|
10
|
-
|
8
|
+
add_reference(:lesli_bell_announcement_users, :user, foreign_key: { to_table: :lesli_users })
|
9
|
+
add_reference :lesli_bell_announcement_users, :announcement, foreign_key: { to_table: :lesli_bell_announcements }, index: { name: "lesli_bell_announcements_users" }
|
11
10
|
end
|
12
11
|
end
|
@@ -0,0 +1,47 @@
|
|
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 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
|
+
|
34
|
+
file = File.open(LesliBell::Engine.root.join("db", "seed", "seeds.json")).read
|
35
|
+
seeds = JSON.parse(file)
|
36
|
+
|
37
|
+
current_user = Lesli::User.first
|
38
|
+
|
39
|
+
# ·
|
40
|
+
seeds["announcements"].each do |notification|
|
41
|
+
LesliBell::AnnouncementService.new(current_user).create({
|
42
|
+
name: notification["name"],
|
43
|
+
category: notification["category"],
|
44
|
+
message: notification["message"],
|
45
|
+
url: notification["url"]
|
46
|
+
}, send_to_user_ids: ::Lesli::User.all.pluck(:id))
|
47
|
+
end
|
@@ -0,0 +1,53 @@
|
|
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 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
|
+
|
34
|
+
file = File.open(LesliBell::Engine.root.join("db", "seed", "seeds.json")).read
|
35
|
+
seeds = JSON.parse(file)
|
36
|
+
|
37
|
+
# ·
|
38
|
+
current_user = Lesli::User.first
|
39
|
+
|
40
|
+
# ·
|
41
|
+
LesliBell::NotificationService.new(current_user).create_for_me({
|
42
|
+
subject: "Special notification created for me"
|
43
|
+
})
|
44
|
+
|
45
|
+
# ·
|
46
|
+
seeds["notifications"].each do |notification|
|
47
|
+
LesliBell::NotificationService.new(current_user).create({
|
48
|
+
subject: notification["message"],
|
49
|
+
category: notification["category"],
|
50
|
+
body: notification["body"],
|
51
|
+
url: notification["url"]
|
52
|
+
}, send_to_user_ids: ::Lesli::User.all.pluck(:id))
|
53
|
+
end
|
data/db/seed/seeds.json
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"notifications": [
|
3
|
+
{ "message": "Welcome to our platform!", "category": "standard" },
|
4
|
+
{ "message": "Welcome to our platform!", "category": "standard", "url": "https://example.com/welcome" },
|
5
|
+
{ "message": "Welcome to our platform!", "category": "standard", "body": "We're excited to have you onboard." },
|
6
|
+
{ "message": "Welcome to our platform!", "category": "standard", "body": "We're excited to have you onboard.", "url": "https://example.com/welcome" },
|
7
|
+
|
8
|
+
{ "message": "System maintenance scheduled", "category": "info" },
|
9
|
+
{ "message": "System maintenance scheduled", "category": "info", "url": "https://example.com/maintenance-info" },
|
10
|
+
{ "message": "System maintenance scheduled", "category": "info", "body": "The system will be down for maintenance on Sunday at 2 AM." },
|
11
|
+
{ "message": "System maintenance scheduled", "category": "info", "body": "The system will be down for maintenance on Sunday at 2 AM.", "url": "https://example.com/maintenance-info" },
|
12
|
+
|
13
|
+
{ "message": "Your profile has been updated", "category": "success" },
|
14
|
+
{ "message": "Your profile has been updated", "category": "success", "url": "https://example.com/profile" },
|
15
|
+
{ "message": "Your profile has been updated", "category": "success", "body": "Your changes have been saved successfully." },
|
16
|
+
{ "message": "Your profile has been updated", "category": "success", "body": "Your changes have been saved successfully.", "url": "https://example.com/profile" },
|
17
|
+
|
18
|
+
{ "message": "Password expiring soon", "category": "warning" },
|
19
|
+
{ "message": "Password expiring soon", "category": "warning", "url": "https://example.com/update-password" },
|
20
|
+
{ "message": "Password expiring soon", "category": "warning", "body": "Your password will expire in 3 days. Please update it to avoid being locked out." },
|
21
|
+
{ "message": "Password expiring soon", "category": "warning", "body": "Your password will expire in 3 days. Please update it to avoid being locked out.", "url": "https://example.com/update-password" },
|
22
|
+
|
23
|
+
|
24
|
+
{ "message": "Unusual login attempt detected", "category": "danger" },
|
25
|
+
{ "message": "Unusual login attempt detected", "category": "danger", "url": "https://example.com/security-alert" },
|
26
|
+
{ "message": "Unusual login attempt detected", "category": "danger", "body": "We noticed a login attempt from an unfamiliar location. Please review your account security." },
|
27
|
+
{ "message": "Unusual login attempt detected", "category": "danger", "body": "We noticed a login attempt from an unfamiliar location. Please review your account security.", "url": "https://example.com/security-alert" }
|
28
|
+
],
|
29
|
+
"announcements": [
|
30
|
+
{ "name": "standard", "message": "Exciting News: Welcome to our platform!", "category": "standard" },
|
31
|
+
{ "name": "information", "message": "Upcoming Event: System Maintenance Scheduled", "category": "info", "url": "https://example.com/maintenance-info" },
|
32
|
+
{ "name": "success", "message": "Success Update: Your Profile Has Been Updated!", "category": "success" },
|
33
|
+
{ "name": "warning", "message": "Friendly Reminder: Password Expiring Soon", "category": "warning", "url": "https://example.com/update-password" },
|
34
|
+
{ "name": "danger", "message": "Alert: Unusual Login Attempt Detected", "category": "danger" }
|
35
|
+
]
|
36
|
+
}
|
data/db/seeds.rb
CHANGED
@@ -1,25 +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
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
load LesliBell::Engine.root.join("db", "seed", "
|
25
|
-
|
34
|
+
L2.msg("LesliBell", "Version: #{LesliBell::VERSION}", "Build: #{LesliBell::BUILD}")
|
35
|
+
|
36
|
+
# · load specific environment seeds
|
37
|
+
if Rails.env.development? || Lesli.config.demo
|
38
|
+
load LesliBell::Engine.root.join("db", "seed", "notifications.rb")
|
39
|
+
load LesliBell::Engine.root.join("db", "seed", "announcements.rb")
|
40
|
+
end
|
data/lib/lesli_bell/version.rb
CHANGED
data/lib/vue/application.js
CHANGED
@@ -1,42 +1,61 @@
|
|
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 "LesliBell/vue/apps/notifications/index.vue"
|
47
|
+
import appNotificationsNew from "LesliBell/vue/apps/notifications/new.vue"
|
30
48
|
|
31
|
-
|
49
|
+
import appAnnouncementsIndex from "LesliBell/vue/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
|
}, {
|
@@ -45,6 +64,9 @@ application("LesliBell", [/*{
|
|
45
64
|
}, {
|
46
65
|
path: "/announcements",
|
47
66
|
component: appAnnouncementsIndex
|
67
|
+
}/*{
|
68
|
+
path: "/",
|
69
|
+
component: appDashboard
|
48
70
|
}, {
|
49
71
|
path: "/announcements/new",
|
50
72
|
component: appAnnouncementsNew
|
@@ -1,19 +1,33 @@
|
|
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
|
|
@@ -21,8 +35,10 @@ For more information read the license file including with this software.
|
|
21
35
|
import { ref, reactive, onMounted, watch, computed, inject } from "vue"
|
22
36
|
import { useRouter, useRoute } from 'vue-router'
|
23
37
|
|
38
|
+
|
24
39
|
// · import lesli stores
|
25
|
-
import { useBellAnnouncement } from "LesliBell/stores/announcement"
|
40
|
+
import { useBellAnnouncement } from "LesliBell/vue/stores/announcement"
|
41
|
+
|
26
42
|
|
27
43
|
// · initialize/inject plugins
|
28
44
|
const router = useRouter()
|
@@ -37,26 +53,34 @@ const storeAnnouncement = useBellAnnouncement()
|
|
37
53
|
|
38
54
|
// ·
|
39
55
|
const translations = {
|
56
|
+
lesli: i18n.t("lesli.shared"),
|
57
|
+
announcements: i18n.t("lesli_bell.announcements"),
|
58
|
+
|
59
|
+
|
40
60
|
core: {
|
41
61
|
shared: I18n.t("core.shared")
|
42
62
|
},
|
43
63
|
bell: {
|
44
|
-
announcements: I18n.t("
|
64
|
+
announcements: I18n.t("lesli_bell.announcements")
|
45
65
|
}
|
46
66
|
}
|
47
67
|
|
68
|
+
// ·
|
48
69
|
const columns = [{
|
49
70
|
field: "id",
|
50
|
-
label: translations.
|
71
|
+
label: translations.announcements.column_id
|
51
72
|
}, {
|
52
73
|
field: "name",
|
53
|
-
label: translations.
|
74
|
+
label: translations.announcements.column_name
|
75
|
+
}, {
|
76
|
+
field: "category",
|
77
|
+
label: translations.announcements.column_category
|
54
78
|
}, {
|
55
79
|
field: "start_at",
|
56
|
-
label: translations.
|
80
|
+
label: translations.announcements.column_start_at
|
57
81
|
}, {
|
58
82
|
field: "end_at",
|
59
|
-
label: translations.
|
83
|
+
label: translations.announcements.column_end_at
|
60
84
|
}]
|
61
85
|
|
62
86
|
// · initializing
|
@@ -66,8 +90,8 @@ onMounted(() => {
|
|
66
90
|
|
67
91
|
</script>
|
68
92
|
<template>
|
69
|
-
<
|
70
|
-
<lesli-header :title="translations.
|
93
|
+
<lesli-application-container>
|
94
|
+
<lesli-header :title="translations.announcements.view_title">
|
71
95
|
<lesli-button :to="url.bell('announcements/new')" icon="add">
|
72
96
|
{{ translations.core.shared.view_btn_add }}
|
73
97
|
</lesli-button>
|
@@ -75,20 +99,18 @@ onMounted(() => {
|
|
75
99
|
|
76
100
|
<lesli-table
|
77
101
|
:columns="columns"
|
78
|
-
:records="storeAnnouncement.records"
|
79
|
-
:pagination="storeAnnouncement.pagination"
|
102
|
+
:records="storeAnnouncement.announcements.records"
|
103
|
+
:pagination="storeAnnouncement.announcements.pagination"
|
80
104
|
@paginate="storeAnnouncement.paginate">
|
81
105
|
<template #id="{ value, record }">
|
82
106
|
<span :class="['tag', 'is-medium', 'is-' + record.category]">
|
83
107
|
{{ value }}
|
84
108
|
</span>
|
85
109
|
</template>
|
86
|
-
<template #
|
87
|
-
<
|
88
|
-
|
89
|
-
|
90
|
-
<template #url="{ value }">
|
91
|
-
<a :href="value" class="has-text-link hover">{{ value }}</a>
|
110
|
+
<template #category="{ value }">
|
111
|
+
<p :class="[`has-background-${value}-light`, 'px-2']">
|
112
|
+
{{ value }}
|
113
|
+
</p>
|
92
114
|
</template>
|
93
115
|
<template #start_at="{ value }">
|
94
116
|
<p>
|
@@ -119,6 +141,5 @@ onMounted(() => {
|
|
119
141
|
</p>
|
120
142
|
</template>
|
121
143
|
</lesli-table>
|
122
|
-
|
123
|
-
</section>
|
144
|
+
</lesli-application-container>
|
124
145
|
</template>
|
@@ -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>
|