Skip to content

Commit

Permalink
Merge pull request #110 from Daniel-Alvarenga/main
Browse files Browse the repository at this point in the history
Add professor profile
  • Loading branch information
Daniel-Alvarenga authored Nov 25, 2024
2 parents 98d94fd + b08216b commit 0cec2ee
Show file tree
Hide file tree
Showing 19 changed files with 884 additions and 46 deletions.
138 changes: 138 additions & 0 deletions client/src/components/professor/AsideDashboard.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<template>
<aside :class="['aside-dashboard', view, { fixed: isFixed && view === 'yeah' }]">
<div>
<ul>
<li :class="getClassForPage('home')">
<router-link to="/empresa">
<img :src="icons.home">
<p v-if="showPs">Home</p>
</router-link>
</li>
<li :class="getClassForPage('message')">
<router-link to="/empresa/mensagens">
<img :src="icons.send" />
<p v-if="showPs">Mensagens</p>
</router-link>
</li>
<li :class="getClassForPage('estagios')">
<router-link to="/empresa/vagas">
<img :src="icons.formIcon" />
<p v-if="showPs">Atividades</p>
</router-link>
</li>
<li :class="getClassForPage('rankings')">
<router-link to="/empresa/ranking">
<img :src="icons.ranking" />
<p v-if="showPs">Rankings</p>
</router-link>
</li>
</ul>
</div>
<button @click="changePsVisualization">
<img :src="icons.angulo" alt="<">
</button>
</aside>
</template>

<script>
import { defineComponent } from 'vue';
import { useRouter } from 'vue-router';
// icons
import homeIcon from '../../assets/icons/casa.png';
import searchIcon from '../../assets/icons/procurar.png';
import linkIcon from '../../assets/icons/link.png';
import sendIcon from '../../assets/icons/aviao-de-papel.png';
import jobIcon from '../../assets/icons/estagio.png';
import rankingIcon from '../../assets/icons/trofeu.png';
import anguloIcon from '../../assets/icons/angulo.png';
import userIcon from '../../assets/icons/user.png';
import configIcon from '../../assets/icons/config.png';
import formIcon from '../../assets/icons/forma.png';
import tablesIcon from '../../assets/icons/grafico-horizontal-simples.png';
export default defineComponent({
name: 'AsideDashboard',
emits: ['close'],
props: {
pageName: {
type: String,
required: true
}
},
data() {
return {
icons: {
home: homeIcon,
search: searchIcon,
link: linkIcon,
send: sendIcon,
job: jobIcon,
ranking: rankingIcon,
angulo: anguloIcon,
user: userIcon,
config: configIcon,
form: formIcon,
table: tablesIcon
},
showPs: true,
view: 'yeah',
isFixed: false
}
},
methods: {
getClassForPage(pageLoad) {
return this.pageName === pageLoad ? "page" : "";
},
changePsVisualization() {
this.showPs = !this.showPs;
this.view = this.showPs ? 'yeah' : 'none';
localStorage.setItem('asideDashboardState', JSON.stringify({
showPs: this.showPs,
view: this.view
}));
this.updateFixedState();
},
loadStateFromStorage() {
const state = localStorage.getItem('asideDashboardState');
if (state) {
const parsedState = JSON.parse(state);
this.showPs = parsedState.showPs;
this.view = parsedState.view;
}
},
checkScreenWidth() {
if (window.innerWidth < 1000) {
this.showPs = false;
this.view = 'none';
this.updateFixedState();
} else {
this.isFixed = false;
if (this.showPs) {
this.view = 'yeah';
}
}
localStorage.setItem('asideDashboardState', JSON.stringify({
showPs: this.showPs,
view: this.view
}));
},
updateFixedState() {
this.isFixed = (this.view === 'yeah' && window.innerWidth < 1000);
}
},
mounted() {
this.loadStateFromStorage();
this.checkScreenWidth();
window.addEventListener('resize', this.checkScreenWidth);
},
beforeUnmount() {
window.removeEventListener('resize', this.checkScreenWidth);
}
});
</script>

<style lang="scss" scoped>
@import "../../scss/layouts/aluno/_asideDashboard.scss";
</style>
60 changes: 60 additions & 0 deletions client/src/services/api/professor.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,64 @@ export const sendMessage = async (infoMesssage, token) => {
} catch (error) {
return error.data;
}
}

export const getCurriculo = async (token) => {
try {
const response = await api.get('professor/curriculo', {
headers: {
authorization: `${token}`
}
});
return response;
} catch (error) {
return error.data;
}
}

export const updateCurriculo = async (curriculo, token) => {
try {
const response = await api.post('professor/curriculo/update', curriculo, {
headers: {
authorization: `${token}`
}
});
return response;
} catch (error) {
return error.response.data;
}
}

export const updateImage = async (file, token) => {
try {
const formData = new FormData();
formData.append('file', file);

const response = await api.post('professor/upload/image/profile', formData, {
headers: {
authorization: `${token}`,
'Content-Type': 'multipart/form-data'
}
});
return response;
} catch (error) {
return error.response.data;
}
}

export const updateBanner = async (file, token) => {
try {
const formData = new FormData();
formData.append('file', file);

const response = await api.post('professor/upload/image/banner', formData, {
headers: {
authorization: `${token}`,
'Content-Type': 'multipart/form-data'
}
});
return response;
} catch (error) {
return error.response.data;
}
}
7 changes: 6 additions & 1 deletion client/src/views/aluno/Ranking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
<section class="content">
<div class="box" id="box1">
<H1>Rankings</H1>
<<<<<<< HEAD
<h2>Ranking gerado a partir das notas dos alunos. O objetivo desse ranking é proporcionar competitividade e destacar os alunos para as empresas.</h2>

=======
<h2>Ranking gerados a partir das notas dos alunos. O objetivo desse ranking é proporcionar
competitividade e destacar os alunos para as empresas.</h2>

>>>>>>> 98d94fd9c72eb7e19323bc31ba76f488af0a0271
<div class="alunos">
<p class="info">Ranking geral:</p>

Expand All @@ -21,7 +26,7 @@
<img v-if="item.aluno.imagem != 'default'" :src="item.aluno.imagem" alt="Foto do aluno">
<img v-else src="../../assets/icons/artwork.png" alt="Foto padrão">
<p class="name">{{ item.aluno.nome }} - 3º DS</p>
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} pontos</p>
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} / {{ item.numeroNotas }}</p>
</router-link>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/views/empresa/Ranking.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<img v-if="item.aluno.imagem != 'default'" :src="item.aluno.imagem" alt="Foto do aluno">
<img v-else src="../../assets/icons/artwork.png" alt="Foto padrão">
<p class="name">{{ item.aluno.nome }} - 3º DS</p>
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} pontos</p>
<p class="pontos">{{ (item.rankingNota * 1000).toFixed(2) }} / {{ item.numeroNotas }}</p>
</router-link>
</div>
</div>
Expand Down
Loading

0 comments on commit 0cec2ee

Please sign in to comment.