|
Lines 1-75
Link Here
|
| 1 |
<template> |
1 |
<template> |
| 2 |
<div class="dialog message" v-if="message" v-html="message"></div> |
2 |
<div> |
| 3 |
<div class="dialog alert" v-if="error" v-html="error"></div> |
3 |
<!-- Confirmation Modal --> |
| 4 |
<div class="dialog alert modal" v-if="warning"> |
4 |
<div |
| 5 |
<h1 v-html="warning"></h1> |
5 |
v-if="confirmation" |
| 6 |
<button id="close_modal" class="approve" @click="removeMessages"> |
6 |
class="modal show" |
| 7 |
<i class="fa fa-fw fa-check"></i> |
7 |
tabindex="-1" |
| 8 |
{{ $__("Close") }} |
8 |
role="dialog" |
| 9 |
</button> |
9 |
style="display: block" |
| 10 |
</div> |
10 |
> |
| 11 |
<div class="modal_centered" v-if="confirmation"> |
11 |
<div class="modal-dialog modal-dialog-centered" role="document"> |
| 12 |
<div class="dialog alert confirmation"> |
12 |
<div class="modal-content"> |
| 13 |
<h1 v-html="confirmation.title"></h1> |
13 |
<div class="modal-header"> |
| 14 |
<p v-html="confirmation.message"></p> |
14 |
<h5 |
| 15 |
<div class="inputs" v-if="confirmation.inputs"> |
15 |
class="modal-title" |
| 16 |
<form ref="confirmationform"> |
16 |
v-html="confirmation.title" |
| 17 |
<div |
17 |
></h5> |
| 18 |
class="row" |
18 |
</div> |
| 19 |
v-for="input in confirmation.inputs" |
19 |
<div class="modal-body"> |
| 20 |
v-bind:key="input.id" |
20 |
<p v-html="confirmation.message"></p> |
| 21 |
> |
21 |
<div v-if="confirmation.inputs" class="form-group"> |
| 22 |
<div class="col-md-6"> |
22 |
<form ref="confirmationform"> |
| 23 |
<label |
23 |
<div |
| 24 |
:for="`confirmation_input_${input.id}`" |
24 |
class="form-row" |
| 25 |
v-bind:class="{ required: input.required }" |
25 |
v-for="input in confirmation.inputs" |
| 26 |
>{{ input.label }}:</label |
26 |
:key="input.id" |
| 27 |
> |
27 |
> |
|
|
28 |
<div class="col-md-6"> |
| 29 |
<label |
| 30 |
:for="`confirmation_input_${input.id}`" |
| 31 |
:class="{ |
| 32 |
required: input.required, |
| 33 |
}" |
| 34 |
> |
| 35 |
{{ input.label }}: |
| 36 |
</label> |
| 37 |
</div> |
| 38 |
<div class="col-md-6"> |
| 39 |
<flat-pickr |
| 40 |
v-if="input.type == 'Date'" |
| 41 |
:id="`confirmation_input_${input.id}`" |
| 42 |
v-model="input.value" |
| 43 |
:required="input.required" |
| 44 |
:config="fp_config" |
| 45 |
/> |
| 46 |
<input |
| 47 |
v-if="input.type == 'Text'" |
| 48 |
type="text" |
| 49 |
:id="`confirmation_input_${input.id}`" |
| 50 |
v-model="input.value" |
| 51 |
:required="input.required" |
| 52 |
class="form-control" |
| 53 |
/> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
</form> |
| 28 |
</div> |
57 |
</div> |
| 29 |
<div class="col-md-6"> |
58 |
</div> |
| 30 |
<flat-pickr |
59 |
<div class="modal-footer"> |
| 31 |
v-if="input.type == 'Date'" |
60 |
<button |
| 32 |
:id="`confirmation_input_${input.id}`" |
61 |
v-if="accept_callback" |
| 33 |
v-model="input.value" |
62 |
id="accept_modal" |
| 34 |
:required="input.required" |
63 |
class="btn btn-success" |
| 35 |
:config="fp_config" |
64 |
@click="submit" |
| 36 |
/> |
65 |
> |
| 37 |
<input |
66 |
<i class="fa fa-fw fa-check"></i> |
| 38 |
v-if="input.type == 'Text'" |
67 |
<span v-html="confirmation.accept_label"></span> |
| 39 |
:id="`confirmation_input_${input.id}`" |
68 |
</button> |
| 40 |
v-model="input.value" |
69 |
<button |
| 41 |
:required="input.required" |
70 |
id="close_modal" |
| 42 |
/> |
71 |
class="btn btn-danger" |
|
|
72 |
@click="removeConfirmationMessages" |
| 73 |
> |
| 74 |
<i class="fa fa-fw fa-remove"></i> |
| 75 |
<span v-html="confirmation.cancel_label"></span> |
| 76 |
</button> |
| 77 |
</div> |
| 78 |
</div> |
| 79 |
</div> |
| 80 |
</div> |
| 81 |
|
| 82 |
<!-- Submitting Modal --> |
| 83 |
<div |
| 84 |
v-if="is_submitting" |
| 85 |
class="modal show" |
| 86 |
tabindex="-1" |
| 87 |
role="dialog" |
| 88 |
style="display: block" |
| 89 |
> |
| 90 |
<div class="modal-dialog modal-dialog-centered" role="document"> |
| 91 |
<div class="modal-content"> |
| 92 |
<div class="modal-header"> |
| 93 |
<h5 |
| 94 |
class="modal-title" |
| 95 |
v-html="confirmation.title" |
| 96 |
></h5> |
| 97 |
</div> |
| 98 |
<div class="modal-body text-center"> |
| 99 |
<div class="spinner-border text-primary" role="status"> |
| 100 |
<span class="sr-only">{{ |
| 101 |
$__("Submitting...") |
| 102 |
}}</span> |
| 43 |
</div> |
103 |
</div> |
| 44 |
</div> |
104 |
</div> |
| 45 |
</form> |
105 |
<div class="modal-footer"> |
|
|
106 |
<button |
| 107 |
v-if="accept_callback" |
| 108 |
id="accept_modal" |
| 109 |
class="btn btn-success" |
| 110 |
@click="submit" |
| 111 |
> |
| 112 |
<i class="fa fa-fw fa-check"></i> |
| 113 |
<span v-html="confirmation.accept_label"></span> |
| 114 |
</button> |
| 115 |
<button |
| 116 |
id="close_modal" |
| 117 |
class="btn btn-danger" |
| 118 |
@click="removeConfirmationMessages" |
| 119 |
> |
| 120 |
<i class="fa fa-fw fa-remove"></i> |
| 121 |
<span v-html="confirmation.cancel_label"></span> |
| 122 |
</button> |
| 123 |
</div> |
| 124 |
</div> |
| 46 |
</div> |
125 |
</div> |
| 47 |
<button |
|
|
| 48 |
v-if="accept_callback" |
| 49 |
id="accept_modal" |
| 50 |
class="approve" |
| 51 |
@click="submit" |
| 52 |
> |
| 53 |
<i class="fa fa-fw fa-check"></i> |
| 54 |
<span v-html="confirmation.accept_label"></span> |
| 55 |
</button> |
| 56 |
<button |
| 57 |
id="close_modal" |
| 58 |
class="deny" |
| 59 |
@click="removeConfirmationMessages" |
| 60 |
> |
| 61 |
<i class="fa fa-fw fa-remove"></i> |
| 62 |
<span v-html="confirmation.cancel_label"></span> |
| 63 |
</button> |
| 64 |
</div> |
126 |
</div> |
| 65 |
</div> |
|
|
| 66 |
<!-- Must be styled differently --> |
| 67 |
|
127 |
|
| 68 |
<div class="modal_centered" v-if="is_submitting"> |
128 |
<!-- Loading Modal --> |
| 69 |
<div class="spinner dialog alert">{{ $__("Submitting...") }}</div> |
129 |
<div |
| 70 |
</div> |
130 |
v-if="is_loading" |
| 71 |
<div class="modal_centered" v-if="is_loading"> |
131 |
class="modal show" |
| 72 |
<div class="spinner dialog message">{{ $__("Loading...") }}</div> |
132 |
tabindex="-1" |
|
|
133 |
role="dialog" |
| 134 |
style="display: block" |
| 135 |
> |
| 136 |
<div class="modal-dialog modal-dialog-centered" role="document"> |
| 137 |
<div class="modal-content"> |
| 138 |
<div class="modal-header"> |
| 139 |
<h5 |
| 140 |
class="modal-title" |
| 141 |
v-html="confirmation.title" |
| 142 |
></h5> |
| 143 |
</div> |
| 144 |
<div class="modal-body text-center"> |
| 145 |
<div class="spinner-border text-info" role="status"> |
| 146 |
<span class="sr-only">{{ $__("Loading...") }}</span> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
<div class="modal-footer"> |
| 150 |
<button |
| 151 |
v-if="accept_callback" |
| 152 |
id="accept_modal" |
| 153 |
class="btn btn-success" |
| 154 |
@click="submit" |
| 155 |
> |
| 156 |
<i class="fa fa-fw fa-check"></i> |
| 157 |
<span v-html="confirmation.accept_label"></span> |
| 158 |
</button> |
| 159 |
<button |
| 160 |
id="close_modal" |
| 161 |
class="btn btn-danger" |
| 162 |
@click="removeConfirmationMessages" |
| 163 |
> |
| 164 |
<i class="fa fa-fw fa-remove"></i> |
| 165 |
<span v-html="confirmation.cancel_label"></span> |
| 166 |
</button> |
| 167 |
</div> |
| 168 |
</div> |
| 169 |
</div> |
| 170 |
</div> |
| 73 |
</div> |
171 |
</div> |
| 74 |
</template> |
172 |
</template> |
| 75 |
|
173 |
|
|
Lines 77-82
Link Here
|
| 77 |
import { inject } from "vue" |
175 |
import { inject } from "vue" |
| 78 |
import { storeToRefs } from "pinia" |
176 |
import { storeToRefs } from "pinia" |
| 79 |
import flatPickr from "vue-flatpickr-component" |
177 |
import flatPickr from "vue-flatpickr-component" |
|
|
178 |
|
| 80 |
export default { |
179 |
export default { |
| 81 |
data() { |
180 |
data() { |
| 82 |
return { |
181 |
return { |
|
Lines 84-90
export default {
Link Here
|
| 84 |
} |
183 |
} |
| 85 |
}, |
184 |
}, |
| 86 |
methods: { |
185 |
methods: { |
| 87 |
submit: function (e) { |
186 |
submit() { |
| 88 |
if ( |
187 |
if ( |
| 89 |
this.confirmation.inputs && |
188 |
this.confirmation.inputs && |
| 90 |
this.confirmation.inputs.filter( |
189 |
this.confirmation.inputs.filter( |
|
Lines 130-194
export default {
Link Here
|
| 130 |
</script> |
229 |
</script> |
| 131 |
|
230 |
|
| 132 |
<style scoped> |
231 |
<style scoped> |
| 133 |
.modal { |
232 |
.modal.show { |
| 134 |
position: fixed; |
233 |
display: block !important; |
| 135 |
z-index: 9998; |
234 |
background-color: rgba(0, 0, 0, 0.5); |
| 136 |
display: table; |
|
|
| 137 |
transition: opacity 0.3s ease; |
| 138 |
margin: auto; |
| 139 |
padding: 20px 30px; |
| 140 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33); |
| 141 |
transition: all 0.3s ease; |
| 142 |
} |
| 143 |
#close_modal { |
| 144 |
cursor: pointer; |
| 145 |
} |
| 146 |
|
| 147 |
.modal_centered { |
| 148 |
position: fixed; |
| 149 |
z-index: 9998; |
| 150 |
display: table; |
| 151 |
transition: opacity 0.3s ease; |
| 152 |
left: 0px; |
| 153 |
top: 0px; |
| 154 |
width: 100%; |
| 155 |
height: 100%; |
| 156 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33); |
| 157 |
} |
| 158 |
.spinner { |
| 159 |
position: absolute; |
| 160 |
top: 50%; |
| 161 |
left: 40%; |
| 162 |
width: 10%; |
| 163 |
} |
| 164 |
|
| 165 |
.confirmation { |
| 166 |
position: absolute; |
| 167 |
top: 25%; |
| 168 |
left: 40%; |
| 169 |
|
| 170 |
width: 50%; |
| 171 |
min-height: 10%; |
| 172 |
margin: auto; |
| 173 |
align-items: center; |
| 174 |
justify-content: center; |
| 175 |
} |
| 176 |
.confirmation .inputs { |
| 177 |
margin-top: 0.4em; |
| 178 |
} |
| 179 |
.confirmation .inputs input, |
| 180 |
:deep(.flatpickr-input) { |
| 181 |
width: auto; |
| 182 |
margin: 0px; |
| 183 |
float: left; |
| 184 |
} |
235 |
} |
| 185 |
|
236 |
|
| 186 |
:deep(.flatpickr-input) { |
237 |
.spinner-border { |
| 187 |
padding-left: 20px; |
238 |
width: 3rem; |
|
|
239 |
height: 3rem; |
| 188 |
} |
240 |
} |
| 189 |
|
241 |
|
| 190 |
.confirmation .inputs label { |
242 |
.modal-footer .btn { |
| 191 |
padding: 0.4em; |
243 |
margin-right: 0.5rem; |
| 192 |
float: right; |
|
|
| 193 |
} |
244 |
} |
| 194 |
</style> |
245 |
</style> |
| 195 |
- |
|
|