Mercurial > gemma
changeset 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 | e7726cc3bc56 |
children | d4ff8ea19f2c |
files | client/src/components/systemconfiguration/PDFTemplates.vue |
diffstat | 1 files changed, 23 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/PDFTemplates.vue Tue Jun 04 14:32:55 2019 +0200 +++ b/client/src/components/systemconfiguration/PDFTemplates.vue Tue Jun 04 14:42:12 2019 +0200 @@ -45,29 +45,36 @@ </div> </template> </UITableBody> - <div class="d-flex flex-column mt-2 w-25 mr-auto"> - <select - v-model="type" - class="form-control d-block custom-select-sm w-75 h-25" + <div class="mt-2"> + <button + class="btn btn-info btn-sm mr-2" + @click=" + type = 'map'; + $refs.uploadTemplate.click(); + " > - <option :value="null"> - Select template type - </option> - <option value="map"> - Map-template - </option> - <option value="diagram"> - Diagram-template - </option> - </select> - <button class="btn btn-info btn-sm mt-1 w-75" @click="checkUpload"> <font-awesome-icon icon="spinner" class="fa-spin fa-fw" v-if="uploading" /> <font-awesome-icon icon="upload" class="fa-fw" v-else /> - <translate>Upload new template</translate> + <translate>Upload new map template</translate> + </button> + <button + class="btn btn-info btn-sm" + @click=" + type = 'diagram'; + $refs.uploadTemplate.click(); + " + > + <font-awesome-icon + icon="spinner" + class="fa-spin fa-fw" + v-if="uploading" + /> + <font-awesome-icon icon="upload" class="fa-fw" v-else /> + <translate>Upload new diagram template</translate> </button> </div> </div> @@ -128,17 +135,6 @@ } }, methods: { - // check if template type is selceted - checkUpload() { - if (this.type) { - this.$refs.uploadTemplate.click(); - } else { - displayError({ - title: this.$gettext("Error"), - message: this.$gettext("Please select template type") - }); - } - }, downloadTemplate(template) { if (template) { var templateData = "";