diff --git a/canapGEST/API/app/Http/Controllers/ApplicantsController.php b/canapGEST/API/app/Http/Controllers/ApplicantsController.php index 925c93f0736dbc9bbdba0a46a40407c661cac593..136fc232dd7d42ff5c5c9b5785a6e4478dd6f415 100644 --- a/canapGEST/API/app/Http/Controllers/ApplicantsController.php +++ b/canapGEST/API/app/Http/Controllers/ApplicantsController.php @@ -135,12 +135,14 @@ class ApplicantsController extends Controller if ($status_restricted) { $applicant = DB::table('applicant')->where('applicant_id', $id) ->join('position', 'applicant.fk_position', '=', 'position.position_id') + ->join('location', 'position.fk_location', '=', 'location.location_id') ->join('job', 'position.fk_job', '=', 'job.job_id') ->where('fk_status', 'Valide') ->first(); } else { $applicant = DB::table('applicant')->where('applicant_id', $id) ->join('position', 'applicant.fk_position', '=', 'position.position_id') + ->join('location', 'position.fk_location', '=', 'location.location_id') ->join('job', 'position.fk_job', '=', 'job.job_id') ->first(); } diff --git a/canapGEST/API/app/Http/Middleware/JwtMiddleware.php b/canapGEST/API/app/Http/Middleware/JwtMiddleware.php index 84c9519b94c6cb9523e4cbe2faa7771d7e64b8ee..c13ad5a6660f318fa1da08fdf6f72c98573fd5f0 100644 --- a/canapGEST/API/app/Http/Middleware/JwtMiddleware.php +++ b/canapGEST/API/app/Http/Middleware/JwtMiddleware.php @@ -12,21 +12,20 @@ class JwtMiddleware { $token = str_replace('Bearer ', '', $request->headers->get('Authorization')); - if (!$token) { + if ($token == 'null') { return response()->json([ - 'error' => 'Token not provided.' + 'error' => 'Connexion requise' ], 401); } try { $content = JWT::decode($token, env('JWT_SECRET'), ['HS256']); } catch (ExpiredException $e) { return response()->json([ - 'error' => 'Provided token is expired.' + 'error' => 'Session expirée' ], 400); } catch (Exception $e) { - echo $e; return response()->json([ - 'error' => 'An error while decoding token.' + 'error' => 'Error while decoding token' ], 400); } diff --git a/canapGEST/Documentation/journal_travail.xlsx b/canapGEST/Documentation/journal_travail.xlsx index 4d312e818ded9909c39aa150f2af0e92a8d82937..34ea2b333d6a8b8f46a5466bdfc5f948dd5941d6 100644 Binary files a/canapGEST/Documentation/journal_travail.xlsx and b/canapGEST/Documentation/journal_travail.xlsx differ diff --git a/canapGEST/Documentation/planification_etatActuel_NicolasCrausaz - Copy.xlsx b/canapGEST/Documentation/planification_etatActuel_NicolasCrausaz - Copy.xlsx index f557177100e3abe182d259c5599571df41822bda..7e729d69271f31d3bc4d28d7a7944c5bb913cd2e 100644 Binary files a/canapGEST/Documentation/planification_etatActuel_NicolasCrausaz - Copy.xlsx and b/canapGEST/Documentation/planification_etatActuel_NicolasCrausaz - Copy.xlsx differ diff --git a/canapGEST/Documentation/planification_initiale_NicolasCrausaz.xlsx b/canapGEST/Documentation/planification_initiale_NicolasCrausaz.xlsx index eb5ecb08db96e09526deea5bd94cc597b70b7a79..bfc2814c06e36bec7e43fd483b8e554e99c40b90 100644 Binary files a/canapGEST/Documentation/planification_initiale_NicolasCrausaz.xlsx and b/canapGEST/Documentation/planification_initiale_NicolasCrausaz.xlsx differ diff --git a/canapGEST/Site/src/assets/english_logo.png b/canapGEST/Site/src/assets/english_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..d82f4053a44fed9d84b5dbed408a2ee2cfa911bd Binary files /dev/null and b/canapGEST/Site/src/assets/english_logo.png differ diff --git a/canapGEST/Site/src/assets/french_logo.png b/canapGEST/Site/src/assets/french_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..bb0375939b4936a5b0214e9423d4958d6b8ab9ac Binary files /dev/null and b/canapGEST/Site/src/assets/french_logo.png differ diff --git a/canapGEST/Site/src/assets/german_logo.png b/canapGEST/Site/src/assets/german_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..74f06ffe1c0e4ea771cb070ad4ab67e4c4b56340 Binary files /dev/null and b/canapGEST/Site/src/assets/german_logo.png differ diff --git a/canapGEST/Site/src/assets/others_logo.png b/canapGEST/Site/src/assets/others_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..edf01b88eee71a4b57def5189fae8295ee806cfd Binary files /dev/null and b/canapGEST/Site/src/assets/others_logo.png differ diff --git a/canapGEST/Site/src/layouts/MainNavbar.vue b/canapGEST/Site/src/layouts/MainNavbar.vue index a851f9885a693f3bcc2493effe18caeba07140c4..011e2db94e0ea0759615ce9ce5bbfd76efa89063 100644 --- a/canapGEST/Site/src/layouts/MainNavbar.vue +++ b/canapGEST/Site/src/layouts/MainNavbar.vue @@ -4,8 +4,6 @@ <v-toolbar-title>Canap-Gest</v-toolbar-title> <v-spacer></v-spacer> <v-toolbar-items class="hidden-sm-and-down" v-if="!isLoged"> - <v-btn flat class="white--text">Link One</v-btn> - <v-btn flat class="white--text">Link Two</v-btn> <v-btn icon class="white--text"> <v-icon @click="login">account_circle</v-icon> </v-btn> @@ -38,7 +36,7 @@ export default { this.$store.dispatch('moduleUser/login') }, logout() { - this.$store.dispatch('moduleUser/logout') + this.$store.dispatch('moduleUser/logout', true) } }, } diff --git a/canapGEST/Site/src/plugins/axios.js b/canapGEST/Site/src/plugins/axios.js index f349ed6ea18f948ac0c86921c58bb58e8df49f1b..45e55721bf14487a7680d8c7fb7c342c93c14f54 100644 --- a/canapGEST/Site/src/plugins/axios.js +++ b/canapGEST/Site/src/plugins/axios.js @@ -9,10 +9,18 @@ const instance = axios.create({ instance.interceptors.response.use(function (response) { return response; }, function (error) { - // Affichage des erreurs (snackbar) - Object.values(error.response.data).forEach(errMsg => { - store.commit('moduleSnackbar/toggle', { open: true, message: errMsg[0], type: 'error' }, { root: true }) - }) + if (!error.response) { + store.commit('moduleSnackbar/toggle', { open: true, message: 'API non atteignable', type: 'warning' }, { root: true }) + } else if (error.response.status == 400 || error.response.status == 401) { + // Erreur de token + store.commit('moduleSnackbar/toggle', { open: true, message: error.response.data.error, type: 'warning' }, { root: true }) + store.dispatch('moduleUser/logout', false) + } else { + // Affichage des erreurs (snackbar) + Object.values(error.response.data).forEach(errMsg => { + store.commit('moduleSnackbar/toggle', { open: true, message: errMsg[0], type: 'error' }, { root: true }) + }) + } return Promise.reject(error) }) diff --git a/canapGEST/Site/src/store/modules/applications/actions.js b/canapGEST/Site/src/store/modules/applications/actions.js index b845c72a1444df1ca9279c5d8c5216fed98c41ae..0de92c7db3bbb7786e36489002fcbaea40c1059f 100644 --- a/canapGEST/Site/src/store/modules/applications/actions.js +++ b/canapGEST/Site/src/store/modules/applications/actions.js @@ -11,13 +11,16 @@ export function getApplications(context) { } export function getCurrentApplicationData(context, data) { - axios({ - method: 'get', - url: '/applicant/' + data.id - }) - .then(response => { - context.commit('setCurrentApplicationData', response.data.personal_data) + return new Promise((resolve) => { + axios({ + method: 'get', + url: '/applicant/' + data.id }) + .then(response => { + context.commit('setCurrentApplicationData', response.data) + resolve() + }) + }) } export function getCurrentApplicationComments(context, data) { diff --git a/canapGEST/Site/src/store/modules/user/actions.js b/canapGEST/Site/src/store/modules/user/actions.js index 803bc432da23898e22ea3918399dfbcf26904d20..508b0aa1249b50657289028167cd8b835cef6d57 100644 --- a/canapGEST/Site/src/store/modules/user/actions.js +++ b/canapGEST/Site/src/store/modules/user/actions.js @@ -16,9 +16,11 @@ export function login() { }) } -export function logout() { +export function logout(context, fullLogout) { localStorage.removeItem('stored_token'); - window.location = 'https://tequila.epfl.ch/logout' + if (fullLogout) { + window.location = 'https://tequila.epfl.ch/logout' + } } export function getUserData(context) { diff --git a/canapGEST/Site/src/store/modules/user/state.js b/canapGEST/Site/src/store/modules/user/state.js index 69bb063380418b646a3c07137cf0e370bd431c38..269c66cb0de3d840e66be5d4e8d654b1a1e8ae41 100644 --- a/canapGEST/Site/src/store/modules/user/state.js +++ b/canapGEST/Site/src/store/modules/user/state.js @@ -1,13 +1,13 @@ export default { userData: { tequila: { - firstname: String, - name: String, + firstname: '', + name: '', group: String, user: String, sciper: String }, - role: String, + role: '', permissions: [] }, permittedJobs: [] diff --git a/canapGEST/Site/src/views/ApplicationView.vue b/canapGEST/Site/src/views/ApplicationView.vue index 8c376fc6e2b5d40e0667961443ba42acc40d7fd5..7038b847600745ba80e0eb213822fc66a9c1f563 100644 --- a/canapGEST/Site/src/views/ApplicationView.vue +++ b/canapGEST/Site/src/views/ApplicationView.vue @@ -1,14 +1,20 @@ <template> <div id="application-view"> - <v-container fluid grid-list-sm> + <v-container fluid grid-list-sm v-if="loaded"> <v-layout row wrap> <v-flex d-flex xs12> <v-toolbar> <v-toolbar-title> Candidature (#{{$route.params.id}}) + <small>- le {{$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_application_date}}</small> </v-toolbar-title> <v-spacer></v-spacer> - <v-rating color="warning" background-color="warning" :value="ratingValue" v-if="!$store.getters['moduleUser/userIsResponsible']"></v-rating> + <v-rating + color="warning" + background-color="warning" + :value="ratingValue" + v-if="!$store.getters['moduleUser/userIsResponsible']" + ></v-rating> <v-divider class="mx-3" inset vertical></v-divider> <v-toolbar-items> <v-tooltip bottom> @@ -30,7 +36,7 @@ <v-tooltip bottom> <template v-slot:activator="{ on }"> <v-btn fab small v-on="on" @click="exportData"> - <v-icon>share</v-icon> + <v-icon>get_app</v-icon> </v-btn> </template> <span>Exporter (JSON)</span> @@ -39,19 +45,415 @@ </v-toolbar> </v-flex> <v-flex d-flex xs12 sm9> - <v-card> - <pre> - {{$store.state.moduleApplications.currentApplication.application_data}} - </pre> - </v-card> + <v-container grid-list-xl> + <v-alert + outline + :value="true" + type="info" + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_application_updated_date" + >Cette candidature à été modifiée par son propriétaire le {{$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_application_updated_date}}</v-alert> + <v-layout flex-child wrap> + <v-flex xs12 md5 d-flex> + <v-sheet class="d-flex"> + <v-card> + <v-card-title> + <h4>Données personnelles</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense> + <v-list-tile> + <v-list-tile-content> + <b>Nom, prénom</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_name }} + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_fsname }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Formation, lieu</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.job_full_value }}, + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.location_site }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Maturité</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + <span + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_maturity" + >✔</span> + <span v-else>✘</span> + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Adresse</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_address_street }}, + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_address_npa }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Email</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_mail }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Téléphones (privé, domicile)</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_personal_phone }}, + {{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_home_phone }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Date naissance, majeur</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_birthdate }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Majeur</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + <span + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_has_majority" + >✔</span> + <span v-else>✘</span> + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Numéro AVS</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_avs }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Nationalité</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_nationality }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Origine</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_origin }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Langues</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + <div> + <img + src="@/assets/french_logo.png" + alt="logo_french" + width="20" + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_speaks_french" + > + <img + src="@/assets/german_logo.png" + alt="logo_german" + width="20" + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_speaks_german" + > + <img + src="@/assets/english_logo.png" + alt="logo_english" + width="20" + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_speaks_english" + > + <img + src="@/assets/others_logo.png" + alt="logo_others" + width="20" + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_speaks_other" + > + </div> + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Fin de scolarité</b> + </v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_scolarity_end }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content> + <b>Déjà candidat ? (Année)</b> + </v-list-tile-content> + <v-list-tile-content class="align-end"> + <span + v-if="$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_already_applicant" + >✔ ({{$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_already_applicant_year }})</span> + <span v-else>✘</span> + </v-list-tile-content> + </v-list-tile> + </v-list> + </v-card> + </v-sheet> + </v-flex> + <v-flex xs12 md4 d-flex> + <v-sheet class="d-flex" color="grey lighten-3" height="500"> + <v-card> + <v-card-title> + <h4>Responsables</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense> + <v-subheader>Principal</v-subheader> + <v-list-tile> + <v-list-tile-content>Genre</v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_gender }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Nom, prénom</v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_name }}, + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_fsname }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Adresse</v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_street }}, + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_npa }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Téléphone</v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.responsibles.main.responsible_phone }}</v-list-tile-content> + </v-list-tile> + <v-divider></v-divider> + <v-subheader>Secondaire</v-subheader> + <v-list-tile> + <v-list-tile-content>Genre</v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_gender }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Nom, prénom</v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_name }}, + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_fsname }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Adresse</v-list-tile-content> + <v-list-tile-content class="align-end"> + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_street }}, + {{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_npa }} + </v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Téléphone</v-list-tile-content> + <v-list-tile-content + class="align-end" + >{{ $store.state.moduleApplications.currentApplication.application_data.responsibles.secondary.responsible_phone }}</v-list-tile-content> + </v-list-tile> + </v-list> + </v-card> + </v-sheet> + </v-flex> + <v-flex xs12 md4 d-flex> + <v-sheet class="d-flex" color="grey lighten-3" height="424"> + <v-card> + <v-card-title> + <h4>Scolarité</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense v-for="scolarity in $store.state.moduleApplications.currentApplication.application_data.scolarities" :key="scolarity.scolarity_id"> + <v-list-tile> + <v-list-tile-content>Calories:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Fat:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Carbs:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Protein:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Sodium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Calcium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Iron:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + </v-list> + <v-divider></v-divider> + </v-card> + </v-sheet> + </v-flex> + <v-flex xs12 md4 d-flex> + <v-sheet class="d-flex" color="grey lighten-3" height="200"> + <v-card> + <v-card-title> + <h4>Stages</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense> + <v-list-tile> + <v-list-tile-content>Calories:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Fat:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Carbs:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Protein:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Sodium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Calcium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Iron:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + </v-list> + </v-card> + </v-sheet> + </v-flex> + <v-flex xs12 md4 d-flex> + <v-sheet class="d-flex" color="grey lighten-3" height="424"> + <v-card> + <v-card-title> + <h4>Activités professionnelles</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense> + <v-list-tile> + <v-list-tile-content>Calories:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Fat:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Carbs:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Protein:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Sodium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Calcium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Iron:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + </v-list> + </v-card> + </v-sheet> + </v-flex> + <v-flex xs12 md4 d-flex> + <v-sheet class="d-flex" color="grey lighten-3" height="424"> + <v-card> + <v-card-title> + <h4>Annexes</h4> + </v-card-title> + <v-divider></v-divider> + <v-list dense> + <v-list-tile> + <v-list-tile-content>Calories:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Fat:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Carbs:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Protein:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Sodium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Calcium:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + <v-list-tile> + <v-list-tile-content>Iron:</v-list-tile-content> + <v-list-tile-content class="align-end">{{ }}</v-list-tile-content> + </v-list-tile> + </v-list> + </v-card> + </v-sheet> + </v-flex> + </v-layout> + </v-container> </v-flex> + <pre> + {{$store.state.moduleApplications.currentApplication.application_data}} + </pre> - <v-flex d-flex xs12 sm3> - {{$store.state.moduleApplications.currentApplication.comments}} - </v-flex> + <v-flex d-flex xs12 sm3>{{$store.state.moduleApplications.currentApplication.comments}}</v-flex> </v-layout> </v-container> - <!-- <v-card class="mx-auto" max-width="400"> + <!-- <v-card class="mx-auto" max-width="400"> <v-card dark flat> <v-btn absolute bottom color="pink" right fab> <v-icon>mdi-plus</v-icon> @@ -147,32 +549,36 @@ </v-timeline-item> </v-timeline> </v-card-text> - </v-card> --> + </v-card>--> </div> </template> <script> export default { name: 'application-view', - data () { + data() { return { + loaded: false } }, - created () { - this.$store.dispatch('moduleApplications/getCurrentApplicationData', {id: this.$route.params.id}) - this.$store.dispatch('moduleApplications/getCurrentApplicationComments', {id: this.$route.params.id}) - this.$store.dispatch('moduleApplications/getCurrentApplicationMarker', {id: this.$route.params.id}) + created() { + this.$store.dispatch('moduleApplications/getCurrentApplicationData', { id: this.$route.params.id }).then(() => this.loaded = true) + this.$store.dispatch('moduleApplications/getCurrentApplicationComments', { id: this.$route.params.id }) + this.$store.dispatch('moduleApplications/getCurrentApplicationMarker', { id: this.$route.params.id }) }, computed: { - ratingValue () { + ratingValue() { return this.$store.state.moduleApplications.currentApplication.marker ? this.$store.state.moduleApplications.currentApplication.marker.marker_value : null } }, methods: { - print () { window.print() }, - contact () { window.location.href = 'mailto:' + this.$store.state.moduleApplications.currentApplication.application_data.applicant_mail }, - exportData () {}, - rate () { + print() { window.print() }, + contact() { window.location.href = 'mailto:' + this.$store.state.moduleApplications.currentApplication.application_data.personal_data.applicant_mail }, + exportData() { }, + formatDate() { + + }, + rate() { } } }