Lines 1-14
Link Here
|
1 |
<template> |
1 |
<template> |
2 |
<transition name="modal"> |
2 |
<div |
3 |
<div v-if="showModal" class="add_agreement_modal"> |
3 |
id="add_agreement" |
4 |
<AgreementsList :embedded="true" @select-agreement="addAgreement" /> |
4 |
class="modal" |
5 |
<input |
5 |
role="dialog" |
6 |
type="button" |
6 |
aria-labelledby="add_agreement_label" |
7 |
@click="showModal = false" |
7 |
aria-hidden="true" |
8 |
:value="$__('Close')" |
8 |
> |
9 |
/> |
9 |
<div class="modal-dialog modal-xl"> |
|
|
10 |
<div class="modal-content modal-xl"> |
11 |
<div class="modal-header"> |
12 |
<h1 class="modal-title" id="add_agreement_label"> |
13 |
{{ $__("Add agreement") }} |
14 |
</h1> |
15 |
<button |
16 |
type="button" |
17 |
class="btn-close" |
18 |
data-bs-dismiss="modal" |
19 |
aria-label="Close" |
20 |
></button> |
21 |
</div> |
22 |
<div class="modal-body position-relative overflow-visible"> |
23 |
<AgreementsList |
24 |
:embedded="true" |
25 |
@select-agreement="addAgreement" |
26 |
/> |
27 |
</div> |
28 |
<div class="modal-footer"> |
29 |
<button |
30 |
class="btn btn-default deny cancel" |
31 |
type="button" |
32 |
data-bs-dismiss="modal" |
33 |
> |
34 |
{{ $__("Close") }} |
35 |
</button> |
36 |
</div> |
37 |
</div> |
10 |
</div> |
38 |
</div> |
11 |
</transition> |
39 |
</div> |
12 |
<div id="package_agreements"> |
40 |
<div id="package_agreements"> |
13 |
<div |
41 |
<div |
14 |
v-for="( |
42 |
v-for="( |
Lines 33-39
Link Here
|
33 |
><i class="fa fa-trash"></i |
61 |
><i class="fa fa-trash"></i |
34 |
></a> |
62 |
></a> |
35 |
</div> |
63 |
</div> |
36 |
<a class="btn btn-default btn-xs" @click="showModal = true" |
64 |
<a class="btn btn-default btn-xs" @click="showAddAgreementModal()" |
37 |
><font-awesome-icon icon="plus" /> {{ $__("Add new agreement") }}</a |
65 |
><font-awesome-icon icon="plus" /> {{ $__("Add new agreement") }}</a |
38 |
> |
66 |
> |
39 |
</div> |
67 |
</div> |
Lines 45-53
import { APIClient } from "../../fetch/api-client.js"
Link Here
|
45 |
import { setWarning, removeMessages } from "../../messages" |
73 |
import { setWarning, removeMessages } from "../../messages" |
46 |
|
74 |
|
47 |
export default { |
75 |
export default { |
48 |
data() { |
76 |
data() {}, |
49 |
return { showModal: false } |
|
|
50 |
}, |
51 |
beforeCreate() {}, |
77 |
beforeCreate() {}, |
52 |
methods: { |
78 |
methods: { |
53 |
serializeAgreement() { |
79 |
serializeAgreement() { |
Lines 72-80
export default {
Link Here
|
72 |
) |
98 |
) |
73 |
return erm_package |
99 |
return erm_package |
74 |
}, |
100 |
}, |
|
|
101 |
showAddAgreementModal() { |
102 |
$("#add_agreement").modal("show") |
103 |
}, |
75 |
addAgreement(agreement_id) { |
104 |
addAgreement(agreement_id) { |
76 |
removeMessages() |
105 |
removeMessages() |
77 |
this.showModal = false |
106 |
$("#add_agreement").modal("hide") |
78 |
let erm_package = this.serializeAgreement() |
107 |
let erm_package = this.serializeAgreement() |
79 |
// Only add if it does not exist |
108 |
// Only add if it does not exist |
80 |
if ( |
109 |
if ( |
Lines 135-168
export default {
Link Here
|
135 |
} |
164 |
} |
136 |
</script> |
165 |
</script> |
137 |
<style> |
166 |
<style> |
138 |
.add_agreement_modal { |
167 |
#add_agreement #agreements_list table { |
139 |
position: fixed; |
|
|
140 |
z-index: 9998; |
141 |
top: 0; |
142 |
left: 0; |
143 |
width: 80%; |
144 |
height: 80%; |
145 |
background-color: rgba(0, 0, 0, 0.5); |
146 |
display: table; |
147 |
transition: opacity 0.3s ease; |
148 |
margin: auto; |
149 |
padding: 20px 30px; |
150 |
background-color: #fff; |
151 |
border-radius: 2px; |
152 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33); |
153 |
transition: all 0.3s ease; |
154 |
font-family: Helvetica, Arial, sans-serif; |
155 |
} |
156 |
</style> |
157 |
|
158 |
<style> |
159 |
.add_agreement_modal #agreements_list table { |
160 |
display: table; |
168 |
display: table; |
161 |
} |
169 |
} |
162 |
.add_agreement_modal .filters label { |
170 |
#add_agreement .filters label { |
163 |
float: none !important; |
171 |
float: none !important; |
164 |
} |
172 |
} |
165 |
.add_agreement_modal .filters input[type="checkbox"] { |
173 |
#add_agreement .filters input[type="checkbox"] { |
166 |
margin-left: 0 !important; |
174 |
margin-left: 0 !important; |
167 |
} |
175 |
} |
168 |
</style> |
176 |
</style> |
169 |
- |
|
|