diff --git a/canapGEST/API/app/Http/Controllers/MarkersController.php b/canapGEST/API/app/Http/Controllers/MarkersController.php index 78b49860a938bd233c660905ea53ab33ebbbc711..ee51d2f4f768ca665d6c5bdd2f4b916fd34d2abc 100644 --- a/canapGEST/API/app/Http/Controllers/MarkersController.php +++ b/canapGEST/API/app/Http/Controllers/MarkersController.php @@ -40,7 +40,8 @@ class MarkersController extends Controller public function getUserMarkerOnApplicant($id) { - return DB::table('marker')->where('fk_applicant_id', $id)->where('marker_owner_sciper', $this->user_sciper)->get(); + $marker = DB::table('marker')->where('fk_applicant_id', $id)->where('marker_owner_sciper', $this->user_sciper)->first(); + return ["marker" => $marker]; } public function create() diff --git a/canapGEST/API/routes/web.php b/canapGEST/API/routes/web.php index 7d81e73adfb27fca3754564bda599d46d200be88..55f172dc54947c40004a2381bfbf437e3d15c913 100644 --- a/canapGEST/API/routes/web.php +++ b/canapGEST/API/routes/web.php @@ -25,7 +25,7 @@ $router->group(['middleware' => 'jwt.auth'], function () use ($router) { // Markers // $router->get('api/applicant/{id:[0-9]+}/markers', 'MarkersController@getApplicantMarkers'); - $router->get('api/applicant/{id:[0-9]+}/usermarkers', 'MarkersController@getUserMarkerOnApplicant'); + $router->get('api/applicant/{id:[0-9]+}/marker', 'MarkersController@getUserMarkerOnApplicant'); $router->put('api/marker', 'MarkersController@create'); $router->patch('api/marker/{id:[0-9]+}', 'MarkersController@update'); $router->delete('api/marker/{id:[0-9]+}', 'MarkersController@delete'); diff --git a/canapGEST/Documentation/Rapport.docx b/canapGEST/Documentation/Rapport.docx index 52dc63f7290466b37c323febe4c3e4983607f1e9..e47079c1bb48495ae49b7e9adad9dd717ccab19d 100644 Binary files a/canapGEST/Documentation/Rapport.docx and b/canapGEST/Documentation/Rapport.docx differ diff --git a/canapGEST/Documentation/journal_travail.xlsx b/canapGEST/Documentation/journal_travail.xlsx index 015c9c445e7acde74f36f904c7d88068c7a440c3..809b8e99e2020c6b3edb7329eb2ab6adf065cb27 100644 Binary files a/canapGEST/Documentation/journal_travail.xlsx and b/canapGEST/Documentation/journal_travail.xlsx differ diff --git a/canapGEST/Site/src/assets/logo.png b/canapGEST/Site/src/assets/logo.png deleted file mode 100644 index f3d2503fc2a44b5053b0837ebea6e87a2d339a43..0000000000000000000000000000000000000000 Binary files a/canapGEST/Site/src/assets/logo.png and /dev/null differ diff --git a/canapGEST/Site/src/assets/logo.svg b/canapGEST/Site/src/assets/logo.svg deleted file mode 100644 index 145b6d13089c81fcb16f68ad8f976e389dcd77e3..0000000000000000000000000000000000000000 --- a/canapGEST/Site/src/assets/logo.svg +++ /dev/null @@ -1 +0,0 @@ -<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 87.5 100"><defs><style>.cls-1{fill:#1697f6;}.cls-2{fill:#7bc6ff;}.cls-3{fill:#1867c0;}.cls-4{fill:#aeddff;}</style></defs><title>Artboard 46</title><polyline class="cls-1" points="43.75 0 23.31 0 43.75 48.32"/><polygon class="cls-2" points="43.75 62.5 43.75 100 0 14.58 22.92 14.58 43.75 62.5"/><polyline class="cls-3" points="43.75 0 64.19 0 43.75 48.32"/><polygon class="cls-4" points="64.58 14.58 87.5 14.58 43.75 100 43.75 62.5 64.58 14.58"/></svg> diff --git a/canapGEST/Site/src/store/modules/applications/actions.js b/canapGEST/Site/src/store/modules/applications/actions.js index 15ff8137a117d8f62e495b6a16b54ffccab27465..b845c72a1444df1ca9279c5d8c5216fed98c41ae 100644 --- a/canapGEST/Site/src/store/modules/applications/actions.js +++ b/canapGEST/Site/src/store/modules/applications/actions.js @@ -10,6 +10,36 @@ 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) + }) +} + +export function getCurrentApplicationComments(context, data) { + axios({ + method: 'get', + url: '/applicant/' + data.id + '/comments' + }) + .then(response => { + context.commit('setCurrentApplicationComments', response.data) + }) +} + +export function getCurrentApplicationMarker(context, data) { + axios({ + method: 'get', + url: '/applicant/' + data.id + '/marker' + }) + .then(response => { + context.commit('setCurrentApplicationMarker', response.data.marker) + }) +} + export function getAvailableStatus(context) { axios({ method: 'get', diff --git a/canapGEST/Site/src/store/modules/applications/mutations.js b/canapGEST/Site/src/store/modules/applications/mutations.js index b164f4f92c97828ba9fcb9f9ec2edae3cadbb653..b8ce719ecafc9eb5c9767f1c15b3dc69dfb98759 100644 --- a/canapGEST/Site/src/store/modules/applications/mutations.js +++ b/canapGEST/Site/src/store/modules/applications/mutations.js @@ -2,6 +2,18 @@ export function setApplications (state, data) { state.applications = data } +export function setCurrentApplicationData (state, data) { + state.currentApplication.application_data = data +} + +export function setCurrentApplicationComments (state, data) { + state.currentApplication.comments = data +} + +export function setCurrentApplicationMarker (state, data) { + state.currentApplication.marker = data +} + export function setAvailableStatus (state, data) { state.available_status = data } diff --git a/canapGEST/Site/src/store/modules/applications/state.js b/canapGEST/Site/src/store/modules/applications/state.js index a3fe438bea7677172256bd21faf34c51c88d0e9e..5a9c8b101f6033e438f2558c2bc6b46db2685a9e 100644 --- a/canapGEST/Site/src/store/modules/applications/state.js +++ b/canapGEST/Site/src/store/modules/applications/state.js @@ -1,6 +1,10 @@ export default { applications: [], - currentApplication: {}, + currentApplication: { + application_data: {}, + comments: {}, + marker: {} + }, available_status: [], filters: { selectedJob: null, diff --git a/canapGEST/Site/src/views/ApplicationView.vue b/canapGEST/Site/src/views/ApplicationView.vue index 96e214924af6bf522ed69f28848c192054090668..8c376fc6e2b5d40e0667961443ba42acc40d7fd5 100644 --- a/canapGEST/Site/src/views/ApplicationView.vue +++ b/canapGEST/Site/src/views/ApplicationView.vue @@ -1,18 +1,53 @@ <template> <div id="application-view"> - <h1>Postulation id: {{$route.params.id}}</h1> <v-container fluid grid-list-sm> <v-layout row wrap> - <v-flex d-flex xs12 sm9> - <v-card color="red lighten-2" dark tile flat> - <v-card-text>teststs</v-card-text> + <v-flex d-flex xs12> + <v-toolbar> + <v-toolbar-title> + Candidature (#{{$route.params.id}}) + </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-divider class="mx-3" inset vertical></v-divider> + <v-toolbar-items> + <v-tooltip bottom> + <template v-slot:activator="{ on }"> + <v-btn fab small v-on="on" @click="print"> + <v-icon>print</v-icon> + </v-btn> + </template> + <span>Imprimer</span> + </v-tooltip> + <v-tooltip bottom> + <template v-slot:activator="{ on }"> + <v-btn fab small v-on="on" @click="contact"> + <v-icon>email</v-icon> + </v-btn> + </template> + <span>Contacter</span> + </v-tooltip> + <v-tooltip bottom> + <template v-slot:activator="{ on }"> + <v-btn fab small v-on="on" @click="exportData"> + <v-icon>share</v-icon> + </v-btn> + </template> + <span>Exporter (JSON)</span> + </v-tooltip> + </v-toolbar-items> + </v-toolbar> + </v-flex> + <v-flex d-flex xs12 sm9> + <v-card> + <pre> + {{$store.state.moduleApplications.currentApplication.application_data}} + </pre> </v-card> </v-flex> <v-flex d-flex xs12 sm3> - <v-card color="red lighten-2" dark tile flat> - <v-card-text>test</v-card-text> - </v-card> + {{$store.state.moduleApplications.currentApplication.comments}} </v-flex> </v-layout> </v-container> @@ -119,8 +154,26 @@ <script> export default { name: 'application-view', + data () { + return { + } + }, + 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}) + }, + computed: { + 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 () { + } + } } </script> - -<style> -</style>