1
0
forked from PGL/Clyde

added ProfilePicture handling

This commit is contained in:
Bartha Maxime 2024-04-21 17:07:15 +02:00
parent a79f23fed0
commit 76dcea186c
2 changed files with 14 additions and 2 deletions

View File

@ -39,13 +39,19 @@ async function modifiedResearch(){
researchList.value = await fetchResearches(researcher.value.id) researchList.value = await fetchResearches(researcher.value.id)
} }
function getPP(){
if(researcher.value.user.profilePictureUrl === null){
return "/Clyde.png"
}
return researcher.value.user.profilePictureUrl
}
</script> </script>
<template> <div class="body"><div id="main"> <template> <div class="body"><div id="main">
<ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent> <ResearchPostComponent :allResearcher="allResearcher" :researcher="researcher" :isOpen="isPostResearchOpened" @modal-close="isPostResearchOpened = false" @posted="modifiedResearch"></ResearchPostComponent>
<div id="profilePicture"> <div id="profilePicture">
<img src="/Clyde.png" /> <img :src=getPP() />
</div> </div>
<div id="researcherInfos"> <div id="researcherInfos">
<div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div> <div class="surrounded" v-if="!changing">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>

View File

@ -18,6 +18,12 @@ let chart;
const researcherId = window.location.href.split("=")[1] const researcherId = window.location.href.split("=")[1]
function getPP(){
if(researcher.value.user.profilePictureUrl === null){
return "/Clyde.png"
}
return researcher.value.user.profilePictureUrl
}
const researchList = ref(await fetchResearches(researcherId)); const researchList = ref(await fetchResearches(researcherId));
const researcher = ref(await fetchResearcher(researcherId)); const researcher = ref(await fetchResearcher(researcherId));
const stats = ref(await fetchStats(researcherId)) const stats = ref(await fetchStats(researcherId))
@ -73,7 +79,7 @@ function update(){
<template> <template>
<div id="main"> <div id="main">
<div id="profilePicture"> <div id="profilePicture">
<img src="/Clyde.png" /> <img :src=getPP() />
</div> </div>
<div id="researcherInfos"> <div id="researcherInfos">
<div class="surrounded">{{researcher.user.lastName}} {{researcher.user.firstName}}</div> <div class="surrounded">{{researcher.user.lastName}} {{researcher.user.firstName}}</div>