Skip to content

Commit e529384

Browse files
committed
update title from workspace title, fix editing mode hints
1 parent 3c40f7f commit e529384

File tree

3 files changed

+59
-15
lines changed

3 files changed

+59
-15
lines changed

vue/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
<meta name="msapplication-TileColor" content="#f5f5f5">
1616
<meta name="theme-color" content="#f5f5f5">
1717
<meta replace>
18-
<title>dføur – Beteiligung Rahmenplan Campus Bochum</title>
19-
<meta name="description" content="Digitale Beteiligung zum Rahmenplan Campus Bochum.">
18+
<title>dføur</title>
19+
<meta name="description" content="dføur - die kollaborative kartenbasierte Platform.">
2020
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
2121
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet">
2222
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">

vue/src/components/SnapshotMap.vue

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"new": "Neuer Kommentar",
1010
"emailhint": "Um Ihren Kommentar freizuschalten, schicken wir Ihnen eine Email mit einem Aktivierungslink. Bitte geben Sie Ihre Email Adresse an:",
1111
"commentSaved": "Ihr Kommentar wurde gespeichert. Klicken Sie den Link in der Email um ihn freizuschalten."
12+
},
13+
"polygon": {
14+
"add": "Klicken Sie auf die Stelle in Karte an der Sie einen Kommentar hinzufügen möchten.",
15+
"editing": {
16+
"invalid": "Ungültige Geometrie, hinzufügen dieses Punktes möglich.",
17+
"unfinished": "Klicken Sie erneut auf den Startpunkt, um den Kommentar abzuschliessen",
18+
"closable": "Klicken Sie hier, um den Kommentar abzuschliessen."
19+
}
1220
}
1321
},
1422
"areamanagement": {
@@ -21,6 +29,11 @@
2129
},
2230
"polygon": {
2331
"add": "Klicken Sie auf die Stelle in Karte an der Sie eine Fläche hinzufügen möchten.",
32+
"editing": {
33+
"invalid": "Ungültige Geometrie, hinzufügen dieses Punktes möglich.",
34+
"unfinished": "Klicken Sie erneut auf den Startpunkt, um die Fläche abzuschliessen",
35+
"closable": "Klicken Sie hier, um die Fläche abzuschliessen."
36+
},
2437
"new": "Neue Fläche",
2538
"emailhint": "Um Ihren Fläche freizuschalten, schicken wir Ihnen eine Email mit einem Aktivierungslink. Bitte geben Sie Ihre Email Adresse an:",
2639
"commentSaved": "Ihre Fläche wurde gespeichert. Klicken Sie den Link in der Email um ihn freizuschalten."
@@ -70,9 +83,26 @@
7083

7184
<v-slide-y-transition>
7285
<p class="addHint elevation-6" v-if="addingAnnotation">
73-
<span v-if="annotations.mode == 'PAR'">{{ $t('participation.annotation.add') }}</span>
86+
<span v-if="annotations.mode == 'PAR'">
87+
<span v-if="polygonEditingState.invalid">
88+
{{ $t('participation.polygon.editing.invalid') }}</span>
89+
<span v-else-if="polygonEditingState.closable">
90+
{{ $t('participation.polygon.editing.closable') }}</span>
91+
<span v-else-if="polygonEditingState.active">
92+
{{ $t('participation.polygon.editing.unfinished') }}</span>
93+
<span v-else>
94+
{{ $t('participation.annotation.add') }}</span>
95+
</span>
7496
<span v-else-if="annotations.mode == 'MGT' && addingAnnotation == 'PLY'">
75-
{{ $t('areamanagement.polygon.add') }}</span>
97+
<span v-if="polygonEditingState.invalid">
98+
{{ $t('areamanagement.polygon.editing.invalid') }}</span>
99+
<span v-else-if="polygonEditingState.closable">
100+
{{ $t('areamanagement.polygon.editing.closable') }}</span>
101+
<span v-else-if="polygonEditingState.active">
102+
{{ $t('areamanagement.polygon.editing.unfinished') }}</span>
103+
<span v-else>
104+
{{ $t('areamanagement.polygon.add') }}</span>
105+
</span>
76106
<span v-else-if="annotations.mode == 'MGT' && addingAnnotation == 'COM'">
77107
{{ $t('areamanagement.note.add') }}</span>
78108
</p>
@@ -140,7 +170,7 @@
140170
id="addingAnnotationPly"
141171
color="primary"
142172
v-if="annotations.polygon.open"
143-
@click="addingAnnotation ? addingAnnotation=null : addingAnnotation='PLY';">
173+
@click="addingAnnotation ? addingAnnotation = null : addingAnnotation = 'PLY';">
144174
<v-icon v-if="!addingAnnotation || addingAnnotation != 'PLY'">
145175
mdi-shape-polygon-plus
146176
</v-icon>
@@ -154,11 +184,14 @@
154184
light width="400" class="pa-4 elevation-6"
155185
>
156186
<h3>
157-
<span v-if="annotations.mode == 'PAR'">
158-
{{ $t('participation.annotation.new') }}</span>
159-
<span v-else-if="annotations.mode == 'MGT' && newAnnotation.kind == 'PLY'">
187+
<span v-if="annotations.mode == 'PAR' && addingAnnotation == 'PLY'">
188+
<span>{{ $t('participation.polygon.new') }}</span>
189+
</span>
190+
<span v-else-if="annotations.mode == 'PAR' && addingAnnotation == 'COM'">
191+
{{ $t('participation.note.new') }}</span>
192+
<span v-else-if="annotations.mode == 'MGT' && addingAnnotation == 'PLY'">
160193
{{ $t('areamanagement.polygon.new') }}</span>
161-
<span v-else-if="annotations.mode == 'MGT' && newAnnotation.kind == 'COM'">
194+
<span v-else-if="annotations.mode == 'MGT' && addingAnnotation == 'COM'">
162195
{{ $t('areamanagement.note.new') }}</span>
163196
</h3>
164197
<v-form
@@ -411,8 +444,7 @@ body,
411444
412445
#myLocation,
413446
#addingAnnotationPt,
414-
#addingAnnotationPly
415-
{
447+
#addingAnnotationPly {
416448
top: 5.6em;
417449
right: 1.3em;
418450
transition: top 0.3s;
@@ -608,6 +640,11 @@ export default {
608640
mapinfoopen: true,
609641
addingAnnotation: null,
610642
newAnnotation: null,
643+
polygonEditingState: {
644+
active: false,
645+
invalid: false,
646+
closable: false
647+
},
611648
polygonString: [],
612649
drawnItems: null,
613650
tooltipContainer: null,
@@ -964,6 +1001,7 @@ export default {
9641001
break;
9651002
}
9661003
case 'PLY': {
1004+
this.polygonEditingState.active = true;
9671005
// 1.
9681006
// On each click while in Polygon mode
9691007
// record click series
@@ -1026,6 +1064,7 @@ export default {
10261064
// this.map.setView(event.latlng);
10271065
window.setTimeout(() => { newMarker.fire('click'); }, 500);
10281066
this.cancelAnnotation();
1067+
this.polygonEditingState.active = false;
10291068
} else {
10301069
const drawingLayer = this.drawnItems.getLayers();
10311070
const layer = drawingLayer[0];
@@ -1118,10 +1157,14 @@ export default {
11181157
);
11191158
const withinReach = Math.abs(distanceToStart) < 9 * (window.devicePixelRatio || 1);
11201159
1121-
this.updateTooltip(pos, `
1122-
Position: ${latlng} / ${pos}<br>
1123-
Distance: ${distanceToStart}<br>Within reach: ${withinReach}
1124-
`);
1160+
this.polygonEditingState.closable = this.polygonString.length > 1 ? withinReach : false;
1161+
1162+
// todo: detect invalid, e.g. self-intersecting geomtries and set flag
1163+
1164+
// this.updateTooltip(pos, `
1165+
// Position: ${latlng} / ${pos}<br>
1166+
// Distance: ${distanceToStart}<br>Within reach: ${withinReach}
1167+
// `);
11251168
this.updateGuideline(latlng);
11261169
}
11271170
}

vue/src/views/Workspace.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export default {
161161
this.$refs.map.setupMeta();
162162
this.$refs.map.setupMapbox();
163163
this.$refs.map.displayMapbox();
164+
document.title = `dføur – ${this.title}`;
164165
}
165166
},
166167

0 commit comments

Comments
 (0)