Compare commits

..

13 commits

Author SHA1 Message Date
hackish
84c511cdcf merge branch 'castro' into castro_dec2023 2023-12-06 11:22:23 -08:00
hackish
45cf91fd30 Merge branch 'castro' into castro_dec2023 2023-12-06 11:13:45 -08:00
hackish
1a1405703c Merge branch 'castro' into castro_dec2023 2023-12-06 11:09:59 -08:00
hackish
5c53d6a5d9 Remove guests from wishlist view 2023-12-06 11:09:47 -08:00
hackish
ccfae13cf7 Merge branch 'castro' into castro_dec2023 2023-12-06 11:04:03 -08:00
hackish
faf53708ac Merge master into castro 2023-12-06 10:48:14 -08:00
Christopher Blake
68c5ac15f4
update link for supported site issues (#104) 2023-12-05 12:33:57 -05:00
RonnyAL
d9770292df
Added Norwegian (bokmål) translations (#108) 2023-12-05 12:04:50 -05:00
Christopher Blake
34667b28d1
feat: strikeout pledged items (#107)
* strikeout pledged items

* strikethrough in legacy card mode

* added by user fix in card view

* add strike through for non url items

* make wishlish name language specific

* only strike when not your list
2023-12-05 11:57:22 -05:00
Frostyfrog
84961b11f7
Cleanup "bad" cookies (#102)
* fix: Move cookie-parser to app layer

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

* fix: remove cookies that shouldn't be set

Not quite sure if it's possible to check the path of a cookie, but
either way, we should remove old "bad" cookies that are set in people's
browsers. This cleanup code should assist in that work.

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

---------

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>
2023-11-25 21:40:10 -05:00
Frostyfrog
d633e90874
Avoid saving product data if nothing was returned (#101)
* fix: Check if productData is set first

Throughout my testing and debugging, it was possible for productData to
be "undefined". To prevent errors, it's best to check for it's existence
first.

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

* fix: avoid saving wishlist when there's no change

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

---------

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>
2023-11-25 21:37:15 -05:00
Frostyfrog
b3146d339f
Update node.js (#100)
* feat: Update node from 15 to 20

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

* docs: Add note about walmart and their 18MB headers

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>

---------

Signed-off-by: Colton Wolkins (Laptop) <colton@indicio.tech>
2023-11-25 14:18:07 -05:00
toastie89
8219b9a0f3
Added GUEST_PASSWORD to README (#80)
* Added GUEST_PASSWORD to README

* comment out and reject default value

---------

Co-authored-by: Wingy <git@wingysam.xyz>
2023-10-05 10:30:10 -04:00
17 changed files with 263 additions and 28 deletions

View file

@ -1,4 +1,4 @@
FROM node:15-alpine FROM node:20-alpine
RUN apk --no-cache add curl RUN apk --no-cache add curl

View file

@ -49,6 +49,10 @@ services:
# (for weddings, birthdays, etc. only the admin account's list is accessible) # (for weddings, birthdays, etc. only the admin account's list is accessible)
# Set to 'true' to enable # Set to 'true' to enable
SINGLE_LIST: 'false' SINGLE_LIST: 'false'
# Some websites (like walmart) send headers that are larger than 8MB in
# length. If issues are encountered, set the node.js limit to a higher
# number than 8192
#NODE_OPTIONS: "--max-http-header-size=32768"
restart: always restart: always
``` ```
@ -93,6 +97,9 @@ UPDATE_CHECK=true
PFP=true PFP=true
# Language of the interface, options listed in `languages` directory # Language of the interface, options listed in `languages` directory
LANGUAGE=en-US LANGUAGE=en-US
# Password to enter guest mode,
# e.g. https://wishes.example.com?pw=ReplaceWithYourGuestPassword
# GUEST_PASSWORD=ReplaceWithYourGuestPassword
## Wishlist Settings ## Wishlist Settings
# Set to true to not allow users to have their own lists. You may want this for a birthday or wedding. # Set to true to not allow users to have their own lists. You may want this for a birthday or wedding.

View file

@ -25,3 +25,7 @@ module.exports = {
} }
if (module.exports.guestPassword) module.exports.wishlist.public = false if (module.exports.guestPassword) module.exports.wishlist.public = false
if (module.exports.guestPassword === 'ReplaceWithYourGuestPassword') {
console.error('Error: Guest password should be changed from default.')
process.exit(1)
}

View file

@ -98,6 +98,7 @@ app.use((req, res, next) => {
}) })
app.use(require('body-parser').urlencoded({ extended: true })) app.use(require('body-parser').urlencoded({ extended: true }))
app.use(require('cookie-parser')());
app.use(session({ app.use(session({
secret: config.secret, secret: config.secret,
resave: false, resave: false,
@ -108,6 +109,16 @@ app.use(session({
}, },
name: 'christmas_community.connect.sid' name: 'christmas_community.connect.sid'
})) }))
app.use((req, res, next) => {
let basepath = req.path.substring(0, req.path.lastIndexOf("/"));
// Clear cookies for paths that are not the base path. See #17
if(basepath.length > config.base.length) {
res.clearCookie('christmas_community.connect.sid', {path: req.path});
res.clearCookie('christmas_community.connect.sid', {path: basepath});
}
next();
});
app.use(flash()) app.use(flash())
app.use(passport.initialize()) app.use(passport.initialize())
app.use(passport.session()) app.use(passport.session())

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'Martin', SETUP_USERNAME_PLACEHOLDER: 'Martin',
SETUP_USERNAME: 'Uživatelské jméno', SETUP_USERNAME: 'Uživatelské jméno',
SUPPORTED_SITES_HEADER: 'Podporované obchody', SUPPORTED_SITES_HEADER: 'Podporované obchody',
SUPPORTED_SITES_TEXT: 'Nefunguje obchod nebo úplně chybí? Založ nový ticket <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">ZDE</a>! :)', SUPPORTED_SITES_TEXT: 'Nefunguje obchod nebo úplně chybí? Založ nový ticket <a href="https://github.com/Wingysam/get-product-data/issues/new">ZDE</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Nepoužíváte poslední verzi Christmas Community. V nové verzi mohou být nové funkce nebo opravy chyb. Zvžte aktualizaci :) Nepoužíváte poslední verzi Christmas Community. V nové verzi mohou být nové funkce nebo opravy chyb. Zvžte aktualizaci :)

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'john', SETUP_USERNAME_PLACEHOLDER: 'john',
SETUP_USERNAME: 'Brugernavn', SETUP_USERNAME: 'Brugernavn',
SUPPORTED_SITES_HEADER: 'Supporterede hjemmesider', SUPPORTED_SITES_HEADER: 'Supporterede hjemmesider',
SUPPORTED_SITES_TEXT: 'Is a site missing or broken? Open an issue <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">here</a>! :)', SUPPORTED_SITES_TEXT: 'Is a site missing or broken? Open an issue <a href="https://github.com/Wingysam/get-product-data/issues/new">here</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community is out of date. There may be new features or bug fixes. Consider updating! :) Christmas Community is out of date. There may be new features or bug fixes. Consider updating! :)

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'john', SETUP_USERNAME_PLACEHOLDER: 'john',
SETUP_USERNAME: 'Nutzername', SETUP_USERNAME: 'Nutzername',
SUPPORTED_SITES_HEADER: 'Unterstützte Seiten', SUPPORTED_SITES_HEADER: 'Unterstützte Seiten',
SUPPORTED_SITES_TEXT: 'Fehlt eine Seite oder ist etwas defekt? Eröffne <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">hier</a> ein Issue! :)', SUPPORTED_SITES_TEXT: 'Fehlt eine Seite oder ist etwas defekt? Eröffne <a href="https://github.com/Wingysam/get-product-data/issues/new">hier</a> ein Issue! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community ist veraltet. Möglicherweise gibt es neue Funktionen oder Fehler wurden beseitigt. Mach' am besten ein Update! :) Christmas Community ist veraltet. Möglicherweise gibt es neue Funktionen oder Fehler wurden beseitigt. Mach' am besten ein Update! :)

View file

@ -124,8 +124,8 @@ module.exports.strings = {
SETUP_PASSWORD: 'Password', SETUP_PASSWORD: 'Password',
SETUP_USERNAME_PLACEHOLDER: 'john', SETUP_USERNAME_PLACEHOLDER: 'john',
SETUP_USERNAME: 'Username', SETUP_USERNAME: 'Username',
SUPPORTED_SITES_HEADER: 'Working Sites', SUPPORTED_SITES_HEADER: 'Supported Sites',
SUPPORTED_SITES_TEXT: 'You can still add items from other sites, but it can\'t autopopulate the information, so do that yourself.', SUPPORTED_SITES_TEXT: 'Is a site missing or broken? Open an issue <a href="https://github.com/Wingysam/get-product-data/issues/new">here</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
New version available! There may be new features or bug fixes. Consider updating! :) New version available! There may be new features or bug fixes. Consider updating! :)

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'juan', SETUP_USERNAME_PLACEHOLDER: 'juan',
SETUP_USERNAME: 'Nombre de usuario', SETUP_USERNAME: 'Nombre de usuario',
SUPPORTED_SITES_HEADER: 'Sitios web compatibles', SUPPORTED_SITES_HEADER: 'Sitios web compatibles',
SUPPORTED_SITES_TEXT: '¿Hay un sitio ausente o roto? Abra una propuesta <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">aquí</a>! :)', SUPPORTED_SITES_TEXT: '¿Hay un sitio ausente o roto? Abra una propuesta <a href="https://github.com/Wingysam/get-product-data/issues/new">aquí</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community es desactualizado. Puede haber nuevas functiones o correcciones. ¡Considera actualizar! :) Christmas Community es desactualizado. Puede haber nuevas functiones o correcciones. ¡Considera actualizar! :)

View file

@ -124,7 +124,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'félix', SETUP_USERNAME_PLACEHOLDER: 'félix',
SETUP_USERNAME: 'Nom d\'utilisateur', SETUP_USERNAME: 'Nom d\'utilisateur',
SUPPORTED_SITES_HEADER: 'Sites pris en charge', SUPPORTED_SITES_HEADER: 'Sites pris en charge',
SUPPORTED_SITES_TEXT: 'Un site est-il manquant ou cassé? Reporter un problème <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">here</a>! :)', SUPPORTED_SITES_TEXT: 'Un site est-il manquant ou cassé? Reporter un problème <a href="https://github.com/Wingysam/get-product-data/issues/new">here</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community est obsolète. Il peut y avoir de nouvelles fonctionnalités ou des corrections de bugs. Pensez à mettre à jour! :) Christmas Community est obsolète. Il peut y avoir de nouvelles fonctionnalités ou des corrections de bugs. Pensez à mettre à jour! :)

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'jean', SETUP_USERNAME_PLACEHOLDER: 'jean',
SETUP_USERNAME: "Nom d'utilisateur", SETUP_USERNAME: "Nom d'utilisateur",
SUPPORTED_SITES_HEADER: 'Sites supportés', SUPPORTED_SITES_HEADER: 'Sites supportés',
SUPPORTED_SITES_TEXT: 'Un site est-il manquant ou cassé? Ouvrir une issue <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">here</a>! :)', SUPPORTED_SITES_TEXT: 'Un site est-il manquant ou cassé? Ouvrir une issue <a href="https://github.com/Wingysam/get-product-data/issues/new">here</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community est obsolète. Il peut y avoir de nouvelles fonctionnalités ou des corrections de bugs. Pensez à mettre à jour! :) Christmas Community est obsolète. Il peut y avoir de nouvelles fonctionnalités ou des corrections de bugs. Pensez à mettre à jour! :)

187
src/languages/nb-no.js Normal file
View file

@ -0,0 +1,187 @@
module.exports.momentLocale = 'nb'
module.exports.strings = {
_NOT_LOCALIZED: key => `${key} har ikke blitt oversatt til norsk enda.`,
ADMIN_CLEAR_WISHLISTS_BUTTON: 'Tøm alle ønskelister',
ADMIN_CLEAR_WISHLISTS_DESCRIPTION: 'Dette vil umiddelbart og irreversibelt <b>slette alle ønskelister!</b> Vurder å ta en sikkerhetskopi av databasen før du bruker dette.',
ADMIN_CLEAR_WISHLISTS_HEADER: 'Sletting av ønskelister',
ADMIN_SETTINGS_CLEARDB_BUTTON: 'Tøm ønskelister',
ADMIN_SETTINGS_CLEARDB_DESCRIPTION: '<b>Advarsel</b>: Disse alternativene <b>ødelegger data</b>! Du bør ta en sikkerhetskopi av databasen før du bruker disse alternativene.',
ADMIN_SETTINGS_CLEARDB_HEADER: 'Dataødeleggelse',
ADMIN_SETTINGS_CLEARDB_SUCCESS: 'Alle ønskelister ble tømt.',
ADMIN_SETTINGS_HEADER: 'Administratorinnstillinger',
ADMIN_SETTINGS_USERS_ADD_BUTTON: 'Legg til bruker',
ADMIN_SETTINGS_USERS_ADD_HEADER: 'Legg til bruker',
ADMIN_SETTINGS_USERS_ADD_PLACEHOLDER: 'Ola',
ADMIN_SETTINGS_USERS_ADD_USERNAME: 'Brukernavn',
ADMIN_SETTINGS_USERS_ADD_ERROR_USERNAME_EMPTY: 'Brukernavn kan ikke være tomt.',
ADMIN_SETTINGS_USERS_EDIT_DELETE_FAIL_ADMIN: 'Kunne ikke fjerne: bruker er administrator.',
ADMIN_SETTINGS_USERS_EDIT_DELETE_SUCCESS: name => `Brukeren ${name} ble fjernet.`,
ADMIN_SETTINGS_USERS_EDIT_DEMOTE_NOT_ADMIN: 'brukeren er ikke en administrator',
ADMIN_SETTINGS_USERS_EDIT_DEMOTE_SELF: 'Du kan ikke nedgradere egen konto.',
ADMIN_SETTINGS_USERS_EDIT_DEMOTE_SUCCESS: name => `${name} er ikke lengre en administrator.`,
ADMIN_SETTINGS_USERS_EDIT_IMPERSONATE_SUCCESS: name => `Du er nå ${name}.`,
ADMIN_SETTINGS_USERS_EDIT_NO_USERNAME_PROVIDED: 'Ingen brukernavn oppgitt',
ADMIN_SETTINGS_USERS_EDIT_PROMOTE_ALREADY_ADMIN: 'brukeren er allerede administrator',
ADMIN_SETTINGS_USERS_EDIT_PROMOTE_DEMOTE_NOT_FOUND: 'Brukeren ble ikke funnet.',
ADMIN_SETTINGS_USERS_EDIT_PROMOTE_SUCCESS: name => `${name} er nå en administrator.`,
ADMIN_SETTINGS_USERS_EDIT_RENAMED_USER: 'Brukeren er omdøpt!',
ADMIN_SETTINGS_USERS_EDIT_SAME_NAME: 'Brukernavnet er det samme som det nye brukernavnet.',
ADMIN_SETTINGS_USERS_EDIT: 'Rediger',
ADMIN_SETTINGS_USERS_HEADER: 'Brukere',
ADMIN_SETTINGS_VERSION_INFO: 'Versjonsinfo',
ADMIN_USER_EDIT_ACCOUNT_UNCONFIRMED: "Denne kontoen er ikke bekreftet.",
ADMIN_USER_EDIT_ADMIN_ISADMIN: name => `${name} er en administrator.`,
ADMIN_USER_EDIT_ADMIN_NOTADMIN: name => `${name} er ikke en administrator.`,
ADMIN_USER_EDIT_ADMIN: 'Administrator',
ADMIN_USER_EDIT_CHANGE_NAME: 'Endre navn',
ADMIN_USER_EDIT_CHANGE_USERNAME: 'Endre brukernavn',
ADMIN_USER_EDIT_CONFIRMATION_LINK: 'Bekreftelseslenke',
ADMIN_USER_EDIT_DELETE_ADMIN: 'Brukeren er administrator',
ADMIN_USER_EDIT_DELETE_HEADER: 'Irreversibel sletting',
ADMIN_USER_EDIT_DELETE_USER: name => `Fjern bruker ${name}`,
ADMIN_USER_EDIT_DEMOTE_SELF: 'Du kan ikke nedgradere deg selv',
ADMIN_USER_EDIT_DEMOTE: name => `Nedgrader ${name}`,
ADMIN_USER_EDIT_EDITING_USER: name => `Redigerer bruker "${name}"`,
ADMIN_USER_EDIT_GENERATE_NEW_LINK: 'Generer ny lenke',
ADMIN_USER_EDIT_IMPERSONATE_BUTTON: name => `Logg inn som ${name}`,
ADMIN_USER_EDIT_IMPERSONATE_HEADER: 'Logg inn som',
ADMIN_USER_EDIT_LINK_EXPIRY_FUTURE: fromNow => `Følgende lenke utløper ${fromNow}`, // fromNow is localized by moment
ADMIN_USER_EDIT_LINK_EXPIRY_PAST: fromNow => `Følgende lenke utløp ${fromNow}`,
ADMIN_USER_EDIT_PROMOTE: name => `Promoter ${name}`,
ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK_EXPIRY_FUTURE: fromNow => `Den utløper ${fromNow}`,
ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK_EXPIRY_PAST: fromNow => `Den utløp ${fromNow}`,
ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK: 'Det finnes en gjennopprettingslenke for denne brukeren.',
ADMIN_USER_EDIT_RESET_PASSWORD_HEADER: 'Nullstill passord',
ADMIN_USER_EDIT_RESET_PASSWORD_LINK_CANCEL: 'Slett gjennopprettingslenke',
ADMIN_USER_EDIT_RESET_PASSWORD_LINK_CREATE: 'Opprett gjennopprettingslenke',
ADMIN_USER_EDIT_RESET_PASSWORD_LINK_REFRESH: 'Oppdater gjennopprettingslenke',
ADMIN_USER_EDIT_USERNAME: 'Brukernavn',
BACK_BUTTON: 'Tilbake',
CONFIRM_ACCOUNT_EXPIRED: 'Din gjenopprettingslenke er utløpt. Vennligst be om en ny.',
CONFIRM_ACCOUNT_HEADER_INVALID: `${_CC.config.siteTitle} | Ugyldig bekreftelseslenke`,
CONFIRM_ACCOUNT_HEADER_VALID: `${_CC.config.siteTitle} | Bekreft konto`,
CONFIRM_ACCOUNT_INVALID: "Denne bekreftelseslenken er ugyldig. Kanskje er den slettet, eller det mangler tegn på slutten av den?",
CONFIRM_ACCOUNT_SET_PW_BUTTON: `Bli medlem av ${_CC.config.siteTitle}`,
CONFIRM_ACCOUNT_SET_PW_PLACEHOLDER: 'pa$$ord!',
CONFIRM_ACCOUNT_SET_PW_TEXT: name => `Hei, ${name}! Vennligst sett ditt passord her.`,
CONFIRM_ACCOUNT_SUCCESS: `Velkommen til ${_CC.config.siteTitle}!`,
LOGIN_BUTTON: 'Logg inn',
LOGIN_PASSWORD_PLACEHOLDER: 'pa$$ord!',
LOGIN_PASSWORD: 'Passord',
LOGIN_USERNAME_PLACEHOLDER: 'Ola',
LOGIN_USERNAME: 'Brukernavn',
LOGOUT_BUTTON: 'Logg ut',
NAVBAR_ADMIN: 'Administratorinnstillinger',
NAVBAR_LOGIN: 'Logg inn',
NAVBAR_LOGOUT: 'Logg ut',
NAVBAR_PROFILE: 'Profil',
NAVBAR_WISHLIST: 'Min ønskeliste',
NOTE_BACK: name => `Tilbake til ${name}s ønskeliste`,
NOTE_GET_PRODUCT_DATA: 'Hent produktdata',
NOTE_GUARD: 'Ugyldig bruker',
NOTE_IMAGE_URL: 'Bildelenke',
NOTE_MISSING_PROP: prop => `Mangler egenskap ${prop}`, // not really possible to localize this unfortunately
NOTE_NAME: 'Navn',
NOTE_NOTE: 'Notat',
NOTE_PRICE: 'Pris',
NOTE_REFRESH_DATA: 'Oppdater data',
NOTE_REMOVE_GUARD: 'Ugyldig bruker',
NOTE_REMOVE_MISSING: 'Har ingen notater',
NOTE_REMOVE_SUCCESS: 'Notatet ble fjernet',
NOTE_SAVE_BUTTON: 'Lagre element',
NOTE_SUCCESS: 'Lagret!',
NOTE_URL: 'Lenke',
PROFILE_HEADER: 'Profil',
PROFILE_PASSWORD_BUTTON: 'Lagre',
PROFILE_PASSWORD_NEW: 'Nytt passord',
PROFILE_PASSWORD_OLD_MISMATCH: 'Feil gammelt passord',
PROFILE_PASSWORD_OLD: 'Nytt passord',
PROFILE_PASSWORD_PLACEHOLDER: 'pa$$ord!',
PROFILE_PASSWORD_REQUIRED_NEW: 'Nytt passord er påkrevd',
PROFILE_PASSWORD_REQUIRED_OLD: 'Gammelt passord er påkrevd',
PROFILE_PASSWORD_SUCCESS: 'Endringer ble lagret!',
PROFILE_PASSWORD_TITLE: name => `Profilinnstillinger - Passord - ${name}`,
PROFILE_PFP_IMAGE_URL: 'Bildelenke',
PROFILE_SAVE_PFP_DISABLED: 'Profilbilder er deaktivert.',
PROFILE_SAVE_PFP_SUCCESS: 'Profilbilde ble lagret!',
PROFILE_SECURITY_CHANGE_PASSWORD: 'Endre passord',
PROFILE_SECURITY: 'Sikkerhet',
PROFILE_TITLE: name => `Profilinnstillinger - ${name}`,
RESET_PASSWORD_BUTTON: 'Tilbakestill passord',
RESET_PASSWORD_GREETING_EXPIRED: 'Din gjenopprettingslenke er utløpt. Vennligst be om en ny.',
RESET_PASSWORD_GREETING_INVALID: "Denne gjenopprettingslenken er ugyldig. Kanskje er den slettet, eller det mangler tegn på slutten av den?",
RESET_PASSWORD_GREETING_VALID: name => `Hei, ${name}! Vennligst sett ditt passord her.`,
RESET_PASSWORD_HEADER_INVALID: `${_CC.config.siteTitle} | Ugyldig gjenopprettingslenke`,
RESET_PASSWORD_HEADER_VALID: `${_CC.config.siteTitle} | Nullstill passord`,
RESET_PASSWORD_PASSWORD_PLACEHOLDER: 'pa$$ord!',
RESET_PASSWORD_PASSWORD: 'Passord',
RESET_PASSWORD_SUCCESS: 'Passordet ble nullstilt!',
SETUP_ADMIN_USER: 'Administratorbruker',
SETUP_BUTTON: 'Konfigurer!',
SETUP_HEADER: 'Konfigurasjon',
SETUP_PASSWORD_PLACEHOLDER: 'pa$$ord!',
SETUP_PASSWORD: 'Passord',
SETUP_USERNAME_PLACEHOLDER: 'Ola',
SETUP_USERNAME: 'Brukernavn',
SUPPORTED_SITES_HEADER: 'Støttede nettsteder',
SUPPORTED_SITES_TEXT: 'Mangler en nettsted, eller har problemer? Skriv en feilrapport <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">her</a>! :)',
UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community er utdatert. Det kan være nye funksjoner og feilrettinger. Vurder å oppdatere! :)
</span>
<br>
<span>(du kan deaktivere dette med <code>UPDATE_CHECK=false</code>)</span>
<br><br>
<span>Gjeldende: ${current}</span>
<br>
<span>Siste: ${latest}</span>
<span class="has-text-info" style="float: right;">Denne meldingen er kun synlig for administratorer</span>`,
WISHLIST_ADD: 'Legg til element i ønskelisten',
WISHLIST_ADDED_BY_USER: addedBy => `Lagt til av: ${addedBy}`,
WISHLIST_ADDED_BY: 'Lagt til av',
WISHLIST_ADDED_ITEM_TO_OWN_WISHLIST: 'Elementet ble lagt til i ønskelisten.',
WISHLIST_CONFLICT: 'Elementer blir lagt til for fort. Vennligst prøv igjen.',
WISHLIST_DELETE: 'Slett',
WISHLIST_EDIT_ITEM: 'Rediger element',
WISHLIST_FETCH_FAIL: 'Kunne ikke hente ønskeliste -- eksisterer brukeren?',
WISHLIST_IMAGE: 'Bilde',
WISHLIST_ITEM_MISSING: 'Element ikke funnet',
WISHLIST_MOVE_DOWN: 'Flytt ned',
WISHLIST_MOVE_GUARD: 'Feil bruker',
WISHLIST_MOVE_INVALID: 'Ugyldig bevegelse',
WISHLIST_MOVE_ITEM_DOWN: 'Flytt element ned',
WISHLIST_MOVE_ITEM_TOP: 'Flytt element til toppen',
WISHLIST_MOVE_ITEM_UP: 'Flytt element opp',
WISHLIST_MOVE_SUCCESS: 'Elementet ble flyttet!',
WISHLIST_MOVE_TOP: 'Flytt til toppen',
WISHLIST_MOVE_UNKNOWN_DIRECTION: 'Ukjent retning',
WISHLIST_MOVE_UP: 'Flytt opp',
WISHLIST_NAME: 'Navn',
WISHLIST_NOTE: 'Notat',
WISHLIST_OPTIONAL: 'Valgfritt',
WISHLIST_PLEDGE_DUPLICATE: 'Elementet er allerede reservert',
WISHLIST_PLEDGE_ITEM: 'Reserver element',
WISHLIST_PLEDGE_SUCCESS: 'Elementet ble reservert!',
WISHLIST_PLEDGE: 'Reserver',
WISHLIST_PLEDGED: pledgedBy => `Reservert av ${pledgedBy}`,
WISHLIST_PLEDGED_GUEST: 'Reservert av gjestebruker',
WISHLIST_PLEDGED_ITEM_FOR_USER: user => `Reserverte elementet for ${user}.`,
WISHLIST_PRICE: 'Pris',
WISHLIST_REFRESH_GUARD: 'Ugyldig bruker',
WISHLIST_REFRESH_NO_URL: 'Elementet har ingen lenke.',
WISHLIST_REFRESH_SUCCESS: 'Data ble oppdatert!',
WISHLIST_REMOVE_GUARD: 'Feil bruker',
WISHLIST_REMOVE_SUCCESS: 'Fjernet fra ønskeliste',
WISHLIST_SUGGEST: 'Foreslå element',
WISHLIST_TITLE: name => `${_CC.config.siteTitle} - Ønskeliste - ${name}`,
WISHLIST_UNPLEDGE_GUARD: 'Du har ikke reservert dette elementet', // should never happen unless someone makes their own http requests
WISHLIST_UNPLEDGE_SUCCESS: 'Reservasjonen for elementet ble trukket!',
WISHLIST_UNPLEDGE: 'Trekk reservasjon',
WISHLIST_URL_LABEL: `Elementlenke eller navn (<a href="${_CC.config.base}supported-sites">Støttede nettsteder</a>)`,
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: 'Elementlenke eller navn er påkrevd',
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Ønskeliste`
}

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'henk', SETUP_USERNAME_PLACEHOLDER: 'henk',
SETUP_USERNAME: 'Gebruikersnaam', SETUP_USERNAME: 'Gebruikersnaam',
SUPPORTED_SITES_HEADER: 'Ondersteunde sites', SUPPORTED_SITES_HEADER: 'Ondersteunde sites',
SUPPORTED_SITES_TEXT: 'Ontbreekt er een website of is er een kapot? Open een issue <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">hier</a>! :)', SUPPORTED_SITES_TEXT: 'Ontbreekt er een website of is er een kapot? Open een issue <a href="https://github.com/Wingysam/get-product-data/issues/new">hier</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Christmas Community is niet meer up to date. Misschien zijn er nieuwe functies of bugfixes. Overweeg om te updaten :) Christmas Community is niet meer up to date. Misschien zijn er nieuwe functies of bugfixes. Overweeg om te updaten :)

View file

@ -125,7 +125,7 @@ module.exports.strings = {
SETUP_USERNAME_PLACEHOLDER: 'ion', SETUP_USERNAME_PLACEHOLDER: 'ion',
SETUP_USERNAME: 'Nume de utilizator', SETUP_USERNAME: 'Nume de utilizator',
SUPPORTED_SITES_HEADER: 'Site-uri suportate', SUPPORTED_SITES_HEADER: 'Site-uri suportate',
SUPPORTED_SITES_TEXT: 'Este vreun site care lipsește sau nu funcționează corect? Sesizați problema <a href="https://gitlab.com/wingysam/get-product-name/-/issues/new">aici</a>! :)', SUPPORTED_SITES_TEXT: 'Este vreun site care lipsește sau nu funcționează corect? Sesizați problema <a href="https://github.com/Wingysam/get-product-data/issues/new">aici</a>! :)',
UPDATE_NOTICE: (current, latest) => ` UPDATE_NOTICE: (current, latest) => `
<span class="has-text-danger is-size-4 has-text-weight-bold"> <span class="has-text-danger is-size-4 has-text-weight-bold">
Folosiți o versiune învechită a Christmas Community. Este posibil se fi adăugat noi funcții și rezolvat erori. Este recomandată actualizarea! :) Folosiți o versiune învechită a Christmas Community. Este posibil se fi adăugat noi funcții și rezolvat erori. Este recomandată actualizarea! :)

View file

@ -29,7 +29,6 @@ module.exports = ({ db, config }) => {
const router = express.Router() const router = express.Router()
router.use('/', express.static(path.join(__dirname, '../static'))) router.use('/', express.static(path.join(__dirname, '../static')))
router.use(require('cookie-parser')())
router.get('/', router.get('/',
async (req, res, next) => { async (req, res, next) => {

View file

@ -161,6 +161,8 @@ class Wishlist {
} }
const productData = await getProductData(item.url) const productData = await getProductData(item.url)
if (!productData) return; // short-circuit when there's no data
for (const key of ['name', 'price', 'image']) { for (const key of ['name', 'price', 'image']) {
if (productData[key]) item[key] = productData[key] if (productData[key]) item[key] = productData[key]
} }

View file

@ -39,14 +39,27 @@ block content
figure(style='width: 100%; margin: 0;') figure(style='width: 100%; margin: 0;')
img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;') img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;')
if item.url if item.url
td.ugc(data-label='Name') td.ugc(data-label=lang('WISHLIST_NAME'))
a( if item.pledgedBy && item.addedBy != req.user._id
href=item.url, strike
rel='noopener noreferrer', a(
target='_blank' href=item.url,
)= (item.name ? item.name : item.url) rel='noopener noreferrer',
target='_blank'
)= (item.name ? item.name : item.url)
else
a(
href=item.url,
rel='noopener noreferrer',
target='_blank'
)= (item.name ? item.name : item.url)
else else
td.ugc(data-label=lang('WISHLIST_NAME'))= item.name td.ugc(data-label='Name')
if item.pledgedBy
strike
span= item.name
else
span= item.name
if _CC.config.wishlist.note.markdown if _CC.config.wishlist.note.markdown
td.ugc(data-label=lang('WISHLIST_NOTE')) td.ugc(data-label=lang('WISHLIST_NOTE'))
div!= item.note div!= item.note
@ -143,13 +156,25 @@ block content
if item.price if item.price
span= ' ' span= ' '
if item.url if item.url
a( if item.pledgedBy && item.addedBy != req.user._id
href=item.url, strike
rel='noopener noreferrer', a(
target='_blank' href=item.url,
)= (item.name ? item.name : item.url) rel='noopener noreferrer',
target='_blank'
)= (item.name ? item.name : item.url)
else
a(
href=item.url,
rel='noopener noreferrer',
target='_blank'
)= (item.name ? item.name : item.url)
else else
span= item.name if item.pledgedBy
strike
span= item.name
else
span= item.name
hr hr
if item.note || item.image if item.note || item.image
.columns .columns
@ -163,7 +188,7 @@ block content
style='height: 100%;' style='height: 100%;'
readonly readonly
)= item.note )= item.note
span.overflowWrap=lang('WISHLIST_ADDED_BY', item.addedBy) span.overflowWrap=lang('WISHLIST_ADDED_BY_USER', item.addedBy)
hr hr
div div
if req.params.user !== req.user._id && !item.pledgedBy if req.params.user !== req.user._id && !item.pledgedBy