Browse Source

Small fixes

master
Joshua Rubingh 4 months ago
parent
commit
c56b88e6d1
  1. 26
      layouts/error.vue
  2. 6
      locales/en.js
  3. 7
      locales/nl.js
  4. 14
      pages/profile/edit.vue

26
layouts/error.vue

@ -1,15 +1,22 @@ @@ -1,15 +1,22 @@
<template>
<v-app dark>
<h1 v-if="error.statusCode === 404">
<!-- <v-app dark> -->
<v-card>
<ui-rug-card-title v-if="error.statusCode === 404">
{{ pageNotFound }}
</h1>
<h1 v-else>
</ui-rug-card-title>
<ui-rug-card-title v-else>
{{ otherError }}
</h1>
</ui-rug-card-title>
<v-card-text class="d-flex flex-row mb-6 mt-6" style="width: 100%">
<div style="width: 100%">
<NuxtLink :to="localePath('/')">
{{ $t('link.home') }}
{{ $t('error.back_home') }}
</NuxtLink>
</v-app>
</div>
</v-card-text>
</v-card>
<!-- </v-app> -->
</template>
<script>
@ -22,9 +29,10 @@ export default { @@ -22,9 +29,10 @@ export default {
}
},
data () {
const $t = this.$t.bind(this)
return {
pageNotFound: '404 Not Found',
otherError: 'An error occurred'
pageNotFound: $t('error.page_not_found'),
otherError: $t('error.other_http'),
}
},
head () {

6
locales/en.js

@ -227,4 +227,10 @@ export default { @@ -227,4 +227,10 @@ export default {
label: 'Select language'
}
},
error: {
page_not_found: 'Page not found (404)',
other_http: 'Server returned an error',
back_home: 'Return back to main page'
}
}

7
locales/nl.js

@ -196,7 +196,7 @@ export default { @@ -196,7 +196,7 @@ export default {
label: 'Achternaam'
},
email_address: {
label: 'Emailadrs'
label: 'Emailadres'
},
role: {
label: 'Rol'
@ -219,4 +219,9 @@ export default { @@ -219,4 +219,9 @@ export default {
label: 'Kies taal'
}
},
error: {
page_not_found: 'Pagina niet gevonden (404)',
other_http: 'De server stuurde en onbekende error terug',
back_home: 'Ga terug naar hoofdpagina'
}
}

14
pages/profile/edit.vue

@ -119,11 +119,15 @@ export default { @@ -119,11 +119,15 @@ export default {
async asyncData({ store }) {
await store.dispatch('researchers/getMe')
const me = store.getters['researchers/getMe']
await store.dispatch('universities/getFaculties', {
universityId: me.university.id,
})
if (me.university ) {
await store.dispatch('universities/getFaculties', {
universityId: me.university.id
})
}
return {
faculties: store.getters['universities/getFaculties'],
faculties: store.getters['universities/getFaculties'],
}
},
data() {
@ -136,7 +140,7 @@ export default { @@ -136,7 +140,7 @@ export default {
last_name: profile.last_name,
mobilephone: profile.mobilephone,
idnumber: profile.idnumber,
faculty: profile.faculty.id,
faculty: profile.faculty ? profile.faculty.id : null,
/* TODO: The API should provide the full url, or we should have a setting for specifying the full media url (CDN caching) */
avatar: profile.avatar,
},

Loading…
Cancel
Save