Skip to content
Snippets Groups Projects
Commit 60234b64 authored by Pierre-Jean CHANCELLIER's avatar Pierre-Jean CHANCELLIER
Browse files

prettier configuration

parent 3dd357f8
No related branches found
No related tags found
No related merge requests found
......@@ -16,17 +16,43 @@
<div class="container">
<div class="row mt-3" v-if="idFromHash.status != 'REVOKED'">
<div class="col-sm-10 col-md-7 col-lg-5 mb-3 mx-auto">
<h3 class="h4 text-center" :class="{
'text-success' : ['NEWCOMER','MISSING'].includes(idFromHash.status) && idFromHash.received_certifications.certifications.length>=5,
'text-danger' : ['NEWCOMER','MISSING'].includes(idFromHash.status) && idFromHash.received_certifications.certifications.length<5,
}">{{ $t('certifications.recues') }} ({{ nbCertifs('received') }}<span v-if="nbCertifsPending('received') != 0">{{ '&nbsp;+&nbsp;' + nbCertifsPending('received') }}</span>)
<BadgeCertifStatus :limitDate="idFromHash.received_certifications.limit" :memberStatus="idFromHash.status" />
<h3
class="h4 text-center"
:class="{
'text-success':
['NEWCOMER', 'MISSING'].includes(idFromHash.status) &&
idFromHash.received_certifications.certifications.length >=
5,
'text-danger':
['NEWCOMER', 'MISSING'].includes(idFromHash.status) &&
idFromHash.received_certifications.certifications.length < 5
}">
{{ $t("certifications.recues") }} ({{ nbCertifs("received")
}}<span v-if="nbCertifsPending('received') != 0">{{
"&nbsp;+&nbsp;" + nbCertifsPending("received")
}}</span
>)
<BadgeCertifStatus
:limitDate="idFromHash.received_certifications.limit"
:memberStatus="idFromHash.status" />
</h3>
<CertifList :certifs="idFromHash.received_certifications.certifications" type="received" />
<CertifList
:certifs="idFromHash.received_certifications.certifications"
type="received" />
</div>
<div class="col-sm-10 col-md-7 col-lg-5 mx-auto" v-if="['MISSING','MEMBER'].includes(idFromHash.status)">
<h3 class="h4 text-center">{{ $t('certifications.envoyees') }} ({{nbCertifs('sent') }}<span v-if="nbCertifsPending('sent') != 0">{{ '&nbsp;+&nbsp;' + nbCertifsPending('sent') }}</span>)</h3>
<CertifList :certifs="idFromHash.sent_certifications" type="sent" />
<div
class="col-sm-10 col-md-7 col-lg-5 mx-auto"
v-if="['MISSING', 'MEMBER'].includes(idFromHash.status)">
<h3 class="h4 text-center">
{{ $t("certifications.envoyees") }} ({{ nbCertifs("sent")
}}<span v-if="nbCertifsPending('sent') != 0">{{
"&nbsp;+&nbsp;" + nbCertifsPending("sent")
}}</span
>)
</h3>
<CertifList
:certifs="idFromHash.sent_certifications"
type="sent" />
</div>
</div>
</div>
......@@ -37,7 +63,7 @@
<script>
import { SEARCH_MEMBER } from "@/graphql/queries"
import CertifStatus from '~/components/badge/CertifStatus.vue';
import CertifStatus from "~/components/badge/CertifStatus.vue"
export default {
components: { CertifStatus },
......@@ -45,48 +71,71 @@ export default {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
text: this.$t('membres'),
to: '/membres'
text: this.$t("membres"),
to: "/membres"
},
{
text: '',
text: "",
active: true
}
],
error: null
};
}
},
methods: {
nbCertifs(sens) {
return sens == "received" ? this.idFromHash.received_certifications.certifications.filter((el) => {return el.pending == false}).length : this.idFromHash.sent_certifications.filter((el) => {return el.pending == false}).length
return sens == "received"
? this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == false
}
).length
: this.idFromHash.sent_certifications.filter((el) => {
return el.pending == false
}).length
},
nbCertifsPending(sens) {
return sens == "received" ? this.idFromHash.received_certifications.certifications.filter((el) => {return el.pending == true}).length : this.idFromHash.sent_certifications.filter((el) => {return el.pending == true}).length
return sens == "received"
? this.idFromHash.received_certifications.certifications.filter(
(el) => {
return el.pending == true
}
).length
: this.idFromHash.sent_certifications.filter((el) => {
return el.pending == true
}).length
}
},
apollo: {
idFromHash: {
query: SEARCH_MEMBER,
variables() {return { hash: this.$route.params.hash }},
error (err) {this.error = err.message}
variables() {
return { hash: this.$route.params.hash }
},
error(err) {
this.error = err.message
}
}
},
nuxtI18n: {
paths: {
fr: '/membres/:hash',
en: '/members/:hash',
es: '/miembros/:hash'
fr: "/membres/:hash",
en: "/members/:hash",
es: "/miembros/:hash"
}
},
computed: {
classWarning() {
return {
'text-danger' : !this.idFromHash.received_certifications.limit,
'text-warning' : this.$options.filters.dateStatus(this.idFromHash.received_certifications.limit) == 'warning'
"text-danger": !this.idFromHash.received_certifications.limit,
"text-warning":
this.$options.filters.dateStatus(
this.idFromHash.received_certifications.limit
) == "warning"
}
}
},
......@@ -101,5 +150,5 @@ export default {
}
}
}
};
}
</script>
<template>
<main class="container">
<h2 class="text-center mb-5 font-weight-light">{{ $t('membres') }}</h2>
<h2 class="text-center mb-5 font-weight-light">{{ $t("membres") }}</h2>
<div class="row mb-4">
<div class="col-6 m-auto text-center">
<label for="rech" class="form-label">{{ $t('recherche.title') }}</label>
<input type="text" class="form-control" id="rech" aria-describedby="rechHelp" v-model="param" autocomplete="off" @keyup="save">
<small id="rechHelp" class="form-text text-muted">{{ $t('recherche.desc') }}</small>
<label for="rech" class="form-label">{{ $t("recherche.title") }}</label>
<input
type="text"
class="form-control"
id="rech"
aria-describedby="rechHelp"
v-model="param"
autocomplete="off"
@keyup="save" />
<small id="rechHelp" class="form-text text-muted">{{
$t("recherche.desc")
}}</small>
</div>
</div>
<NavigationLoader :isLoading="$apollo.queries.idSearch.loading" />
......@@ -13,7 +22,11 @@
<div class="alert alert-danger" v-if="error">{{ error }}</div>
</transition>
<transition name="fade">
<div class="row" v-if="idSearch && param.length>2 && !$apollo.queries.idSearch.loading">
<div
class="row"
v-if="
idSearch && param.length > 2 && !$apollo.queries.idSearch.loading
">
<div class="col-8 m-auto">
<MemberList :members="idSearch.ids" />
</div>
......@@ -23,50 +36,56 @@
</template>
<script>
import {SEARCH_MEMBERS} from '@/graphql/queries'
import { SEARCH_MEMBERS } from "@/graphql/queries"
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
text: this.$t('membres'),
text: this.$t("membres"),
active: true
}
],
param: '',
param: "",
error: null
}
},
methods: {
save() {
localStorage.setItem('search', this.param)
localStorage.setItem("search", this.param)
}
},
apollo: {
idSearch: {
query: SEARCH_MEMBERS,
variables() {return {hint:this.param}},
skip() {return this.param.length < 3},
error (err) {this.error = err.message}
variables() {
return { hint: this.param }
},
skip() {
return this.param.length < 3
},
error(err) {
this.error = err.message
}
}
},
nuxtI18n: {
paths: {
fr: '/membres',
en: '/members',
es: '/miembros'
fr: "/membres",
en: "/members",
es: "/miembros"
}
},
mounted() {
$nuxt.$emit('changeRoute',this.breadcrumb)
$nuxt.$emit("changeRoute", this.breadcrumb)
// Rechargement du input
if (localStorage.search) {
this.param = localStorage.getItem('search')
this.param = localStorage.getItem("search")
}
}
}
......
<template>
<main class="container">
<h2 class="text-center mb-5 font-weight-light">{{ $t('params.title') }}</h2>
<h2 class="text-center mb-5 font-weight-light">{{ $t("params.title") }}</h2>
<NavigationLoader :isLoading="$apollo.queries.allParameters.loading" />
<transition name="fade">
<div class="alert alert-danger" v-if="error">{{ error }}</div>
......@@ -9,17 +9,22 @@
<div class="table-responsive" v-if="allParameters">
<table class="table table-striped">
<thead>
<th>{{ $t('nom') }}</th>
<th class="d-none d-sm-table-cell">{{ $t('type') }}</th>
<th>{{ $t('valeur') }}</th>
<th class="d-none d-md-table-cell">{{ $t('description') }}</th>
<th>{{ $t("nom") }}</th>
<th class="d-none d-sm-table-cell">{{ $t("type") }}</th>
<th>{{ $t("valeur") }}</th>
<th class="d-none d-md-table-cell">{{ $t("description") }}</th>
</thead>
<tbody>
<tr v-for="param in allParameters" :key="param.name">
<th scope="row">{{ param.name }}</th>
<td scope="row" class="d-none d-sm-table-cell">{{ param.par_type }}</td>
<td scope="row" class="d-none d-sm-table-cell">
{{ param.par_type }}
</td>
<td scope="row">{{ param.value }}</td>
<td scope="row" class="d-none d-md-table-cell" v-html="$t('params.name.' + param.name)"></td>
<td
scope="row"
class="d-none d-md-table-cell"
v-html="$t('params.name.' + param.name)"></td>
</tr>
</tbody>
</table>
......@@ -29,18 +34,18 @@
</template>
<script>
import {PARAMS} from '@/graphql/queries.js'
import { PARAMS } from "@/graphql/queries.js"
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
text: this.$t('params.breadcrumb'),
text: this.$t("params.breadcrumb"),
active: true
}
],
......@@ -52,23 +57,29 @@ export default {
query: PARAMS,
update(data) {
return data.allParameters.sort((a, b) => {
if (a.name < b.name) {return -1;}
if (a.name > b.name) {return 1;}
return 0;
if (a.name < b.name) {
return -1
}
if (a.name > b.name) {
return 1
}
return 0
})
},
error (err) {this.error = err.message}
error(err) {
this.error = err.message
}
}
},
nuxtI18n: {
paths: {
fr: '/parametres',
en: '/parameters',
es: '/parametros'
fr: "/parametres",
en: "/parameters",
es: "/parametros"
}
},
mounted() {
$nuxt.$emit('changeRoute',this.breadcrumb)
$nuxt.$emit("changeRoute", this.breadcrumb)
}
}
</script>
......@@ -6,42 +6,92 @@
</transition>
<transition name="fade">
<div v-if="wwResult">
<h2 class="text-center mb-5 font-weight-light">{{ $t('previsions.title') }} <small><span class="badge badge-secondary">{{ $tc('previsions.dossiersattente', wwResult.dossiers_nb) }}</span></small></h2>
<h2 class="text-center mb-5 font-weight-light">
{{ $t("previsions.title") }}
<small
><span class="badge badge-secondary">{{
$tc("previsions.dossiersattente", wwResult.dossiers_nb)
}}</span></small
>
</h2>
<div class="alert alert-info" role="alert">
<ul class="list-unstyled m-0">
<li>{{ $tc('previsions.certificationsinternes', wwResult.certifs_nb) }}</li>
<li>{{ $tc('previsions.permutations', wwResult.permutations_nb) }}</li>
<li>
{{
$tc("previsions.certificationsinternes", wwResult.certifs_nb)
}}
</li>
<li>
{{ $tc("previsions.permutations", wwResult.permutations_nb) }}
</li>
</ul>
</div>
<div class="row">
<div class="col-12 text-center mb-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="forecastsByNames" value="forecastsByNames" checked v-model="display" @change="save">
<input
class="form-check-input"
type="radio"
id="forecastsByNames"
value="forecastsByNames"
checked
v-model="display"
@change="save" />
<label class="form-check-label" for="forecastsByNames">
{{ $t('tri.parmembres') }}
{{ $t("tri.parmembres") }}
</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="forecastsByDates" value="forecastsByDates" v-model="display" @change="save">
<input
class="form-check-input"
type="radio"
id="forecastsByDates"
value="forecastsByDates"
v-model="display"
@change="save" />
<label class="form-check-label" for="forecastsByDates">
{{ $t('tri.pardate') }}
{{ $t("tri.pardate") }}
</label>
</div>
</div>
<div class="col-lg-8 m-auto">
<div v-if="display == 'forecastsByNames'">
<h3>{{ $t('previsions.parmembre') }}</h3>
<h3>{{ $t("previsions.parmembre") }}</h3>
<div class="table-responsive">
<table class="table table-striped table-hover">
<tbody>
<tr v-for="forecast in wwResult.forecastsByNames" :key="forecast.member.uid" @click="$router.push(localePath({name:'membres-hash', params:{hash:forecast.member.hash}}))">
<tr
v-for="forecast in wwResult.forecastsByNames"
:key="forecast.member.uid"
@click="
$router.push(
localePath({
name: 'membres-hash',
params: { hash: forecast.member.hash }
})
)
">
<th scope="row">
{{ forecast.member.uid }}
<BadgeStatus :membre="forecast.member" />
</th>
<td class="p-0">
<div class="d-flex justify-content-between p-3" v-for="date in forecast.forecasts" :key="date.date">
<div class="forecast_date mr-3" v-if="date.date<9999999999">{{ $d(new Date(date.date*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(date.date*1000), 'hour').replace(" ", "&nbsp;") }}</div>
<div
class="d-flex justify-content-between p-3"
v-for="date in forecast.forecasts"
:key="date.date">
<div
class="forecast_date mr-3"
v-if="date.date < 9999999999">
{{ $d(new Date(date.date * 1000), "short") }}
{{ $t("time.a") }}
{{
$d(new Date(date.date * 1000), "hour").replace(
" ",
"&nbsp;"
)
}}
</div>
<div class="forecast_date mr-3" v-else>N/A</div>
<div>{{ Math.round(date.proba * 100) }}&nbsp;%</div>
</div>
......@@ -52,18 +102,36 @@
</div>
</div>
<div v-if="display == 'forecastsByDates'">
<h3>{{ $t('previsions.pardate') }}</h3>
<h3>{{ $t("previsions.pardate") }}</h3>
<div class="table-responsive">
<table class="table table-striped">
<tbody>
<tr v-for="forecast in wwResult.forecastsByDates" :key="forecast.date">
<th scope="row" class="forecast_date" v-if="forecast.date<9999999999">{{ $d(new Date(forecast.date*1000), 'short') }} {{ $t('time.a') }} {{ $d(new Date(forecast.date*1000), 'hour') }}</th>
<tr
v-for="forecast in wwResult.forecastsByDates"
:key="forecast.date">
<th
scope="row"
class="forecast_date"
v-if="forecast.date < 9999999999">
{{ $d(new Date(forecast.date * 1000), "short") }}
{{ $t("time.a") }}
{{ $d(new Date(forecast.date * 1000), "hour") }}
</th>
<th scope="row" class="forecast_date" v-else>N/A</th>
<td class="p-0">
<div class="list-group rounded-0">
<nuxt-link class="list-group-item list-group-item-action border-0 d-flex justify-content-between" :to="localePath('/membres/' + member.member.hash)" v-for="member in forecast.forecasts" :key="member.member.uid">
<div class="mr-3">{{ member.member.uid }} <BadgeStatus :membre="member.member" /></div>
<div>{{ Math.round(member.proba * 100) }}&nbsp;%</div>
<nuxt-link
class="list-group-item list-group-item-action border-0 d-flex justify-content-between"
:to="localePath('/membres/' + member.member.hash)"
v-for="member in forecast.forecasts"
:key="member.member.uid">
<div class="mr-3">
{{ member.member.uid }}
<BadgeStatus :membre="member.member" />
</div>
<div>
{{ Math.round(member.proba * 100) }}&nbsp;%
</div>
</nuxt-link>
</div>
</td>
......@@ -80,56 +148,66 @@
</template>
<script>
import {NEWCOMERS} from '@/graphql/queries'
import { NEWCOMERS } from "@/graphql/queries"
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
text: this.$t('previsions.title'),
to: '/previsions'
text: this.$t("previsions.title"),
to: "/previsions"
},
{
text: this.$t('futuremembers'),
text: this.$t("futuremembers"),
active: true
}
],
error: null,
display: 'forecastsByNames'
display: "forecastsByNames"
}
},
methods: {
save() {
localStorage.setItem('previsions', this.display)
localStorage.setItem("previsions", this.display)
}
},
apollo: {
wwResult: {
query: NEWCOMERS,
update(data) {
let result = {'byName':[],'byDate':[]}
let result = { byName: [], byDate: [] }
let forecasts = data.wwResult.forecastsByNames
for (let i = 0; i < forecasts.length; i++) {
let member = forecasts[i].member
// On traite les forecasts par nom
if (result['byName'].filter(function(e) { return e.member && e.member.uid === member.uid; }).length == 0) {
result['byName'].push({
if (
result["byName"].filter(function (e) {
return e.member && e.member.uid === member.uid
}).length == 0
) {
result["byName"].push({
member: member,
forecasts: [{
forecasts: [
{
date: forecasts[i].date,
after: forecasts[i].after,
proba: forecasts[i].proba
}]
}
]
})
} else {
result['byName'].filter(function(e) { return e.member && e.member.uid === member.uid; })[0].forecasts.push({
result["byName"]
.filter(function (e) {
return e.member && e.member.uid === member.uid
})[0]
.forecasts.push({
date: forecasts[i].date,
after: forecasts[i].after,
proba: forecasts[i].proba
......@@ -137,17 +215,27 @@ export default {
}
// On traite les forecasts par date
if (result['byDate'].filter(function(e) { return e.date === forecasts[i].date }).length == 0) {
result['byDate'].push({
if (
result["byDate"].filter(function (e) {
return e.date === forecasts[i].date
}).length == 0
) {
result["byDate"].push({
date: forecasts[i].date,
forecasts: [{
forecasts: [
{
member: member,
after: forecasts[i].after,
proba: forecasts[i].proba
}]
}
]
})
} else {
result['byDate'].filter(function(e) { return e.date === forecasts[i].date })[0].forecasts.push({
result["byDate"]
.filter(function (e) {
return e.date === forecasts[i].date
})[0]
.forecasts.push({
member: member,
after: forecasts[i].after,
proba: forecasts[i].proba
......@@ -155,30 +243,32 @@ export default {
}
}
result['byDate'].sort((a, b) => (a.date > b.date) ? 1 : -1)
result["byDate"].sort((a, b) => (a.date > b.date ? 1 : -1))
return {
permutations_nb: data.wwResult.permutations_nb,
dossiers_nb: data.wwResult.dossiers_nb,
certifs_nb: data.wwResult.certifs_nb,
forecastsByNames: result['byName'],
forecastsByDates: result['byDate']
forecastsByNames: result["byName"],
forecastsByDates: result["byDate"]
}
},
error (err) {this.error = err.message}
error(err) {
this.error = err.message
}
}
},
nuxtI18n: {
paths: {
fr: '/previsions/futurs_membres',
en: '/forecasts/future_members',
es: '/pronosticos/futuros_miembros'
fr: "/previsions/futurs_membres",
en: "/forecasts/future_members",
es: "/pronosticos/futuros_miembros"
}
},
mounted() {
$nuxt.$emit('changeRoute',this.breadcrumb)
$nuxt.$emit("changeRoute", this.breadcrumb)
if (localStorage.previsions) {
this.display = localStorage.getItem('previsions')
this.display = localStorage.getItem("previsions")
}
}
}
......
......@@ -15,22 +15,22 @@
</template>
<script>
import {PREVISIONS} from '@/graphql/queries'
import { PREVISIONS } from "@/graphql/queries"
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
text: this.$t('previsions.title'),
text: this.$t("previsions.title"),
active: true
}
],
display: 'forecastsByNames',
display: "forecastsByNames",
error: null
}
},
......@@ -45,19 +45,21 @@ export default {
data
}
},
error (err) {this.error = err.message}
error(err) {
this.error = err.message
}
}
},
nuxtI18n: {
paths: {
fr: '/previsions',
en: '/forecasts',
es: '/pronosticos'
fr: "/previsions",
en: "/forecasts",
es: "/pronosticos"
}
},
mounted() {
// Mise à jour du fil d'ariane au chargement
$nuxt.$emit('changeRoute',this.breadcrumb)
$nuxt.$emit("changeRoute", this.breadcrumb)
}
}
</script>
<template>
<main class="container">
<h2 class="text-center mb-5 font-weight-light">{{ myvar }}</h2>
<code>For internal links, use <NuxtLink :to="localePath('path/page')">My link</NuxtLink></code>
<p>Use <code>$t() and $d()</code> functions to translate strings and dates</p>
<code
>For internal links, use
<NuxtLink :to="localePath('path/page')">My link</NuxtLink></code
>
<p>
Use <code>$t() and $d()</code> functions to translate strings and dates
</p>
<!-- <NavigationLoader :isLoading="$apollo.queries.myresponse.loading" /> -->
<!-- <transition name="fade">
<div class="alert alert-danger" v-if="error">{{ error }}</div>
......@@ -29,12 +34,12 @@ export default {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
text: this.$t("accueil"),
to: "/"
},
{
// Translations are stored in ./i18n/locales folder
text: this.$t('mypage.mytitle'),
text: this.$t("mypage.mytitle"),
active: true
}
],
......@@ -74,19 +79,17 @@ export default {
// Route's i18n (Need to rebuild App)
nuxtI18n: {
paths: {
fr: '/mapage',
en: '/mypage',
es: '/mipagina'
fr: "/mapage",
en: "/mypage",
es: "/mipagina"
}
},
mounted() {
// Update breadcrumb when the page is displayed
$nuxt.$emit('changeRoute',this.breadcrumb)
$nuxt.$emit("changeRoute", this.breadcrumb)
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this page only -->
<style lang="scss" scoped>
</style>
\ No newline at end of file
<style lang="scss" scoped></style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment