comparison client/src/components/ImportWaterwayProfiles.vue @ 1753:68bd990dd8e5

feat: added import dialogs for approved gauge meas. and waterway profiles
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 10 Jan 2019 15:55:08 +0100
parents
children 535a1a40f1df
comparison
equal deleted inserted replaced
1752:64fec6db7efc 1753:68bd990dd8e5
1 <template>
2 <div class="d-flex flex-row">
3 <Spacer></Spacer>
4 <div class="card sysconfig mt-3 shadow-xs w-100 h-100 mr-3">
5 <h6
6 class="mb-0 py-2 px-3 border-bottom d-flex text-info align-items-center"
7 >
8 <font-awesome-icon
9 icon="cloud-upload-alt"
10 class="mr-2"
11 ></font-awesome-icon>
12 <translate class="headline">Import Waterwayprofiles</translate>
13 </h6>
14 <div class="card-body stretches-card">
15 <div class="w-95 ml-auto mr-auto mt-4 mb-4">
16 <div class="d-flex flex-row input-group mb-4">
17 <div class="flex-column w-100">
18 <div class="custom-file">
19 <input
20 accept=".zip"
21 type="file"
22 @change="fileSelected"
23 class="custom-file-input"
24 id="uploadFile"
25 />
26 <label class="custom-file-label" for="uploadFile">
27 {{ uploadLabel }}
28 </label>
29 </div>
30 </div>
31 </div>
32 <div class="buttons text-right">
33 <button
34 :disabled="disableUploadButton"
35 @click="submit"
36 class="btn btn-info mt-4"
37 type="button"
38 >
39 <font-awesome-icon
40 class="fa-fw mr-2"
41 fixed-width
42 icon="play"
43 ></font-awesome-icon>
44 <translate>Trigger import</translate>
45 </button>
46 </div>
47 </div>
48 </div>
49 </div>
50 </div>
51 </template>
52
53 <script>
54 /* This is Free Software under GNU Affero General Public License v >= 3.0
55 * without warranty, see README.md and license for details.
56 *
57 * SPDX-License-Identifier: AGPL-3.0-or-later
58 * License-Filename: LICENSES/AGPL-3.0.txt
59 *
60 * Copyright (C) 2018 by via donau
61 * – Österreichische Wasserstraßen-Gesellschaft mbH
62 * Software engineering by Intevation GmbH
63 *
64 * Author(s):
65 * Thomas Junk <thomas.junk@intevation.de>
66 */
67
68 import { displayInfo } from "@/lib/errors.js";
69
70 export default {
71 name: "importwaterwayprofiles",
72 data() {
73 return {
74 disableUploadButton: false,
75 uploadLabel: this.$gettext("choose file to upload"),
76 uploadFile: null
77 };
78 },
79 methods: {
80 fileSelected(e) {
81 const files = e.target.files || e.dataTransfer.files;
82 if (!files) return;
83 this.uploadLabel = files[0].name;
84 this.uploadFile = files[0];
85 },
86 submit() {
87 displayInfo({
88 title: this.$gettext("Import"),
89 message: this.$gettext("under construction")
90 });
91 }
92 },
93 components: {
94 Spacer: () => import("./Spacer")
95 }
96 };
97 </script>
98
99 <style lang="scss" scoped></style>