lesli_calendar 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.
Files changed (82) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +5 -0
  3. data/app/assets/config/lesli_calendar_manifest.js +40 -0
  4. data/app/assets/images/lesli_calendar/calendar-logo.svg +101 -0
  5. data/app/assets/javascripts/lesli_calendar/application.js +4658 -0
  6. data/app/assets/stylesheets/lesli_calendar/application.css +604 -0
  7. data/app/controllers/lesli_calendar/application_controller.rb +4 -0
  8. data/app/controllers/lesli_calendar/calendars_controller.rb +71 -0
  9. data/app/controllers/lesli_calendar/dashboards_controller.rb +60 -0
  10. data/app/controllers/lesli_calendar/events_controller.rb +60 -0
  11. data/app/helpers/lesli_calendar/application_helper.rb +4 -0
  12. data/app/helpers/lesli_calendar/calendars_helper.rb +4 -0
  13. data/app/helpers/lesli_calendar/dashboards_helper.rb +4 -0
  14. data/app/helpers/lesli_calendar/events_helper.rb +4 -0
  15. data/app/jobs/lesli_calendar/application_job.rb +4 -0
  16. data/app/mailers/lesli_calendar/application_mailer.rb +6 -0
  17. data/app/models/lesli_calendar/account.rb +45 -0
  18. data/app/models/lesli_calendar/application_record.rb +5 -0
  19. data/app/models/lesli_calendar/calendar.rb +5 -0
  20. data/app/models/lesli_calendar/dashboard.rb +4 -0
  21. data/app/models/lesli_calendar/event.rb +4 -0
  22. data/app/services/lesli_calendar/calendar_service.rb +56 -0
  23. data/app/views/lesli_calendar/calendars/_calendar.html.erb +2 -0
  24. data/app/views/lesli_calendar/calendars/_form.html.erb +17 -0
  25. data/app/views/lesli_calendar/calendars/edit.html.erb +10 -0
  26. data/app/views/lesli_calendar/calendars/index.html.erb +14 -0
  27. data/app/views/lesli_calendar/calendars/new.html.erb +9 -0
  28. data/app/views/lesli_calendar/calendars/show.html.erb +1 -0
  29. data/app/views/lesli_calendar/dashboards/_dashboard.html.erb +2 -0
  30. data/app/views/lesli_calendar/dashboards/_form.html.erb +17 -0
  31. data/app/views/lesli_calendar/dashboards/edit.html.erb +10 -0
  32. data/app/views/lesli_calendar/dashboards/index.html.erb +14 -0
  33. data/app/views/lesli_calendar/dashboards/new.html.erb +9 -0
  34. data/app/views/lesli_calendar/dashboards/show.html.erb +1 -0
  35. data/app/views/lesli_calendar/events/_event.html.erb +2 -0
  36. data/app/views/lesli_calendar/events/_form.html.erb +17 -0
  37. data/app/views/lesli_calendar/events/edit.html.erb +10 -0
  38. data/app/views/lesli_calendar/events/index.html.erb +1 -0
  39. data/app/views/lesli_calendar/events/new.html.erb +9 -0
  40. data/app/views/lesli_calendar/events/show.html.erb +10 -0
  41. data/app/views/lesli_calendar/partials/_engine-navigation.html.erb +37 -0
  42. data/config/locales/translations.en.yml +21 -0
  43. data/config/locales/translations.es.yml +21 -0
  44. data/config/locales/translations.fr.yml +21 -0
  45. data/config/locales/translations.it.yml +21 -0
  46. data/config/locales/translations.pt.yml +21 -0
  47. data/config/routes.rb +41 -0
  48. data/db/migrate/v1.0/0301000110_create_lesli_calendar_accounts.rb +40 -0
  49. data/db/migrate/v1.0/0301100110_create_lesli_calendar_calendars.rb +46 -0
  50. data/db/migrate/v1.0/0301110110_create_lesli_calendar_events.rb +57 -0
  51. data/db/seed/development.rb +17 -0
  52. data/db/seed/production.rb +17 -0
  53. data/db/seed/test.rb +17 -0
  54. data/db/seeds.rb +28 -0
  55. data/db/tables/0301010210_create_lesli_driver_catalog_event_types.rb +14 -0
  56. data/db/tables/0301110310_create_lesli_driver_event_actions.rb +16 -0
  57. data/db/tables/0301110410_create_lesli_driver_event_activities.rb +15 -0
  58. data/db/tables/0301110510_create_lesli_driver_event_discussions.rb +17 -0
  59. data/db/tables/0301110610_create_lesli_driver_event_files.rb +16 -0
  60. data/db/tables/0301110710_create_lesli_driver_event_subscribers.rb +16 -0
  61. data/db/tables/0301111010_create_lesli_driver_event_attendants.rb +13 -0
  62. data/lib/lesli_calendar/engine.rb +50 -0
  63. data/lib/lesli_calendar/version.rb +4 -0
  64. data/lib/lesli_calendar.rb +6 -0
  65. data/lib/scss/application.scss +34 -0
  66. data/lib/scss/calendar.scss +181 -0
  67. data/lib/tasks/lesli_calendar_tasks.rake +4 -0
  68. data/lib/vue/application.js +59 -0
  69. data/lib/vue/apps/calendars/show.vue +87 -0
  70. data/lib/vue/apps/events/index.vue +48 -0
  71. data/lib/vue/components/agenda.vue +137 -0
  72. data/lib/vue/components/calendar.vue +137 -0
  73. data/lib/vue/components/event.vue +47 -0
  74. data/lib/vue/components/form.vue +143 -0
  75. data/lib/vue/components/guests.vue +148 -0
  76. data/lib/vue/stores/calendar.js +215 -0
  77. data/lib/vue/stores/events.js +53 -0
  78. data/lib/vue/stores/guests.js +213 -0
  79. data/lib/vue/stores/translations.json +152 -0
  80. data/license +674 -0
  81. data/readme.md +71 -0
  82. metadata +154 -0
@@ -0,0 +1,59 @@
1
+ /*
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
+ */
32
+
33
+
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 "LesliBabel/vue/stores/translations.json"
41
+
42
+
43
+ // · Import apps and components
44
+ import appCalendarShow from "LesliCalendar/vue/apps/calendars/show.vue"
45
+ import appEventsIndex from "LesliCalendar/vue/apps/events/index.vue"
46
+
47
+
48
+ // · Buil Lesli translations
49
+ translation(translations)
50
+
51
+
52
+ // ·
53
+ application("LesliCalendar", [{
54
+ path: "/",
55
+ component: appCalendarShow
56
+ }, {
57
+ path: "/events",
58
+ component: appEventsIndex
59
+ }])
@@ -0,0 +1,87 @@
1
+ <script setup>
2
+ /*
3
+ Copyright (c) 2023, all rights reserved.
4
+
5
+ All the information provided by this platform is protected by international laws related to
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.
9
+
10
+ Without the written permission of the owner, any replication, modification,
11
+ transmission, publication is strictly forbidden.
12
+
13
+ For more information read the license file including with this software.
14
+
15
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ // ·
17
+ */
18
+
19
+
20
+ // · import vue tools
21
+ import { ref, reactive, onMounted, watch, computed, inject } from "vue"
22
+ import { useRouter, useRoute } from "vue-router"
23
+
24
+
25
+ // ·
26
+ import { useCalendar } from "LesliCalendar/vue/stores/calendar.js"
27
+
28
+
29
+ // ·
30
+ const storeCalendar = useCalendar()
31
+ const date = inject("date")
32
+
33
+
34
+ // · Import components
35
+ import componentCalendar from "LesliCalendar/vue/components/calendar.vue"
36
+ import componentAgenda from "LesliCalendar/vue/components/agenda.vue"
37
+ import componentPanelEvent from "LesliCalendar/vue/components/event.vue"
38
+
39
+ onMounted(() => {
40
+ storeCalendar.getCalendar()
41
+ })
42
+
43
+ </script>
44
+ <template>
45
+ <lesli-application-container dashboard>
46
+ <lesli-header :title="date.dateWords()">
47
+ <div class="field has-addons m-0">
48
+ <div class="control">
49
+ <lesli-button icon="arrow_back_ios">
50
+ prev
51
+ </lesli-button>
52
+ </div>
53
+ <div class="control">
54
+ <lesli-button>
55
+ today
56
+ </lesli-button>
57
+ </div>
58
+ <div class="control">
59
+ <button class="button is-primary is-light is-outlined">
60
+ <span>next</span>
61
+ <span class="icon">
62
+ <span class="material-icons">
63
+ arrow_forward_ios
64
+ </span>
65
+ </span>
66
+ </button>
67
+ </div>
68
+ </div>
69
+ <lesli-button solid icon="add">
70
+ Add event
71
+ </lesli-button>
72
+ </lesli-header>
73
+
74
+ <div class="columns">
75
+ <div class="column is-3">
76
+ <component-agenda>
77
+ </component-agenda>
78
+ </div>
79
+ <div class="column">
80
+ <component-calendar class="mt-4">
81
+ </component-calendar>
82
+ </div>
83
+ </div>
84
+
85
+ <component-panel-event></component-panel-event>
86
+ </lesli-application-container>
87
+ </template>
@@ -0,0 +1,48 @@
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 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
+ */
32
+
33
+
34
+ // · import vue tools
35
+ import { ref, reactive, onMounted, watch, computed, inject } from "vue"
36
+ import { useRouter, useRoute } from "vue-router"
37
+
38
+
39
+ // · Import components
40
+
41
+
42
+ </script>
43
+ <template>
44
+ <lesli-application-container>
45
+ <lesli-header title="Events">
46
+ </lesli-header>
47
+ </lesli-application-container>
48
+ </template>
@@ -0,0 +1,137 @@
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 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
+ */
32
+
33
+
34
+ // ·
35
+ import { onMounted, watch, ref, inject } from "vue"
36
+
37
+ import dayjs from "dayjs"
38
+ import isSameOrAfter from "dayjs/plugin/isSameOrAfter"
39
+ dayjs.extend(isSameOrAfter)
40
+
41
+ // ·
42
+
43
+
44
+
45
+ // · import lesli stores
46
+ import { useCalendar } from "LesliCalendar/vue/stores/calendar"
47
+
48
+
49
+ const date = inject("date")
50
+
51
+
52
+ // · implement stores
53
+ const storeCalendar = useCalendar()
54
+
55
+
56
+ // ·
57
+ const agenda = ref([])
58
+ const today = dayjs()
59
+
60
+
61
+ // ·
62
+ function merge() {
63
+
64
+ let events = [
65
+ ...storeCalendar.calendarData.events,
66
+ ...storeCalendar.calendarData.events_support
67
+ ]
68
+
69
+ let count = 0
70
+
71
+ events = events.filter(event => {
72
+
73
+ // limit the number of events to show in the agenda
74
+ if (count >= 6) {
75
+ return
76
+ }
77
+
78
+ let eventDate = dayjs(event.start)
79
+
80
+ // Do not process past events
81
+ if (eventDate.isBefore(today, "day")) {
82
+ return
83
+ }
84
+
85
+ // show today event description by default
86
+ event.dayName = "Today"
87
+ event.dayNumber = eventDate.format("HH:mm")
88
+
89
+ // If the event is NOT today, show only the time
90
+ if (!eventDate.isSame(today, "day")) {
91
+ event.dayName = eventDate.format("ddd")
92
+ event.dayNumber = eventDate.format("DD")
93
+ }
94
+
95
+
96
+ if (event.description) {
97
+ event.description = event.description
98
+ .replace(/<[^>]*>?/gm, '') // remove html tags from string
99
+ .substring(0, 40) + '...' // get a excerpt of the description
100
+ }
101
+
102
+ event.classNames = event.classNames
103
+
104
+ count++
105
+
106
+ return event
107
+
108
+ })
109
+
110
+ events = events.sort((a,b) => a.time > b.time)
111
+
112
+ agenda.value = events
113
+ }
114
+
115
+
116
+ // ·
117
+ watch(() => storeCalendar.calendarData.events_support, () => merge())
118
+
119
+ </script>
120
+ <template>
121
+ <div class="lesli-calendar-agenda">
122
+ <h3>Upcoming events</h3>
123
+ <div
124
+ class="is-flex is-align-items-center event"
125
+ v-for="(event, index) in agenda"
126
+ :key="index">
127
+ <div class="date">
128
+ <p class="day-name">{{ event.dayName }}</p>
129
+ <p class="day-number">{{ event.dayNumber }}</p>
130
+ </div>
131
+ <div :class="['description', event.classNames]">
132
+ <p>{{ event.title }}</p>
133
+ <p>{{ event.description }}</p>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </template>
@@ -0,0 +1,137 @@
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 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
+ */
32
+
33
+
34
+ // · Import components, libraries and tools
35
+ import { onMounted, inject, ref } from "vue"
36
+
37
+ import { Calendar } from "@fullcalendar/core";
38
+ import listPlugin from "@fullcalendar/list";
39
+ import dayGridPlugin from "@fullcalendar/daygrid";
40
+ import timeGridPlugin from "@fullcalendar/timegrid";
41
+ import interactionPlugin from "@fullcalendar/interaction";
42
+
43
+
44
+ // · import lesli stores
45
+ import { useCalendar } from 'LesliCalendar/vue/stores/calendar'
46
+
47
+
48
+ // · implement stores
49
+ const storeCalendar = useCalendar()
50
+
51
+
52
+ // ·
53
+ const date = inject("date")
54
+
55
+
56
+ function onDateClick() {
57
+ // const storeEvent = useEvent()
58
+ // this.reset()
59
+ // storeEvent.showModal = !storeEvent.showModal
60
+ }
61
+
62
+
63
+ function onEventClick(args) {
64
+
65
+ if (args.event?._def?.extendedProps?.engine == "lesli-support") {
66
+ window.open(
67
+ "http://localhost:3000/support/tickets/" + args.event?._def?.extendedProps?.ticket,
68
+ "_blank",
69
+ "noreferrer"
70
+ );
71
+ return
72
+ }
73
+
74
+ // const storeEvent = useEvent()
75
+ // const storeGuests = useGuests()
76
+ // arg.jsEvent.preventDefault()
77
+ // this.event_id = parseInt(arg.event.id)
78
+ // this.http.get(this.url.driver(`events/${this.event_id}`))
79
+ // .then(result => {
80
+ // this.event = result
81
+ // storeEvent.showModal = !storeEvent.showModal
82
+ // storeGuests.getAttendants()
83
+ // storeGuests.getUsers()
84
+ // })
85
+ }
86
+
87
+
88
+ function onEventContent(args) {
89
+
90
+ console.log(args.event._def.extendedProps.engine)
91
+
92
+ let title = document.createElement("span")
93
+ let time = document.createElement("span")
94
+ title.innerHTML = args.event.title
95
+ time.innerHTML = date.time(args.event._def.extendedProps.dateStart)
96
+
97
+ if (args.event._def.extendedProps.dateEnd) {
98
+ time.innerHTML += (" - " + date.time(args.event._def.extendedProps.dateEnd))
99
+ }
100
+
101
+ title.classList.add("event-title")
102
+ time.classList.add("event-time")
103
+ return { domNodes: [title, time] }
104
+
105
+ }
106
+
107
+ // ·
108
+ onMounted(() => {
109
+
110
+ storeCalendar.calendar = new Calendar(document.getElementById("lesli-calendar"), {
111
+ plugins: [
112
+ dayGridPlugin,
113
+ interactionPlugin,
114
+ timeGridPlugin,
115
+ listPlugin
116
+ ],
117
+ firstDay: 1,
118
+ headerToolbar: false,
119
+ initialView: "dayGridMonth",
120
+ showNonCurrentDates: true,
121
+ dayMaxEvents: true, // allow "more" link when too many events
122
+ editable: true,
123
+ events: [],
124
+ eventClick: onEventClick,
125
+ dateClick: onDateClick,
126
+ //eventContent: onEventContent
127
+ });
128
+
129
+ setTimeout(() => { storeCalendar.calendar.render(); }, 200)
130
+
131
+ })
132
+
133
+ </script>
134
+
135
+ <template>
136
+ <div id="lesli-calendar"></div>
137
+ </template>
@@ -0,0 +1,47 @@
1
+ <script setup>
2
+ /*
3
+ Copyright (c) 2023, all rights reserved.
4
+
5
+ All the information provided by this platform is protected by international laws related to
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.
9
+
10
+ Without the written permission of the owner, any replication, modification,
11
+ transmission, publication is strictly forbidden.
12
+
13
+ For more information read the license file including with this software.
14
+
15
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ // ·
17
+ */
18
+
19
+ // · Import components, libraries and tools
20
+ import { onMounted } from 'vue'
21
+
22
+
23
+ // ·
24
+ import { useEvents } from "LesliCalendar/vue/stores/events"
25
+
26
+
27
+ const storeEvents = useEvents()
28
+
29
+
30
+ // import ComponentDiscussions from "LesliVue/cloud-objects/discussion.vue"
31
+ // import ComponentFiles from "LesliVue/cloud-objects/file.vue"
32
+ // import ComponentGuests from './guests.vue'
33
+ import ComponentForm from './form.vue'
34
+
35
+ </script>
36
+
37
+ <template>
38
+
39
+ <lesli-panel v-model:open="storeEvents.showModal">
40
+ <template #header>
41
+ </template>
42
+
43
+ <template #default>
44
+
45
+ </template>
46
+ </lesli-panel>
47
+ </template>
@@ -0,0 +1,143 @@
1
+ <script setup>
2
+ /*
3
+ Copyright (c) 2023, all rights reserved.
4
+
5
+ All the information provided by this platform is protected by international laws related to
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.
9
+
10
+ Without the written permission of the owner, any replication, modification,
11
+ transmission, publication is strictly forbidden.
12
+
13
+ For more information read the license file including with this software.
14
+
15
+ // · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
16
+ // ·
17
+ */
18
+
19
+ // · import lesli stores
20
+ import { useCalendar } from 'LesliCalendar/vue/stores/calendar'
21
+ import { useEvents } from 'LesliCalendar/vue/stores/events'
22
+
23
+ // · implement stores
24
+ const storeCalendar = useCalendar()
25
+ const storeEvent = useEvents()
26
+
27
+ const translations = {
28
+ events: I18n.t('driver.events'),
29
+ core: I18n.t('core.shared'),
30
+ }
31
+
32
+ const submitEvent = () => {
33
+ if (storeCalendar.event.id) {
34
+ storeCalendar.putEvent()
35
+ }
36
+ else {
37
+ storeCalendar.postEvent()
38
+ }
39
+ }
40
+
41
+ </script>
42
+
43
+ <template>
44
+ <form @submit.prevent="submitEvent">
45
+ <fieldset>
46
+ <div class="columns">
47
+ <div class="column">
48
+ <field label="column_user_main_id">
49
+ <p>{{ translations.events.column_user_main_id }}</p>
50
+ <input class="input is-default" type="text" name="organizer_name"
51
+ v-model="storeCalendar.event.organizer_name" readonly />
52
+ </field>
53
+ <field>
54
+ <p>{{ translations.events.column_title }}</p>
55
+ <input class="input is-default" type="text" name="title" v-model="storeCalendar.event.title"
56
+ required />
57
+ </field>
58
+ <field>
59
+ <p>{{ translations.events.column_time_start }}</p>
60
+ <lesli-calendar v-model="storeCalendar.event.time_start" mode="dateTime">
61
+ </lesli-calendar>
62
+ </field>
63
+ <field>
64
+ <p>{{ translations.events.column_budget }}
65
+ ({{ storeCalendar.lesli.settings.currency.symbol }})</p>
66
+ <input class="input is-default" type="number" name="budget" min="0" step="0.01"
67
+ v-model="storeCalendar.event.budget" />
68
+ </field>
69
+ <field>
70
+ <p>{{ translations.events.column_showed_up_count }}</p>
71
+ <input class="input is-default" type="number" name="showed_up_count" min="0" step="1"
72
+ v-model="storeCalendar.event.showed_up_count" />
73
+ </field>
74
+ </div>
75
+ <div class="column">
76
+ <field>
77
+ <p>{{ translations.events.column_cloud_driver_catalog_event_types_id }}</p>
78
+ <lesli-select v-model="storeCalendar.event.cloud_driver_catalog_event_types_id" icon="public"
79
+ :options="storeEvent.options.event_types">
80
+ </lesli-select>
81
+ </field>
82
+ <field>
83
+ <p>{{ translations.events.column_location }}</p>
84
+ <input class="input is-default" type="text" name="address"
85
+ v-model="storeCalendar.event.location" />
86
+ </field>
87
+ <field>
88
+ <p>{{ translations.events.column_time_end }}</p>
89
+ <lesli-calendar v-model="storeCalendar.event.time_end" mode="dateTime">
90
+ </lesli-calendar>
91
+ </field>
92
+ <field>
93
+ <p>{{ translations.events.column_real_cost }}
94
+ ({{ storeCalendar.lesli.settings.currency.symbol }})</p>
95
+ <input class="input is-default" type="number" name="real_cost" min="0" step="0.01"
96
+ v-model="storeCalendar.event.real_cost" />
97
+ </field>
98
+ <field>
99
+ <p>{{ translations.events.column_signed_up_count }}</p>
100
+ <input class="input is-default" type="number" name="signed_up_count" min="0" step="1"
101
+ v-model="storeCalendar.event.signed_up_count" />
102
+ </field>
103
+ </div>
104
+ </div>
105
+ <div class="columns">
106
+ <div class="column">
107
+ <field>
108
+ <p>{{ translations.events.column_description }}</p>
109
+ <div class="control">
110
+ <textarea v-model="storeCalendar.event.description" class="textarea"
111
+ name="description"></textarea>
112
+ </div>
113
+ </field>
114
+ </div>
115
+ </div>
116
+ <div class="columns">
117
+ <div class="column">
118
+ <field>
119
+ <label class="checkbox">
120
+ {{ translations.events.view_text_mark_as_public }}
121
+ <input type="checkbox" name="public" v-model="storeCalendar.event.public">
122
+ </label>
123
+ </field>
124
+ </div>
125
+ <div class="column">
126
+ <field>
127
+ <label class="checkbox">
128
+ {{ "Is proposal?" }}
129
+ <input type="checkbox" name="is_proposal" v-model="storeCalendar.event.is_proposal">
130
+ </label>
131
+ </field>
132
+ <field v-show="storeCalendar.event.is_proposal">
133
+ <p>{{ translations.events.column_estimated_duration }}</p>
134
+ <input class="input is-default" type="number" name="estimated_mins_durations" min="10" step="10"
135
+ v-model="storeCalendar.event.estimated_mins_durations" />
136
+ </field>
137
+ </div>
138
+ </div>
139
+ <lesli-button type="submit" icon="save">{{ translations.core.view_btn_save }}</lesli-button>
140
+ </fieldset>
141
+ </form>
142
+
143
+ </template>