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

Add a star to favorites UID

parent d96ab668
No related branches found
No related tags found
No related merge requests found
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
"> ">
<th scope="row" class="py-1"> <th scope="row" class="py-1">
<div> <div>
<span v-if="$isFavourite(getNeighbor(certif).uid)">&nbsp;</span>
{{ getNeighbor(certif).uid }} {{ getNeighbor(certif).uid }}
<BadgeCertifStatus <BadgeCertifStatus
:limitDate="getNeighbor(certif).received_certifications.limit" :limitDate="getNeighbor(certif).received_certifications.limit"
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
:key="member.uid" :key="member.uid"
@click="redirect(member.hash)"> @click="redirect(member.hash)">
<th scope="row"> <th scope="row">
<span v-if="$isFavourite(member.uid)">&nbsp;</span>
{{ member.uid }} {{ member.uid }}
<BadgeCertifStatus <BadgeCertifStatus
:limitDate="member.received_certifications.limit" :limitDate="member.received_certifications.limit"
......
import i18n from './i18n' import i18n from "./i18n"
import webpack from 'webpack' import webpack from "webpack"
export default { export default {
// Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode // Disable server-side rendering: https://go.nuxtjs.dev/ssr-mode
ssr: false, ssr: false,
// Target: https://go.nuxtjs.dev/config-target // Target: https://go.nuxtjs.dev/config-target
target: 'static', target: "static",
// Global page headers: https://go.nuxtjs.dev/config-head // Global page headers: https://go.nuxtjs.dev/config-head
head: { head: {
title: 'wotwizard-ui', title: "wotwizard-ui",
meta: [ meta: [
{ charset: 'utf-8' }, { charset: "utf-8" },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: "viewport", content: "width=device-width, initial-scale=1" },
{ hid: 'description', name: 'description', content: '' }, { hid: "description", name: "description", content: "" },
{ name: 'format-detection', content: 'telephone=no' } { name: "format-detection", content: "telephone=no" }
], ],
link: [ link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } },
]
},
// Global CSS: https://go.nuxtjs.dev/config-css // Global CSS: https://go.nuxtjs.dev/config-css
css: [ css: ["@/assets/css/style.scss"],
'@/assets/css/style.scss'
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [
'~plugins/filters.js', "~plugins/functions.js",
'~plugins/bootstrap.js' "~plugins/filters.js",
], "~plugins/bootstrap.js"
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [ buildModules: [
// https://go.nuxtjs.dev/pwa // https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa' "@nuxtjs/pwa"
], ],
// Modules: https://go.nuxtjs.dev/config-modules // Modules: https://go.nuxtjs.dev/config-modules
modules: [ modules: [
// https://github.com/nuxt-community/apollo-module // https://github.com/nuxt-community/apollo-module
'@nuxtjs/apollo', "@nuxtjs/apollo",
// https://i18n.nuxtjs.org // https://i18n.nuxtjs.org
'@nuxtjs/i18n' "@nuxtjs/i18n"
], ],
i18n: { i18n: {
defaultLocale: 'fr', defaultLocale: "fr",
locales: [ locales: [
{ {
code: 'en', code: "en",
name: 'English' name: "English"
}, },
{ {
code: 'fr', code: "fr",
name: 'Français' name: "Français"
}, },
{ {
code: 'es', code: "es",
name: 'Español' name: "Español"
} }
], ],
detectBrowserLanguage: { detectBrowserLanguage: {
alwaysRedirect: true alwaysRedirect: true
}, },
vueI18n: i18n vueI18n: i18n
}, },
// PWA module configuration: https://go.nuxtjs.dev/pwa // PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: { pwa: {
manifest: { manifest: {
lang: 'fr' lang: "fr"
} }
}, },
apollo: { apollo: {
clientConfigs: { clientConfigs: {
default: '~/graphql/clients/coindufeu' default: "~/graphql/clients/coindufeu"
//you can setup multiple clients with arbitrary names //you can setup multiple clients with arbitrary names
//, myotherclient : '~/graphql/clients/otherclient' //, myotherclient : '~/graphql/clients/otherclient'
}, }
}, },
router: { router: {
linkExactActiveClass: 'active' linkExactActiveClass: "active"
}, },
// Build Configuration: https://go.nuxtjs.dev/config-build // Build Configuration: https://go.nuxtjs.dev/config-build
build: { build: {
plugins: [ plugins: [
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
$: "jquery" $: "jquery"
}) })
], ]
} }
} }
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
) )
"> ">
<th scope="row"> <th scope="row">
<span v-if="$isFavourite(forecast.member.uid)"
>&nbsp;</span
>
{{ forecast.member.uid }} {{ forecast.member.uid }}
<BadgeStatus :membre="forecast.member" /> <BadgeStatus :membre="forecast.member" />
</th> </th>
...@@ -114,6 +117,9 @@ ...@@ -114,6 +117,9 @@
v-for="member in forecast.forecasts" v-for="member in forecast.forecasts"
:key="member.member.uid"> :key="member.member.uid">
<div class="mr-3"> <div class="mr-3">
<span v-if="$isFavourite(member.member.uid)"
>&nbsp;</span
>
{{ member.member.uid }} {{ member.member.uid }}
<BadgeStatus :membre="member.member" /> <BadgeStatus :membre="member.member" />
</div> </div>
......
export default (context, inject) => {
const isFavourite = (uid) => {
if (!localStorage.favourites) {
return false
} else if (JSON.parse(localStorage.favourites).includes(uid)) {
return true
}
return false
}
inject("isFavourite", isFavourite)
// For Nuxt <= 2.12, also add 👇
// context.$hello = hello
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment