PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.8
Booking for Appointments and Events Calendar – Amelia v2.4.8
2.4.8 2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / v3 / src / views / admin / customize / steps / Events / common / EventTickets / EventTickets.vue
ameliabooking / v3 / src / views / admin / customize / steps / Events / common / EventTickets Last commit date
parts 1 month ago EventTickets.vue 1 month ago
EventTickets.vue
204 lines
1 <template>
2 <div class="am-elt" :class="props.globalClass" :style="cssVars">
3 <div class="am-elt__header">
4 <div class="am-elt__header-left">
5 <p class="am-elt__heading">
6 {{ labelsDisplay('event_tickets') }}
7 </p>
8 <p>
9 {{ labelsDisplay('event_tickets_context') }}
10 </p>
11 </div>
12 </div>
13 <template v-for="ticket in tickets" :key="ticket.id">
14 <EventTicket
15 :ticket="ticket"
16 :capacity="null"
17 :extra-people="null"
18 :customized-labels="customLabels"
19 :in-dialog="props.inDialog"
20 />
21 </template>
22 </div>
23 </template>
24
25 <script setup>
26 // * Parts
27 import EventTicket from './parts/EventTicket.vue'
28
29 // * Import from Vue
30 import { ref, reactive, computed, inject } from 'vue'
31
32 // * Composables
33 import { useColorTransparency } from '../../../../../../../assets/js/common/colorManipulation'
34 import { useReactiveCustomize } from '../../../../../../../assets/js/admin/useReactiveCustomize.js'
35
36 let props = defineProps({
37 globalClass: {
38 type: String,
39 default: '',
40 },
41 inDialog: {
42 type: Boolean,
43 default: false,
44 },
45 })
46
47 // * Event Tickets
48 let tickets = ref([
49 {
50 id: 1,
51 eventTicketId: 1,
52 name: 'Ticket one',
53 persons: 0,
54 price: 10,
55 sold: 5,
56 spots: 10,
57 },
58 {
59 id: 2,
60 eventTicketId: 2,
61 name: 'Ticket two',
62 persons: 0,
63 price: 10,
64 sold: 1,
65 spots: 1,
66 },
67 {
68 id: 3,
69 eventTicketId: 3,
70 name: 'Ticket three',
71 persons: 0,
72 price: 10,
73 sold: 0,
74 spots: 10,
75 },
76 ])
77
78 // * Customize
79 const { amCustomize } = useReactiveCustomize()
80
81 // * Form string recognition
82 let pageRenderKey = inject('pageRenderKey')
83
84 // * Labels
85 let langKey = inject('langKey')
86 let amLabels = inject('labels')
87
88 function labelsDisplay(label) {
89 let computedLabel = computed(() => {
90 let translations = amCustomize.value[pageRenderKey.value].tickets.translations
91 return translations && translations[label] && translations[label][langKey.value]
92 ? translations[label][langKey.value]
93 : amLabels[label]
94 })
95
96 return computedLabel.value
97 }
98
99 // * Computed labels
100 let customLabels = computed(() => {
101 let computedLabels = reactive({ ...amLabels })
102
103 if (amCustomize.value[pageRenderKey.value].tickets.translations) {
104 let customizedLabels = amCustomize.value[pageRenderKey.value].tickets.translations
105 Object.keys(customizedLabels).forEach((labelKey) => {
106 if (customizedLabels[labelKey][langKey.value]) {
107 computedLabels[labelKey] = customizedLabels[labelKey][langKey.value]
108 } else if (customizedLabels[labelKey].default) {
109 computedLabels[labelKey] = customizedLabels[labelKey].default
110 }
111 })
112 }
113 return computedLabels
114 })
115
116 // * Fonts
117 let amFonts = inject('amFonts')
118
119 // * Colors
120 let amColors = inject('amColors')
121
122 // * Css Vars
123 let cssVars = computed(() => {
124 return {
125 '--am-c-font-family': amFonts.value.fontFamily,
126 '--am-c-elt-text': amColors.value.colorMainText,
127 '--am-c-elt-text-op90': useColorTransparency(amColors.value.colorMainText, 0.9),
128 '--am-c-elt-text-op80': useColorTransparency(amColors.value.colorMainText, 0.8),
129 }
130 })
131 </script>
132
133 <script>
134 export default {
135 name: 'EventTickets',
136 label: 'event_select_tickets',
137 key: 'tickets',
138 }
139 </script>
140
141 <style lang="scss">
142 #amelia-app-backend-new #amelia-container {
143 .am-elt {
144 & > * {
145 font-family: var(--am-font-family), sans-serif;
146 box-sizing: border-box;
147 word-break: break-word;
148
149 $count: 100;
150 @for $i from 0 through $count {
151 &:nth-child(#{$i + 1}) {
152 animation: 600ms cubic-bezier(0.45, 1, 0.4, 1.2) #{$i * 100}ms am-animation-slide-up;
153 animation-fill-mode: both;
154 }
155 }
156 }
157
158 &__header {
159 display: flex;
160 flex-direction: column;
161 margin: 0 0 16px;
162
163 &-left {
164 p {
165 font-size: 13px;
166 font-weight: 400;
167 line-height: 18px;
168 word-break: break-word;
169 color: var(--am-c-elt-text-op80); /* $shade-700 */
170 margin: 0;
171 }
172
173 p.am-elt__heading {
174 font-size: 15px;
175 font-weight: 500;
176 line-height: 24px;
177 //text-transform: uppercase;
178 color: var(--am-c-elt-text); /* $shade-900 */
179 margin: 0;
180 }
181 }
182
183 &-right {
184 margin-top: 16px;
185 display: flex;
186 justify-content: space-between;
187
188 p {
189 font-weight: 400;
190 font-size: 15px;
191 line-height: 1.6;
192 color: var(--am-c-elt-text-op90); /* $shade-800 */
193
194 span {
195 font-weight: 700;
196 margin-right: 4px;
197 }
198 }
199 }
200 }
201 }
202 }
203 </style>
204