Skip to content

Commit b0461b3

Browse files
committed
Merge branch 'master' into stage
2 parents c3921d5 + 4b9709a commit b0461b3

File tree

6 files changed

+88
-51
lines changed

6 files changed

+88
-51
lines changed

vue/src/App.vue

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,31 @@ export default {
2323
return {};
2424
},
2525
26+
mounted() {
27+
this.setInitialSnapshotnav();
28+
},
29+
2630
computed: {
2731
selectedLayout() {
2832
if (this.$route && this.$route.hasOwnProperty('meta') && this.$route.meta.hasOwnProperty('layout')) {
2933
return this.$route.meta.layout;
3034
}
3135
return LayoutDefault;
3236
}
37+
},
38+
39+
methods: {
40+
setInitialSnapshotnav() {
41+
if (this.$route.params.hash) {
42+
if (['lg', 'xl'].includes(this.$vuetify.breakpoint.name)) {
43+
this.$store.commit('setSnapshotnav', false);
44+
} else {
45+
this.$store.commit('setSnapshotnav', true);
46+
}
47+
} else {
48+
this.$store.commit('setSnapshotnav', false);
49+
}
50+
}
3351
}
3452
};
3553
</script>

vue/src/assets/styles/main.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,22 @@ a {
6969
.content {
7070
max-width: 660px;
7171
}
72+
73+
/* SNAPSHOTS */
74+
75+
.snapshot-list-title {
76+
color:black;
77+
font-weight:700;
78+
}
79+
80+
81+
#snapshotnav {
82+
height: calc(100vh - var(--vh-offset, 0px)) !important;
83+
z-index: 9999; /* must be above mapbox interface */
84+
}
85+
86+
#snapshotnavContent {
87+
padding-bottom: 6em;
88+
}
89+
90+
/* SNAPSHOTS END */

vue/src/components/SnapshotList.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
<v-list class="snapshotlist"
1414
three-line>
1515

16-
<v-subheader
17-
v-if="snapshots.length != 0 && title"
18-
style="color:black;font-weight:700;"
19-
class="px-0">{{ title }}
20-
</v-subheader>
21-
2216
<v-list-item class="px-2 mb-4" dense
2317
v-for="snapshot in snapshots" :key="snapshot.id"
2418
:to="createRouteLink(snapshot.pk)">
@@ -64,11 +58,7 @@ export default {
6458
type: String,
6559
default: ''
6660
},
67-
snapshots: Array,
68-
title: {
69-
type: String,
70-
default: ''
71-
}
61+
snapshots: Array
7262
},
7363
7464
methods: {

vue/src/components/SnapshotMap.vue

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@ body,
5454
height: calc(100vh - var(--vh-offset, 0px));
5555
}
5656
57-
#snapshotnav {
58-
height: calc(100vh - var(--vh-offset, 0px)) !important;
59-
z-index: 9999; /* must be above mapbox interface */
60-
}
61-
62-
#snapshotnavContent {
63-
padding-bottom: 6em;
64-
}
65-
6657
#map {
6758
position: relative;
6859
width: 100%;
@@ -109,8 +100,7 @@ export default {
109100
legend: [],
110101
sources: [],
111102
layers: [],
112-
geobounds: [],
113-
snapshotnav: this.$store.snapshotnav
103+
geobounds: []
114104
};
115105
},
116106
@@ -120,7 +110,6 @@ export default {
120110
},
121111
122112
created() {
123-
this.setInitialSnapshotnav();
124113
this.geobounds = this.geoboundsIn;
125114
},
126115
@@ -134,20 +123,19 @@ export default {
134123
case 'xs': return '280px';
135124
default: return '320px';
136125
}
126+
},
127+
128+
snapshotnav: {
129+
get() {
130+
return this.$store.state.snapshotnav;
131+
},
132+
set(val) {
133+
this.$store.commit('setSnapshotnav', val);
134+
}
137135
}
138136
},
139137
140138
methods: {
141-
setInitialSnapshotnav() {
142-
if (this.$route.params.hash) {
143-
if (['lg', 'xl'].includes(this.$vuetify.breakpoint.name)) {
144-
this.$store.commit('setSnapshotnav', true);
145-
}
146-
this.$store.commit('setSnapshotnav', false);
147-
}
148-
this.$store.commit('setSnapshotnav', true);
149-
},
150-
151139
createFeatureLayer(geojson, attribution) {
152140
const geoJsonExtended = L.geoJson(geojson, {
153141
attribution,

vue/src/views/Snapshot.vue

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
id="snapshotnav"
3737
clipped="clipped"
3838
app
39-
width="320">
39+
width="320"
40+
v-model="snapshotnav">
4041
<router-link id="logo" :to="'/' + $i18n.locale + '/'" class="px-4 py-1 d-block">
4142
<img alt="gemeindescan logo" height="50" src="@/assets/images/gemeindescan-logo.svg">
4243
</router-link>
@@ -47,34 +48,33 @@
4748
<search :dense="true" :term="municipalityName"/>
4849

4950
<div class="nodata pb-8">
50-
<div v-if="hash" class="smaller hint">
51-
<h4>{{ $t('hasSnapshot.title') }}</h4>
52-
<p>{{ $t('hasSnapshot.p1', { municipalityText: municipalityText }) }}</p>
53-
<p>{{ $t('hasSnapshot.p2') }}</p>
54-
</div>
55-
<div v-else class="smaller hint">
51+
<div v-if="!hash" class="smaller hint">
5652
<h4>{{ $t('noSnapshot.title') }}</h4>
5753
<p>{{ $t('noSnapshot.p1', { municipalityText: municipalityText }) }}</p>
5854
<p>{{ $t('noSnapshot.p2') }}</p>
5955
</div>
60-
<div class="useractions">
61-
<v-btn small block outlined color="primary">
62-
<router-link key="signup" :to="'/' + $i18n.locale + '/signup/'">
63-
{{ $t('calltoactionText', { municipalityText: municipalityText }) }}
64-
</router-link>
65-
</v-btn>
66-
</div>
6756

6857
<snapshot-list
6958
v-if="snapshotsMunicipality"
7059
:snapshots="snapshotsMunicipality"
7160
/>
7261
</div>
7362

63+
<v-subheader
64+
class="px-0 snapshot-list-title">{{ listtitleText }}
65+
</v-subheader>
66+
67+
<div class="useractions">
68+
<v-btn small block outlined color="primary">
69+
<router-link key="signup" :to="'/' + $i18n.locale + '/signup/'">
70+
{{ $t('calltoactionText', { municipalityText: municipalityText }) }}
71+
</router-link>
72+
</v-btn>
73+
</div>
74+
7475
<snapshot-list
7576
v-if="snapshotsExamples"
7677
:snapshots="snapshotsExamples"
77-
:title="listtitleText"
7878
/>
7979
</div>
8080

@@ -169,6 +169,15 @@ export default {
169169
return this.$t('listtitleMore');
170170
}
171171
return this.$t('listtitle');
172+
},
173+
174+
snapshotnav: {
175+
get() {
176+
return this.$store.state.snapshotnav;
177+
},
178+
set(val) {
179+
this.$store.commit('setSnapshotnav', val);
180+
}
172181
}
173182
},
174183

vue/src/views/Workspace.vue

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@
1616
id="snapshotnav"
1717
clipped="clipped"
1818
app
19-
width="320">
19+
width="320"
20+
v-model="snapshotnav">
2021
<router-link id="logo" :to="'/' + $i18n.locale + '/'" class="px-4 py-1 d-block">
2122
<img alt="gemeindescan logo" height="50" src="@/assets/images/gemeindescan-logo.svg">
2223
</router-link>
2324

2425
<v-divider />
2526

2627
<div id="snapshotnavContent" class="ma-4">
27-
<search :dense="true" :term="municipalityName"/>
2828

2929
<div class="nodata pb-8">
3030
<div class="smaller hint">
3131
<h4>{{ title }}</h4>
32-
<p>{{ description }}</p>
32+
<p class="show-linebreaks">{{ description }}</p>
3333
</div>
3434
</div>
3535

@@ -70,6 +70,10 @@
7070
font-weight: 900;
7171
}
7272
73+
.show-linebreaks {
74+
white-space: pre-wrap;
75+
}
76+
7377
h4 {
7478
margin-bottom: 0.8em;
7579
}
@@ -113,6 +117,15 @@ export default {
113117
return this.$route.params.municipality;
114118
}
115119
return null;
120+
},
121+
122+
snapshotnav: {
123+
get() {
124+
return this.$store.state.snapshotnav;
125+
},
126+
set(val) {
127+
this.$store.commit('setSnapshotnav', val);
128+
}
116129
}
117130
},
118131

0 commit comments

Comments
 (0)