|
|
|
@ -59,9 +59,17 @@
@@ -59,9 +59,17 @@
|
|
|
|
|
:label="$t('form.label.profileAvatar')" |
|
|
|
|
></v-text-field> |
|
|
|
|
|
|
|
|
|
<v-avatar v-if="hasImage" size="100"> |
|
|
|
|
<img |
|
|
|
|
class="img-preview" |
|
|
|
|
:alt="formData.display_name" |
|
|
|
|
:src="formData.avatar" |
|
|
|
|
/> |
|
|
|
|
</v-avatar> |
|
|
|
|
|
|
|
|
|
<client-only> |
|
|
|
|
<image-uploader |
|
|
|
|
:preview="true" |
|
|
|
|
:preview="false" |
|
|
|
|
:className="['fileinput', { 'fileinput--loaded': hasImage }]" |
|
|
|
|
capture="false" |
|
|
|
|
:debug="0" |
|
|
|
@ -117,11 +125,13 @@ export default {
@@ -117,11 +125,13 @@ export default {
|
|
|
|
|
return { |
|
|
|
|
hasImage: profile.avatar !== '', |
|
|
|
|
formData: { |
|
|
|
|
display_name: profile.display_name, |
|
|
|
|
first_name: profile.first_name, |
|
|
|
|
last_name: profile.last_name, |
|
|
|
|
mobilephone: profile.mobilephone, |
|
|
|
|
idnumber: profile.idnumber, |
|
|
|
|
faculty: profile.faculty.id, |
|
|
|
|
/* 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, |
|
|
|
|
}, |
|
|
|
|
form: new Form({ |
|
|
|
@ -162,12 +172,8 @@ export default {
@@ -162,12 +172,8 @@ export default {
|
|
|
|
|
], |
|
|
|
|
}, |
|
|
|
|
onResponse(response) { |
|
|
|
|
console.log(response) |
|
|
|
|
/* |
|
|
|
|
this.vm.$router.push( |
|
|
|
|
this.vm.localePath(`/researchStudies/${response.data.id}/`) |
|
|
|
|
) |
|
|
|
|
*/ |
|
|
|
|
/* TODO: Should reload the current page.... but then the form does not work anymore. Something with the state.... */ |
|
|
|
|
this.vm.$router.push(this.vm.localePath(`/researchStudies/`)) |
|
|
|
|
}, |
|
|
|
|
}), |
|
|
|
|
} |
|
|
|
|