2 <fieldset class="rows" id="agreement_documents">
3 <legend>{{ $t("Documents") }}</legend>
5 :id="`agreement_period_${counter}`"
7 v-for="(document, counter) in documents"
11 {{ $t("Document .counter", { counter: counter + 1 }) }}
12 <a href="#" @click.prevent="deleteDocument(counter)"
13 ><i class="fa fa-trash"></i>
14 {{ $t("Remove this document") }}</a
19 <label>{{ $t("File") }}:</label>
20 <div class="file_information">
21 <span v-if="!document.file_name">
22 {{ $t("Select a file") }}
25 @change="selectFile($event, counter)"
26 :id="`file_${counter}`"
27 :name="`file_${counter}`"
31 {{ $t("Update file") }}
34 @change="selectFile($event, counter)"
35 :id="`file_${counter}`"
36 :name="`file_${counter}`"
40 <li v-show="document.file_name">
41 {{ $t("File name") }}:
42 <span>{{ document.file_name }}</span>
44 <li v-show="document.file_type">
45 {{ $t("File type") }}:
46 <span>{{ document.file_type }}</span>
48 <li v-show="document.file_name">
49 {{ $t("File description") }}:
51 :id="`file_description_${counter}`"
53 class="file_description"
54 :name="`file_description_${counter}`"
55 v-model="document.file_description"
56 :placeholder="$t('File description')"
59 <li v-show="document.uploaded_on">
60 {{ $t("Uploaded on") }}:
62 format_date(document.uploaded_on)
69 <label :for="`physical_location_${counter}`"
70 >{{ $t("Physical location") }}:
73 :id="`physical_location_${counter}`"
75 class="physical_location"
76 :name="`physical_location_${counter}`"
77 v-model="document.physical_location"
78 :placeholder="$t('Physical location')"
82 <label :for="`uri_${counter}`">{{ $t("URI") }}:</label>
84 :id="`uri_${counter}`"
85 v-model="document.uri"
86 :placeholder="$t('URI')"
90 <label :for="`notes_${counter}`">{{ $t("Notes") }}:</label>
92 :id="`notes_${counter}`"
95 :name="`notes_${counter}`"
96 v-model="document.notes"
97 :placeholder="$t('Notes')"
102 <a class="btn btn-default" @click="addDocument"
103 ><font-awesome-icon icon="plus" /> {{ $t("Add new document") }}</a
111 const format_date = $date
112 return { format_date }
116 let files = e.target.files
119 const reader = new FileReader()
120 reader.onload = e => this.loadFile(file.name, e.target.result, i)
121 reader.readAsBinaryString(file)
123 loadFile(filename, content, i) {
124 this.documents[i].file_name = filename
125 this.documents[i].file_content = btoa(content)
128 this.documents.push({
131 file_description: null,
133 physical_location: null,
138 deleteDocument(counter) {
139 this.documents.splice(counter, 1)
142 name: 'AgreementDocuments',