Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/wotwizard-ui
  • manutopik/wotwizard-ui
  • wellno1/wotwizard-ui
3 results
Show changes
<template>
<main class="container">
<NavigationLoader :isLoading="$apollo.queries.wwResult.loading" />
<transition name="fade">
<div class="alert alert-danger" v-if="error">{{ error }}</div>
</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>
<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>
</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">
<label class="form-check-label" for="forecastsByNames">
{{ $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">
<label class="form-check-label" for="forecastsByDates">
{{ $t('tri.pardate') }}
</label>
</div>
</div>
<div class="col-lg-8 m-auto">
<div v-if="display=='forecastsByNames'">
<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({ path: '/previsions/' + 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>{{ $d(new Date(date.date*1000), 'long') }} {{ $t('time.a') }} {{ $d(new Date(date.date*1000), 'hour') }}</div>
<div>{{ date.proba * 100 }} %</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div v-if="display=='forecastsByDates'">
<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">{{ $d(new Date(forecast.date*1000), 'long') }} {{ $t('time.a') }} {{ $d(new Date(forecast.date*1000), 'hour') }}</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="'/previsions/' + member.member.hash" v-for="member in forecast.forecasts" :key="member.member.uid">
<div>{{ member.member.uid }} <BadgeStatus :membre="member.member" /></div>
<div>{{ member.proba * 100 }} %</div>
</nuxt-link>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</transition>
</main>
</template>
<script>
import {NEWCOMERS} from '@/graphql/queries'
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
},
{
text: this.$t('previsions.title'),
to: '/previsions'
},
{
text: this.$t('futuremembers'),
active: true
}
],
error: null,
display: 'forecastsByNames'
}
},
// Fonctions locales
methods: {
save() {
localStorage.setItem('previsions', this.display)
}
},
apollo: {
wwResult : {
query: NEWCOMERS,
update (data) {
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({
member: member,
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({
date: forecasts[i].date,
after: forecasts[i].after,
proba: forecasts[i].proba
})
}
// On traite les forecasts par date
if (result['byDate'].filter(function(e) { return e.date === forecasts[i].date }).length == 0) {
result['byDate'].push({
date: forecasts[i].date,
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({
member: member,
after: forecasts[i].after,
proba: forecasts[i].proba
})
}
}
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']
}
},
error (err) {this.error = err.message}
}
},
nuxtI18n: {
paths: {
fr: '/previsions/futurs_membres',
en: '/forecasts/future_members',
es: '/pronosticos/futuros_miembros'
}
},
mounted () {
// Mise à jour du fil d'ariane au chargement
$nuxt.$emit('changeRoute',this.breadcrumb)
if (localStorage.previsions) {
this.display = localStorage.getItem('previsions')
}
}
}
</script>
<style lang="scss" scoped>
.list-group-item {
background: transparent;
&:hover {
background: rgba(0, 0, 255, 0.075);
color: var(--text-primary-color);
}
}
</style>
\ No newline at end of file
<template>
<main class="container">
<h2 class="text-center mb-5 font-weight-light">En préparation</h2>
<div class="alert alert-danger">En développement</div>
<NavigationLoader :isLoading="$apollo.queries.previsions.loading" />
<transition name="fade">
<div class="alert alert-danger" v-if="error">{{ error }}</div>
</transition>
<transition name="fade">
<div v-if="previsions">
{{ previsions }}
</div>
</transition>
</main>
</template>
<script>
import {PREVISIONS} from '@/graphql/queries'
export default {
data() {
return {
breadcrumb: [
{
text: this.$t('accueil'),
to: '/'
},
{
text: this.$t('previsions.title'),
active: true
}
],
display: 'forecastsByNames',
error: null
}
},
apollo: {
previsions : {
query: PREVISIONS,
update (data) {
return {
// now: data.now,
// sigQty: data.parameter.sigQty,
// certifs_dossiers: data.wwFile.certifs_dossiers
data
}
},
error (err) {this.error = err.message}
}
},
nuxtI18n: {
paths: {
fr: '/previsions',
en: '/forecasts',
es: '/pronosticos'
}
},
mounted () {
// Mise à jour du fil d'ariane au chargement
$nuxt.$emit('changeRoute',this.breadcrumb)
}
}
</script>
\ No newline at end of file
<template>
<main class="container">
<h2 class="text-center my-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>
<!-- <NavigationLoader :isLoading="$apollo.queries.myresponse.loading" /> -->
<!-- <transition name="fade">
<div class="alert alert-danger" v-if="error">{{ error }}</div>
</transition> -->
<!-- <transition name="fade">
<div class="result" v-if="myresponse">
<div class="row text-center">
<div class="col-lg-6">
{{ myresponse }}
</div>
</div>
</div>
</transition> -->
</main>
</template>
<script>
// Import your graphQL query
// import {MY_QUERY} from '@/graphql/queries.js'
export default {
data() {
// local variables
return {
breadcrumb: [
{
text: this.$t("accueil"),
to: "/"
},
{
// Translations are stored in ./i18n/locales folder
text: this.$t("mypage.mytitle"),
active: true
}
],
error: null,
myvar: "Hello World !"
}
},
// local functions. You can use :
// {{ myFunction() }} in template if a value is returned
// - this.myFunction everywhere in the page but not in arrows functions
// - @event="myFunction" on Vue eventHandlers
// methods: {
// myFunction() {
// }
// },
// For computed values. Use {{ myComputedValue }} in the template
// computed: {
// myComputedValue : function() {
// return this.var * 3
// }
// },
// apollo: {
// // Use {{ myresponse }} in the template. If update is omitted, this name should correspond to the Query Type !
// myresponse : {
// query: MY_QUERY,
// // Optional : this is for parametered queries
// // variables() {return {param1:value1,param2:value2}},
// // Optional : treat the response before display. If omitted, the query name must correspond to the Query Type !
// // update (data) {
// // return data
// // },
// error (err) {this.error = err.message}
// }
// },
// Route's i18n (Need to rebuild App)
nuxtI18n: {
paths: {
fr: "/mapage",
en: "/mypage",
es: "/mipagina"
}
},
mounted() {
// Update breadcrumb when the page is displayed
$nuxt.$emit("changeRoute", this.breadcrumb)
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this page only -->
<style lang="scss" scoped></style>
import Vue from "vue"
import Tooltip from "~/node_modules/bootstrap/js/dist/tooltip"
import Collapse from "~/node_modules/bootstrap/js/dist/collapse"
import Alert from "~/node_modules/bootstrap/js/dist/alert"
Vue.directive("tooltip-click", function (el, binding) {
let tooltip = new Tooltip(el, {
title: binding.value,
html: true,
trigger: "manual"
})
el.onclick = function () {
tooltip.show()
setTimeout(() => {
tooltip.hide()
}, 1000)
}
})
Vue.directive("tooltip", function (el, binding, vnode) {
if (binding.value.title != "") {
let tooltip = new Tooltip(el, {
title: binding.value.title,
html: true,
placement: binding.value.placement,
trigger: "hover"
})
// vnode.context.$nextTick(() => {
// var x = new MutationObserver(function (e) {
// if (e[0].removedNodes) tooltip.hide()
// })
// x.observe(el.parentNode, { childList: true })
// })
}
})
import Vue from "vue"
export default (context, inject) => {
let liste_favoris = localStorage.favourites
? JSON.parse(localStorage.favourites)
: []
let toggleFavourite = (uid, e) => {
e.stopPropagation()
if (!context.$favourites.list.includes(uid)) {
context.$favourites.list.push(uid)
} else {
context.$favourites.list = context.$favourites.list.filter(
(item) => item !== uid
)
}
localStorage.favourites = JSON.stringify(context.$favourites.list)
}
let addFavorisArray = (certs, e) => {
for (const cert in certs) {
toggleFavourite(certs[cert].uid, e)
}
}
let compileArrays = (allIO, actualIO) => {
let all = allIO.map(function (CertHist) {
return {
...CertHist.id,
dateout: CertHist.hist
.filter((CertEvent) => !CertEvent.in)
.reduce(
function (prev, current) {
return prev.block.utc0 > current.block.utc0 ? prev : current
},
{ block: { utc0: 0 } }
).block.utc0
}
})
all.forEach((certifier) => {
let isFound = false
for (const certif of actualIO) {
if (certifier.uid == certif.uid) {
isFound = true
break
}
}
if (!isFound && certifier.status != "REVOKED") {
actualIO.push({
__typename: "Certification",
expires_on: certifier.dateout,
...certifier,
expired: true
})
}
})
return actualIO
}
let fixColumns = () => {
let tables = document.querySelectorAll(".table-responsive table")
tables.forEach((table) => {
let colWidth = [...table.querySelectorAll("tbody tr:first-child td")].map(
function (el) {
return el.offsetWidth
}
)
table.querySelectorAll("thead tr th").forEach((el, i) => {
el.style.width = colWidth[i] - 0.5 + "px"
})
})
}
inject(
"favourites",
Vue.observable({
list: liste_favoris,
toggleFavourite: toggleFavourite,
addFavorisArray: addFavorisArray,
compileArrays: compileArrays,
fixColumns: fixColumns
})
)
}
import Vue from 'vue'
import Vue from "vue"
Vue.filter('dateStatus', (val) => {
const diff = val - (Date.now()/1000)
switch (true) {
case diff<0:
return 'danger'
case diff<2635200:
return 'warning'
case diff>=2635200:
return 'success'
}
})
\ No newline at end of file
export default ({ app }) => {
Vue.filter("dateStatus", (val) => {
if (val == 0) return "danger"
const diff = val - Date.now() / 1000
switch (true) {
case diff < 0:
return "danger"
case diff < 2635200:
return "warning"
case diff >= 2635200:
return "success"
}
})
}
import Vue from "vue"
let mixin = {
computed: {
getApolloClient() {
return localStorage.getItem("apollo-client") || "trentesaux"
}
}
}
Vue.mixin(mixin)
source diff could not be displayed: it is too large. Options to address this: view the blob.
static/favicon-96x96.png

5.47 KiB

static/favicon.ico

8.43 KiB

static/icon.png

8.54 KiB | W: 0px | H: 0px

static/icon.png

33.9 KiB | W: 0px | H: 0px

static/icon.png
static/icon.png
static/icon.png
static/icon.png
  • 2-up
  • Swipe
  • Onion skin
#!/bin/bash
# Color for echo
RED='\e[31m'
GREEN='\e[32m'
NC='\e[0m'
TMP_FILE=temp
KEY_FILE=keysUsed
# Get all used keys in Vue files
grep --include=\*.vue --exclude=\*template.vue -roE -e "\\\$(t|tc)\((\"|')([a-zA-Z.]*)(\"|')(, [a-zA-Z._]*){0,1}\)" . > $TMP_FILE
sed -i -e "s/'/\"/" $TMP_FILE
sed -i -e "s/'/\"/" $TMP_FILE
sed -i -E -e 's/\..*:\$(t|tc)\("([a-zA-Z.]*).*$/\2/' $TMP_FILE
# Remove duplicates keys
sort $TMP_FILE | uniq > $KEY_FILE
# Verify all i18n files
FILES="i18n/locales/*.json"
RETURN_CODE=0
for f in $FILES
do
echo -e "Processing ${GREEN}$f${NC} file..."
tmp=$(mktemp)
while read key; do
# Verify if key exists
jq -e ".$key" $f > /dev/null
status=$?
# If not, create it
if [ $status -ne 0 ]
then
echo -e "create ${RED}$key${NC} in file ${GREEN}$f${NC}"
value=$(jq -e ".$key" i18n/locales/fr.json)
if [ $value = "null" ]
then
filter=".$key = \"TO_TRANSLATE\""
else
filter=".$key = $value"
fi
jq --sort-keys "$filter" $f > "$tmp" && mv "$tmp" $f
RETURN_CODE=$((RETURN_CODE+1))
fi
done < $KEY_FILE
done
rm $KEY_FILE $TMP_FILE
# Return 0 if no key was created, or number of keys added
exit $RETURN_CODE
function openPage() {
browser.tabs.create({
url: "/fr/index.html"
});
}
browser.browserAction.onClicked.addListener(openPage);
{
"manifest_version": 2,
"name": "Wotwizard UI",
"description": "Le magicien de la toile de confiance",
"version": "2.5.2",
"homepage_url": "https://wotwizard.axiom-team.fr",
"browser_action": {
"browser_style": true,
"default_icon": "/_nuxt/icons/icon_64x64.0424c5.png",
"default_title": "Wotwizard UI"
},
"background": {
"scripts": ["/launch-web-ext.js"]
},
"icons": {
"64": "/_nuxt/icons/icon_64x64.0424c5.png",
"120": "/_nuxt/icons/icon_120x120.0424c5.png"
}
}