Mercurial > gemma
comparison client/src/components/systemconfiguration/PDFTemplates.vue @ 3594:63322cd63a57
client: configuration: pdf templates: replaced select and button with two buttons, saves two clicks
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Tue, 04 Jun 2019 14:42:12 +0200 |
parents | b3333311de42 |
children | d1bbfb9635ca |
comparison
equal
deleted
inserted
replaced
3593:e7726cc3bc56 | 3594:63322cd63a57 |
---|---|
43 <font-awesome-icon icon="trash" fixed-width /> | 43 <font-awesome-icon icon="trash" fixed-width /> |
44 </button> | 44 </button> |
45 </div> | 45 </div> |
46 </template> | 46 </template> |
47 </UITableBody> | 47 </UITableBody> |
48 <div class="d-flex flex-column mt-2 w-25 mr-auto"> | 48 <div class="mt-2"> |
49 <select | 49 <button |
50 v-model="type" | 50 class="btn btn-info btn-sm mr-2" |
51 class="form-control d-block custom-select-sm w-75 h-25" | 51 @click=" |
52 type = 'map'; | |
53 $refs.uploadTemplate.click(); | |
54 " | |
52 > | 55 > |
53 <option :value="null"> | |
54 Select template type | |
55 </option> | |
56 <option value="map"> | |
57 Map-template | |
58 </option> | |
59 <option value="diagram"> | |
60 Diagram-template | |
61 </option> | |
62 </select> | |
63 <button class="btn btn-info btn-sm mt-1 w-75" @click="checkUpload"> | |
64 <font-awesome-icon | 56 <font-awesome-icon |
65 icon="spinner" | 57 icon="spinner" |
66 class="fa-spin fa-fw" | 58 class="fa-spin fa-fw" |
67 v-if="uploading" | 59 v-if="uploading" |
68 /> | 60 /> |
69 <font-awesome-icon icon="upload" class="fa-fw" v-else /> | 61 <font-awesome-icon icon="upload" class="fa-fw" v-else /> |
70 <translate>Upload new template</translate> | 62 <translate>Upload new map template</translate> |
63 </button> | |
64 <button | |
65 class="btn btn-info btn-sm" | |
66 @click=" | |
67 type = 'diagram'; | |
68 $refs.uploadTemplate.click(); | |
69 " | |
70 > | |
71 <font-awesome-icon | |
72 icon="spinner" | |
73 class="fa-spin fa-fw" | |
74 v-if="uploading" | |
75 /> | |
76 <font-awesome-icon icon="upload" class="fa-fw" v-else /> | |
77 <translate>Upload new diagram template</translate> | |
71 </button> | 78 </button> |
72 </div> | 79 </div> |
73 </div> | 80 </div> |
74 </div> | 81 </div> |
75 </template> | 82 </template> |
126 typeLabel() { | 133 typeLabel() { |
127 return this.$gettext("Type"); | 134 return this.$gettext("Type"); |
128 } | 135 } |
129 }, | 136 }, |
130 methods: { | 137 methods: { |
131 // check if template type is selceted | |
132 checkUpload() { | |
133 if (this.type) { | |
134 this.$refs.uploadTemplate.click(); | |
135 } else { | |
136 displayError({ | |
137 title: this.$gettext("Error"), | |
138 message: this.$gettext("Please select template type") | |
139 }); | |
140 } | |
141 }, | |
142 downloadTemplate(template) { | 138 downloadTemplate(template) { |
143 if (template) { | 139 if (template) { |
144 var templateData = ""; | 140 var templateData = ""; |
145 var element = document.createElement("a"); | 141 var element = document.createElement("a"); |
146 element.style.display = "none"; | 142 element.style.display = "none"; |