Skip to content

Commit eb008a0

Browse files
committed
Merge branch 'master' into develop/sprint3
2 parents d6ebdad + de12fab commit eb008a0

File tree

7 files changed

+39
-24
lines changed

7 files changed

+39
-24
lines changed

django/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ delete-gemeinden-django:
3333
$(DOCKER_EXEC) python3 manage.py shell --command="from gsmap.models import Municipality;Municipality.objects.all().delete()"
3434

3535
import-gemeinden-json:
36+
$(DOCKER_EXEC) mkdir -p $(dir ./tmp/)
3637
$(DOCKER_EXEC) curl -o ./tmp/gemeinden.geojson -Ls https://datahub.io/n0rdlicht/ch-municipalities/r/2.geojson
3738
$(DOCKER_EXEC) python3 manage.py import-municipality ./tmp/gemeinden.geojson
3839
$(DOCKER_EXEC) rm ./tmp/gemeinden.geojson

django/main/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from django.views.decorators.csrf import csrf_exempt
66

77
urlpatterns = [
8-
path('admin/', admin.site.urls),
8+
path('gmanage/', admin.site.urls),
99
path('graphql/', csrf_exempt(GraphQLView.as_view(graphiql=True))),
1010
]
1111

vue/public/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<head>
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
8-
7+
<meta name="viewport" content="width=device-width,initial-scale=1.0,
8+
minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no">
9+
<meta name="HandheldFriendly" content="true">
910
<link rel="apple-touch-icon" sizes="180x180" href="<%= BASE_URL %>apple-touch-icon.png">
1011
<link rel="icon" type="image/png" sizes="32x32" href="<%= BASE_URL %>favicon-32x32.png">
1112
<link rel="icon" type="image/png" sizes="16x16" href="<%= BASE_URL %>favicon-16x16.png">

vue/src/assets/styles/main.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
-webkit-tap-highlight-color: rgba(0,0,0,0);
77
}
88

9+
html {
10+
-webkit-text-size-adjust: none;
11+
touch-action: manipulation;
12+
}
13+
914
body {
1015
/* font-family: "Circular Pro", sans-serif; */
1116
font-family: "Open Sans", sans-serif;

vue/src/components/SnapshotList.vue

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
class="px-0">{{ $t('listtitle') }}
2121
</v-subheader>
2222

23-
<v-list-item v-for="snapshot in snapshotsFiltered" :key="snapshot.node.id"
23+
<v-list-item v-for="snapshot in snapshots" :key="snapshot.node.id"
2424
:to="'/' + $i18n.locale + '/' + snapshot.node.pk + '/'"
2525
class="px-2 mb-4" dense>
2626
<v-list-item-avatar tile size="64" class="my-2">
@@ -61,14 +61,7 @@ export default {
6161
},
6262
6363
props: {
64-
snapshots: Array,
65-
exclude: String
66-
},
67-
68-
computed: {
69-
snapshotsFiltered() {
70-
return this.snapshots.filter(snapshot => snapshot.pk !== this.exclude);
71-
}
64+
snapshots: Array
7265
}
7366
};
7467
</script>

vue/src/components/SnapshotMeta.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
<v-list-item-icon class="my-0 mr-2">
2121
<v-icon v-if="item.shape === 'circle'"
2222
:color="item.color"
23-
:style="{ fontSize: 1.6 * item.size + 'em', opacity: item.opacity}">mdi-circle</v-icon>
23+
:style="{ fontSize: 1.6 * item.size + 'em', opacity: item.opacity}">
24+
mdi-circle-outline</v-icon>
2425
<v-icon v-else-if="item.shape === 'square'"
2526
:color="item.color"
2627
:style="{ fontSize: 1.6 * item.size + 'em', opacity: item.opacity}">mdi-square</v-icon>

vue/src/views/Snapshot.vue

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
<i18n>
33
{
44
"de": {
5-
"calltoactionText": "Angebot für {municipalityText} einholen",
5+
"calltoactionText": "Angebot für Ihre Gemeinde einholen",
66
"hasSnapshot.title": "Datenverfügbarkeit",
77
"hasSnapshot.p1": "Für {municipalityText} stehen erste Daten zur Verfügung.",
8-
"hasSnapshot.p2": "Erkunden Sie unsere weiteren Fallbeispiele um ein besseres Bild der Anwendungs-möglichkeiten für Ihre Gemeinde zu erhalten.",
8+
"hasSnapshot.p2": "Erkunden Sie unsere weiteren Fallbeispiele um ein besseres Bild der Möglichkeiten für Ihre Gemeinde zu erhalten.",
99
"noSnapshot.title": "Datenverfügbarkeit",
1010
"noSnapshot.municipalityText": "diese Gemeinde",
1111
"noSnapshot.p1": "Für {municipalityText} stehen zur Zeit noch keine Daten zur Verfügung.",
1212
"noSnapshot.p2": "Erkunden Sie unsere Fallbeispiele um ein besseres Bild der Möglichkeiten für Ihre Gemeinde zu erhalten."
1313
},
1414
"fr": {
15-
"calltoactionText": "Veuillez recueillir l’offre pour votre commune",
15+
"calltoactionText": "Offre pour votre commune",
1616
"hasSnapshot.title": "Disponibilité des données",
17-
"hasSnapshot.p1": "Les premières données concernants {municipalityText} sont disponibles.",
17+
"hasSnapshot.p1": "Les premières données concernant {municipalityText} sont disponibles.",
1818
"hasSnapshot.p2": "Prenez compte de nos études pour une meilleure vue d’ensemble des possibilitiées qui s’offrent à votre commune.",
1919
"noSnapshot.title": "Disponibilité des données",
2020
"noSnapshot.municipalityText": "cette communauté",
@@ -64,7 +64,7 @@
6464
</div>
6565
</div>
6666

67-
<snapshot-list :snapshots="snapshotsExamples" :exclude="hash" />
67+
<snapshot-list :snapshots="snapshotsExamples" />
6868
</div>
6969

7070
<v-toolbar
@@ -82,7 +82,7 @@
8282
<v-content>
8383
<v-slide-x-reverse-transition>
8484
<v-btn fab absolute small
85-
style="top:1.2em; right:2em;"
85+
style="top:1.2em; right:1.3em;"
8686
color="primary"
8787
v-if="!snapshotnav"
8888
@click="snapshotnav=!snapshotnav">
@@ -162,6 +162,10 @@ body,
162162
opacity: 1;
163163
font-weight: 900;
164164
}
165+
166+
h4 {
167+
margin-bottom: 0.8em;
168+
}
165169
</style>
166170

167171
<script>
@@ -194,7 +198,7 @@ export default {
194198
legend: [],
195199
municipalityName: '',
196200
snapshotsExamples: [],
197-
snapshotnav: true,
201+
snapshotnav: this.getInitialSnapshotnav(),
198202
mapinfoopen: true
199203
};
200204
},
@@ -220,6 +224,16 @@ export default {
220224
},
221225
222226
methods: {
227+
getInitialSnapshotnav() {
228+
if (this.$route.params.hash) {
229+
console.log(this.$vuetify.breakpoint.name);
230+
if (this.$vuetify.breakpoint.name === 'lg') {
231+
return true;
232+
}
233+
return false;
234+
}
235+
return true;
236+
},
223237
async getSnapshot(hash) {
224238
const result = await this.$apollo.query({
225239
query: gql`query getsnapshot($hash: ID!) {
@@ -293,8 +307,8 @@ export default {
293307
this.geojson = result.data.municipality.perimeter;
294308
this.geobounds = result.data.municipality.perimeterBounds;
295309
this.snapshotsExamples = result.data.snapshots.edges;
296-
this.$store.commit('setBfsnumber', result.data.snapshot.bfsNumber);
297-
this.$store.commit('setBfsname', result.data.snapshot.fullname);
310+
this.$store.commit('setBfsnumber', result.data.municipality.bfsNumber);
311+
this.$store.commit('setBfsname', result.data.municipality.fullname);
298312
},
299313
300314
createFeatureLayer(geojson) {
@@ -353,9 +367,9 @@ export default {
353367
});
354368
} else if (this.bfsNumber) { // empty municipality
355369
this.geojson.coordinates.forEach((polygon) => {
356-
this.map.addLayer(L.polygon(polygon));
370+
this.map.addLayer(L.polygon(polygon, { color: '#543076' }));
357371
});
358-
this.map.addLayer(L.mapbox.styleLayer('mapbox://styles/gemeindescan/ck6qnoijj28od1is9u1wbb3vr'));
372+
this.map.addLayer(L.mapbox.styleLayer('mapbox://styles/gemeindescan/ck6rp249516tg1iqkmt48o4pz'));
359373
}
360374
L.control.scale({
361375
metric: true,

0 commit comments

Comments
 (0)