Co-authored-by: dbroqua <contact@darkou.fr> Reviewed-on: #34
This commit is contained in:
parent
4886e9cc48
commit
9a088b9b5f
9 changed files with 28 additions and 1 deletions
|
@ -196,6 +196,7 @@ SECRET # Hash utilisé pour pour sauvegardé les dessions (par défaut waemaeMe5
|
||||||
DISCOGS_TOKEN # Token Discogs (vous devez créer un compte sur discogs afin d'en obtenir un gratuitement)
|
DISCOGS_TOKEN # Token Discogs (vous devez créer un compte sur discogs afin d'en obtenir un gratuitement)
|
||||||
FORMSPREE_ID # Id du formulaire formspree pour la page "nous-contacter"
|
FORMSPREE_ID # Id du formulaire formspree pour la page "nous-contacter"
|
||||||
MATOMO_URL # Url vers l'instance matomo (exemple: https://analytics.darkou.fr/)
|
MATOMO_URL # Url vers l'instance matomo (exemple: https://analytics.darkou.fr/)
|
||||||
|
SITE_NAME # Nom du site (utilisé dans le titre des pages)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Contributeurs
|
## Contributeurs
|
||||||
|
|
|
@ -26,6 +26,7 @@ services:
|
||||||
DISCOGS_TOKEN: ${DISCOGS_TOKEN}
|
DISCOGS_TOKEN: ${DISCOGS_TOKEN}
|
||||||
FORMSPREE_ID: ${FORMSPREE_ID}
|
FORMSPREE_ID: ${FORMSPREE_ID}
|
||||||
MATOMO_URL: ${MATOMO_URL}
|
MATOMO_URL: ${MATOMO_URL}
|
||||||
|
SITE_NAME: ${SITE_NAME}
|
||||||
networks:
|
networks:
|
||||||
- musictopus
|
- musictopus
|
||||||
musictopus-db:
|
musictopus-db:
|
||||||
|
|
|
@ -26,6 +26,7 @@ services:
|
||||||
DISCOGS_TOKEN: ${DISCOGS_TOKEN}
|
DISCOGS_TOKEN: ${DISCOGS_TOKEN}
|
||||||
FORMSPREE_ID: ${FORMSPREE_ID}
|
FORMSPREE_ID: ${FORMSPREE_ID}
|
||||||
MATOMO_URL: ${MATOMO_URL}
|
MATOMO_URL: ${MATOMO_URL}
|
||||||
|
SITE_NAME: ${SITE_NAME}
|
||||||
networks:
|
networks:
|
||||||
- musictopus
|
- musictopus
|
||||||
musictopus-db:
|
musictopus-db:
|
||||||
|
|
|
@ -6,4 +6,5 @@ module.exports = {
|
||||||
discogsToken: process.env.DISCOGS_TOKEN,
|
discogsToken: process.env.DISCOGS_TOKEN,
|
||||||
formspreeId: process.env.FORMSPREE_ID,
|
formspreeId: process.env.FORMSPREE_ID,
|
||||||
matomoUrl: process.env.MATOMO_URL || "",
|
matomoUrl: process.env.MATOMO_URL || "",
|
||||||
|
siteName: process.env.SITE_NAME || "MusicTopus",
|
||||||
};
|
};
|
||||||
|
|
|
@ -641,6 +641,7 @@ class Albums extends Pages {
|
||||||
|
|
||||||
this.setPageContent("artists", artists);
|
this.setPageContent("artists", artists);
|
||||||
this.setPageContent("formats", formats);
|
this.setPageContent("formats", formats);
|
||||||
|
this.setPageTitle("Ma collection");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -655,6 +656,9 @@ class Albums extends Pages {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.setPageContent("item", item);
|
this.setPageContent("item", item);
|
||||||
|
this.setPageTitle(
|
||||||
|
`Détails de l'album ${item.title} de ${item.artists_sort}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -676,6 +680,7 @@ class Albums extends Pages {
|
||||||
const formats = await Albums.getAllDistincts("formats.name", userId);
|
const formats = await Albums.getAllDistincts("formats.name", userId);
|
||||||
|
|
||||||
this.setPageContent("username", user.username);
|
this.setPageContent("username", user.username);
|
||||||
|
this.setPageTitle(`Collection publique de ${user.username}`);
|
||||||
this.setPageContent("artists", artists);
|
this.setPageContent("artists", artists);
|
||||||
this.setPageContent("formats", formats);
|
this.setPageContent("formats", formats);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,10 @@ class Pages {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setPageTitle(title) {
|
||||||
|
this.pageContent.page.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
setPageContent(field, value) {
|
setPageContent(field, value) {
|
||||||
this.pageContent.page[field] = value;
|
this.pageContent.page[field] = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,8 @@ router.route("/").get((req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "home");
|
const page = new Pages(req, "home");
|
||||||
|
|
||||||
|
page.setPageTitle("Présentation du projet");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
@ -26,6 +28,8 @@ router
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "connexion");
|
const page = new Pages(req, "connexion");
|
||||||
|
|
||||||
|
page.setPageTitle("Connexion");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
@ -61,6 +65,8 @@ router
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "inscription");
|
const page = new Pages(req, "inscription");
|
||||||
|
|
||||||
|
page.setPageTitle("Inscription");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
@ -82,6 +88,8 @@ router
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "ajouter-un-album");
|
const page = new Pages(req, "ajouter-un-album");
|
||||||
|
|
||||||
|
page.setPageTitle("Ajouter un album");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
@ -92,6 +100,8 @@ router.route("/nous-contacter").get(async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "nous-contacter");
|
const page = new Pages(req, "nous-contacter");
|
||||||
|
|
||||||
|
page.setPageTitle("Nous contacter");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
@ -102,6 +112,8 @@ router.route("/composants").get(async (req, res, next) => {
|
||||||
try {
|
try {
|
||||||
const page = new Pages(req, "composants");
|
const page = new Pages(req, "composants");
|
||||||
|
|
||||||
|
page.setPageTitle("Les composants");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
|
|
@ -30,6 +30,8 @@ router
|
||||||
try {
|
try {
|
||||||
const page = new Albums(req, "mon-compte/ma-collection/exporter");
|
const page = new Albums(req, "mon-compte/ma-collection/exporter");
|
||||||
|
|
||||||
|
page.setPageTitle("Exporter ma collection");
|
||||||
|
|
||||||
render(res, page);
|
render(res, page);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
next(err);
|
next(err);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title><% if (page.title) { %><%= page.title %> <% } else { %> DarKou - MusicTopus <% } %></title>
|
<title><%= config.siteName %> :: <%= page.title %></title>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
|
||||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||||
|
|
Loading…
Reference in a new issue