Mercurial > gemma
diff client/src/components/systemconfiguration/PDFTemplates.vue @ 2247:e6fba449aa3c
merged pdf-export in default
author | Markus Kottlaender <markus@intevation.de> |
---|---|
date | Wed, 13 Feb 2019 16:41:00 +0100 |
parents | 585373d33f8f |
children | ce6fd3d4a3a2 |
line wrap: on
line diff
--- a/client/src/components/systemconfiguration/PDFTemplates.vue Wed Feb 13 16:13:44 2019 +0100 +++ b/client/src/components/systemconfiguration/PDFTemplates.vue Wed Feb 13 16:41:00 2019 +0100 @@ -4,36 +4,25 @@ <h5><translate>PDF-Templates</translate></h5> <input @change="upload" - id="uploadPDFTemplates" - ref="uploadPDFTemplates" + id="uploadPDFTemplate" + ref="uploadPDFTemplate" type="file" style="visibility:hidden" /> - <button - class="btn btn-sm btn-info" - @click="$refs.uploadPDFTemplates.click()" - > - <font-awesome-icon icon="spinner" class="fa-spin" v-if="uploading" /> - <font-awesome-icon icon="plus" v-else /> - </button> </div> - <div class="d-flex mt-1"> + <div class="mt-1"> <table class="table table-sm"> <thead> <tr> <th>Name</th> - <th>Description</th> <th>Date</th> - <th>Country</th> <th></th> </tr> </thead> <transition-group name="list-fade" tag="tbody"> <tr v-for="template in pdfTemplates" :key="template.name"> <td>{{ template.name }}</td> - <td>{{ template.description }}</td> - <td>{{ template.date }}</td> - <td></td> + <td>{{ template.time }}</td> <td class="text-right"> <button class="btn btn-sm btn-info mr-2"> <font-awesome-icon icon="download" /> @@ -51,6 +40,18 @@ </tr> </transition-group> </table> + <button + class="btn btn-sm btn-info" + @click="$refs.uploadPDFTemplate.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 template</translate> + </button> </div> <div @@ -126,10 +127,10 @@ this.uploading = true; this.$store .dispatch( - "application/uploadPDFTemplates", - this.$refs.uploadPDFTemplates.files + "application/uploadPDFTemplate", + this.$refs.uploadPDFTemplate.files ) - .then(() => { + .finally(() => { this.uploading = false; }); }, @@ -137,6 +138,9 @@ this.showDeleteTemplatePrompt = false; this.$store.dispatch("application/removePDFTemplate", template); } + }, + mounted() { + this.$store.dispatch("application/loadPdfTemplates"); } }; </script>