Mercurial > gemma
annotate client/src/components/Identify.vue @ 2350:ed6b0a43d42f
staging: open detailsview for UBN too
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Wed, 20 Feb 2019 10:58:32 +0100 |
parents | 531e776cb81d |
children |
rev | line source |
---|---|
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
1 <template> |
1480 | 2 <div |
3 :class="[ | |
4 'box ui-element rounded bg-white text-nowrap', | |
5 { expanded: showIdentify } | |
6 ]" | |
7 > | |
2260
531e776cb81d
client: reduced width of pdf-, profile- and identify-box
Markus Kottlaender <markus@intevation.de>
parents:
2240
diff
changeset
|
8 <div style="width: 18rem"> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
9 <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
10 <font-awesome-icon icon="info" class="mr-2"></font-awesome-icon> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
11 <translate>Identified</translate> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
12 <font-awesome-icon |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
13 icon="times" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
14 class="ml-auto text-muted" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
15 @click="$store.commit('application/showIdentify', false)" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
16 ></font-awesome-icon> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
17 </h6> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
18 <div class="d-flex flex-column features p-3 flex-grow-1 text-left"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
19 <div v-if="currentMeasurement"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
20 <b> |
1480 | 21 {{ currentMeasurement.quantity }} ({{ |
22 currentMeasurement.unitSymbol | |
23 }}): | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
24 </b> |
1480 | 25 <br /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
26 <small>{{ currentMeasurement.value }}</small> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
27 </div> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
28 <div v-for="(feature, i) of identifiedFeatures" :key="feature.getId()"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
29 <div v-if="feature.getId()" :class="{ 'mt-2': i }"> |
1537
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
30 <strong> |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
31 {{ |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
32 feature.getId().replace(/[.][^.]*$/, "") |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
33 /* cut away everything from the last . to the end */ |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
34 }}: |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
35 </strong> |
1480 | 36 <small |
37 v-for="(value, key) in prepareProperties(feature)" | |
38 :key="key" | |
39 > | |
40 <div v-if="value">{{ key }}:{{ value }}</div> | |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
41 </small> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
42 </div> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
43 </div> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
44 <div |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
45 v-if="!currentMeasurement && !identifiedFeatures.length" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
46 class="text-muted small text-center my-auto" |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
47 > |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
48 <translate>No features identified.</translate> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
49 </div> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
50 </div> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
51 <div class="versioninfo border-top p-3 text-left"> |
1480 | 52 <span v-translate="{ license: 'AGPL-3.0-or-later' }"> |
53 This app uses <i>gemma</i>, which is Free Software under <br /> | |
54 %{ license } without warranty, see docs for details. | |
1460 | 55 </span> |
1480 | 56 <br /> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
57 <a href="https://hg.intevation.de/gemma/file/tip"> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
58 <translate>source-code</translate> |
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
59 </a> |
1480 | 60 {{ versionStr }} <br />© via donau. ⓔ Intevation. <br /> |
61 <span v-translate="{ name: 'OpenSteetMap' }" | |
62 >Some data © | |
63 <a href="https://www.openstreetmap.org/copyright">%{ name }</a> | |
1481
7be4e0dfa104
add the license of geonames to the info box
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1480
diff
changeset
|
64 contributors. |
1460 | 65 </span> |
2240
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
66 <br /> |
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
67 <span v-translate="{ geoLicense: 'CC-BY-4.0' }"> |
1537
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
68 Uses |
1489
a9594f7d44b7
client: improve credit display for GeoNames
Bernhard Reiter <bernhard@intevation.de>
parents:
1481
diff
changeset
|
69 <a href="https://download.geonames.org/export/dump/readme.txt" |
1537
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
70 >GeoNames</a |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
71 > |
c9f5f2c62d06
client: satisfy code style warner
Bernhard Reiter <bernhard@intevation.de>
parents:
1489
diff
changeset
|
72 under %{ geoLicense }. |
2240
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
73 </span> |
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
74 <translate>Generated PDFs use font: </translate> |
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
75 <a href="http://libertine-fonts.org">LinBiolinum</a> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
76 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
77 </div> |
1416
3af7ad9717e2
Client: add a set fo marked translation
Fadi Abbud <fadi.abbud@intevation.de>
parents:
1408
diff
changeset
|
78 </div> |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
79 </template> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
80 |
1449 | 81 <style lang="scss" scoped> |
82 .features { | |
83 max-height: 19rem; | |
84 overflow-y: auto; | |
85 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
86 |
1449 | 87 .versioninfo { |
88 font-size: 60%; | |
89 white-space: normal; | |
90 } | |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
91 </style> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
92 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
93 <script> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
94 /* This is Free Software under GNU Affero General Public License v >= 3.0 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
95 * without warranty, see README.md and license for details. |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
96 * |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
97 * SPDX-License-Identifier: AGPL-3.0-or-later |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
98 * License-Filename: LICENSES/AGPL-3.0.txt |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
99 * |
2240
c3cc21dee75d
client: pdf-gen add multi-language font
Bernhard Reiter <bernhard@intevation.de>
parents:
1558
diff
changeset
|
100 * Copyright (C) 2018, 2019 by via donau |
1272
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
101 * – Österreichische Wasserstraßen-Gesellschaft mbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
102 * Software engineering by Intevation GmbH |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
103 * |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
104 * Author(s): |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
105 * Thomas Junk <thomas.junk@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
106 * Bernhard E. Reiter <bernhard.reiter@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
107 * Markus Kottländer <markus.kottlaender@intevation.de> |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
108 */ |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
109 import { mapState, mapGetters } from "vuex"; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
110 |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
111 export default { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
112 name: "identify", |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
113 computed: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
114 ...mapGetters("application", ["versionStr"]), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
115 ...mapState("application", ["showIdentify"]), |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
116 ...mapState("map", ["identifiedFeatures", "currentMeasurement"]) |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
117 }, |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
118 methods: { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
119 prepareProperties(feature) { |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
120 // return dict object with propertyname:plainvalue prepared for display |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
121 var properties = feature.getProperties(); |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
122 delete properties[feature.getGeometryName()]; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
123 return properties; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
124 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
125 } |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
126 }; |
bc55ffaeb639
cleaned up client/src directory
Markus Kottlaender <markus@intevation.de>
parents:
diff
changeset
|
127 </script> |