From 08845b8f84d315226370a02f0c4b34eae385c7b0 Mon Sep 17 00:00:00 2001 From: PeteS4 Date: Mon, 6 Dec 2021 15:48:46 +0100 Subject: [PATCH 1/6] feat: German localization --- languages/de-de.js | 181 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 181 insertions(+) create mode 100644 languages/de-de.js diff --git a/languages/de-de.js b/languages/de-de.js new file mode 100644 index 0000000..331db24 --- /dev/null +++ b/languages/de-de.js @@ -0,0 +1,181 @@ +module.exports.momentLocale = 'en' + +module.exports.strings = { + _NOT_LOCALIZED: key => `${key} wurde noch nicht auf Deutsch übersetzt.`, + ADMIN_CLEAR_WISHLISTS_BUTTON: 'Alle Wunschlisten leeren', + ADMIN_CLEAR_WISHLISTS_DESCRIPTION: 'Diese Aktion wird sofort und unwiederbringlich alle Wunschlisten löschen! Mache am besten ein Datenbankbackup, bevor Du fortfährst.', + ADMIN_CLEAR_WISHLISTS_HEADER: 'Wunschlistenlöschung', + ADMIN_SETTINGS_CLEARDB_BUTTON: 'Wunschlisten leeren', + ADMIN_SETTINGS_CLEARDB_DESCRIPTION: 'Warnung: Diese Einstellungen löschen Daten! Mache am besten ein Datenbankbackup, bevor Du fortfährst.', + ADMIN_SETTINGS_CLEARDB_HEADER: 'Datenlöschung', + ADMIN_SETTINGS_CLEARDB_SUCCESS: 'Alle Wunschlisten geleert.', + ADMIN_SETTINGS_HEADER: 'Admin-Einstellungen', + ADMIN_SETTINGS_USERS_ADD_BUTTON: 'Nutzer hinzufügen', + ADMIN_SETTINGS_USERS_ADD_HEADER: 'Nutzer hinzufügen', + ADMIN_SETTINGS_USERS_ADD_PLACEHOLDER: 'john', + ADMIN_SETTINGS_USERS_ADD_USERNAME: 'Nutzername', + ADMIN_SETTINGS_USERS_EDIT_DELETE_FAIL_ADMIN: 'Löschen gescheitert: Nutzer ist Admin.', + ADMIN_SETTINGS_USERS_EDIT_DELETE_SUCCESS: name => `Nutzer ${name} wurde erfolgreich gelöscht`, + ADMIN_SETTINGS_USERS_EDIT_DEMOTE_NOT_ADMIN: 'Nutzer ist kein Admin', + ADMIN_SETTINGS_USERS_EDIT_DEMOTE_SELF: 'Du kannst Dich nicht selbst degradieren.', + ADMIN_SETTINGS_USERS_EDIT_DEMOTE_SUCCESS: name => `${name} ist nun kein Admin mehr.`, + ADMIN_SETTINGS_USERS_EDIT_IMPERSONATE_SUCCESS: name => `Du bist nun ${name}.`, + ADMIN_SETTINGS_USERS_EDIT_NO_USERNAME_PROVIDED: 'Kein Nutzername angegeben', + ADMIN_SETTINGS_USERS_EDIT_PROMOTE_ALREADY_ADMIN: 'Nutzer ist bereits Admin', + ADMIN_SETTINGS_USERS_EDIT_PROMOTE_DEMOTE_NOT_FOUND: 'Nutzer nicht gefunden.', + ADMIN_SETTINGS_USERS_EDIT_PROMOTE_SUCCESS: name => `${name} ist nun ein Admin.`, + ADMIN_SETTINGS_USERS_EDIT_RENAMED_USER: 'Nutzer umbenannt!', + ADMIN_SETTINGS_USERS_EDIT_SAME_NAME: 'Der alte und neue Nutzername sind identisch.', + ADMIN_SETTINGS_USERS_EDIT: 'Bearbeiten', + ADMIN_SETTINGS_USERS_HEADER: 'Nutzer', + ADMIN_SETTINGS_VERSION_INFO: 'Versionsinfo', + ADMIN_USER_EDIT_ACCOUNT_UNCONFIRMED: "Dieses Nutzerkonto wurde noch nicht bestätigt.", + ADMIN_USER_EDIT_ADMIN_ISADMIN: name => `${name} ist ein Admin.`, + ADMIN_USER_EDIT_ADMIN_NOTADMIN: name => `${name} ist kein Admin.`, + ADMIN_USER_EDIT_ADMIN: 'Admin', + ADMIN_USER_EDIT_CHANGE_NAME: 'Namen ändern', + ADMIN_USER_EDIT_CHANGE_USERNAME: 'Nutzernamen ändern', + ADMIN_USER_EDIT_CONFIRMATION_LINK: 'Bestätigungslink', + ADMIN_USER_EDIT_DELETE_ADMIN: 'Nutzer ist Admin', + ADMIN_USER_EDIT_DELETE_HEADER: 'Unwiderrufliche Löschung', + ADMIN_USER_EDIT_DELETE_USER: name => `Benutzer ${name} löschen`, + ADMIN_USER_EDIT_DEMOTE_SELF: 'Du kannst Dir nicht selbst den Admin-Status entziehen.', + ADMIN_USER_EDIT_DEMOTE: name => `${name} den Admin-Status entziehen`, + ADMIN_USER_EDIT_EDITING_USER: name => `Nutzer "${name}" wird bearbeitet`, + ADMIN_USER_EDIT_GENERATE_NEW_LINK: 'Neuen Link generieren', + ADMIN_USER_EDIT_IMPERSONATE_BUTTON: name => `Als ${name} anmelden`, + ADMIN_USER_EDIT_IMPERSONATE_HEADER: 'Personifizieren', + ADMIN_USER_EDIT_LINK_EXPIRY_FUTURE: fromNow => `Der folgende Link läuft ${fromNow} ab`, // fromNow is localized by moment + ADMIN_USER_EDIT_LINK_EXPIRY_PAST: fromNow => `Der folgende Link ist ${fromNow} abgelaufen`, + ADMIN_USER_EDIT_PROMOTE: name => `${name} zum Admin machen`, + ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK_EXPIRY_FUTURE: fromNow => `Läuft ${fromNow} ab`, + ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK_EXPIRY_PAST: fromNow => `Ist ${fromNow} abgelaufen`, + ADMIN_USER_EDIT_RESET_PASSWORD_HASLINK: 'Es existiert ein Passwortrücksetzlink für diesen Nutzer.', + ADMIN_USER_EDIT_RESET_PASSWORD_HEADER: 'Passwort zurücksetzen', + ADMIN_USER_EDIT_RESET_PASSWORD_LINK_CANCEL: 'Passwortrücksetzlink löschen', + ADMIN_USER_EDIT_RESET_PASSWORD_LINK_CREATE: 'Passwortrücksetzlink erzeugen', + ADMIN_USER_EDIT_RESET_PASSWORD_LINK_REFRESH: 'Passwortrücksetzlink erneuern', + ADMIN_USER_EDIT_USERNAME: 'Nutzername', + BACK_BUTTON: 'Zurück', + CONFIRM_ACCOUNT_EXPIRED: 'Dein Bestätigungslink ist abgelaufen. Bitte frage nach einem Neuen.', + CONFIRM_ACCOUNT_HEADER_INVALID: `${_CC.config.siteTitle} | Ungültiger Bestätigungslink`, + CONFIRM_ACCOUNT_HEADER_VALID: `${_CC.config.siteTitle} | Nutzerkonto bestätigen`, + CONFIRM_ACCOUNT_INVALID: "Dieser Bestätigungslink ist ungültig, vielleicht wurde das Konto gelöscht oder es wurden einige Zeichen abgeschnitten?", + CONFIRM_ACCOUNT_SET_PW_BUTTON: `${_CC.config.siteTitle} beitreten`, + CONFIRM_ACCOUNT_SET_PW_PLACEHOLDER: 'pa$$word!', + CONFIRM_ACCOUNT_SET_PW_TEXT: name => `Hallo ${name}! Bitte vergebe hier Dein Passwort.`, + CONFIRM_ACCOUNT_SUCCESS: `Willkommen bei ${_CC.config.siteTitle}!`, + LOGIN_BUTTON: 'Anmelden', + LOGIN_PASSWORD_PLACEHOLDER: 'pa$$word!', + LOGIN_PASSWORD: 'Passwort', + LOGIN_USERNAME_PLACEHOLDER: 'john', + LOGIN_USERNAME: 'Nutzername', + LOGOUT_BUTTON: 'Abmelden', + NAVBAR_ADMIN: 'Admin-Einstellungen', + NAVBAR_LOGIN: 'Anmelden', + NAVBAR_LOGOUT: 'Abmelden', + NAVBAR_PROFILE: 'Profil', + NAVBAR_WISHLIST: 'Meine Wunschliste', + NOTE_BACK: name => `Zurück zu ${name}s Wunschliste`, + NOTE_GET_PRODUCT_DATA: 'Produktdaten abrufen', + NOTE_GUARD: 'Ungültiger Nutzer', + NOTE_IMAGE_URL: 'Bild-URL', + NOTE_MISSING_PROP: prop => `Eigenschaft ${prop} fehlt`, // not really possible to localize this unfortunately + NOTE_NAME: 'Name', + NOTE_NOTE: 'Bemerkung', + NOTE_PRICE: 'Preis', + NOTE_REFRESH_DATA: 'Daten erneuern', + NOTE_REMOVE_GUARD: 'Ungültiger Nutzer', + NOTE_REMOVE_MISSING: 'Keine Bemerkung vorhanden', + NOTE_REMOVE_SUCCESS: 'Bemerkung erfolgreich gelöscht', + NOTE_SAVE_BUTTON: 'Eintrag speichern', + NOTE_SUCCESS: 'Erfolgreich gespeichert!', + NOTE_URL: 'URL', + PROFILE_HEADER: 'Profil', + PROFILE_PASSWORD_BUTTON: 'Speichern', + PROFILE_PASSWORD_NEW: 'Neues Passwort', + PROFILE_PASSWORD_OLD_MISMATCH: 'Falsches altes Passwort', + PROFILE_PASSWORD_OLD: 'Altes Passwort', + PROFILE_PASSWORD_PLACEHOLDER: 'pa$$word!', + PROFILE_PASSWORD_REQUIRED_NEW: 'Neues Passwort wird benötigt', + PROFILE_PASSWORD_REQUIRED_OLD: 'Altes Passwort wird benötigt', + PROFILE_PASSWORD_SUCCESS: 'Passwort erfolgreich geändert!', + PROFILE_PASSWORD_TITLE: name => `Profileinstellungen - Passwort - ${name}`, + PROFILE_PFP_IMAGE_URL: 'Bild-URL', + PROFILE_SAVE_PFP_DISABLED: 'Profilbilder sind deaktiviert.', + PROFILE_SAVE_PFP_SUCCESS: 'Profilbild gespeichert!', + PROFILE_SECURITY_CHANGE_PASSWORD: 'Passwort ändern', + PROFILE_SECURITY: 'Sicherheit', + PROFILE_TITLE: name => `Profileinstellungen - ${name}`, + RESET_PASSWORD_BUTTON: 'Passwort zurücksetzen', + RESET_PASSWORD_GREETING_EXPIRED: 'Dein Rücksetzlink ist abgelaufen. Bitte frage nach einem Neuen.', + RESET_PASSWORD_GREETING_INVALID: "Dieser Rücksetzlink ist ungültig, vielleicht wurde der Link gelöscht oder es wurden einige Zeichen abgeschnitten?", + RESET_PASSWORD_GREETING_VALID: name => `Hallo ${name}! Bitte vergebe hier Dein Passwort.`, + RESET_PASSWORD_HEADER_INVALID: `${_CC.config.siteTitle} | Rücksetzlink ungültig`, + RESET_PASSWORD_HEADER_VALID: `${_CC.config.siteTitle} | Passwort zurücksetzen`, + RESET_PASSWORD_PASSWORD_PLACEHOLDER: 'pa$$word!', + RESET_PASSWORD_PASSWORD: 'Password', + RESET_PASSWORD_SUCCESS: 'Passwort erfolgreich zurückgesetzt!', + SETUP_ADMIN_USER: 'Admin-Nutzer', + SETUP_BUTTON: 'Einrichten!', + SETUP_HEADER: 'Einrichtung', + SETUP_PASSWORD_PLACEHOLDER: 'pa$$word!', + SETUP_PASSWORD: 'Passwort', + SETUP_USERNAME_PLACEHOLDER: 'john', + SETUP_USERNAME: 'Nutzername', + SUPPORTED_SITES_HEADER: 'Unterstützte Seiten', + SUPPORTED_SITES_TEXT: 'Fehlt eine Seite oder ist etwas defekt? Eröffne hier ein Issue! :)', + UPDATE_NOTICE: (current, latest) => ` + + Christmas Community ist veraltet. Möglicherweise gibt es neue Funktionen oder Fehler wurden beseitigt. Mach' am besten ein Update! :) + +
+ (Du kannst diese Nachricht mit UPDATE_CHECK=false abschalten.) +

+ Derzeitig: ${current} +
+ Aktuell: ${latest} + Diese Nachricht ist nur für Admins sichtbar`, + WISHLIST_ADD: 'Eintrag zur Wunschliste hinzufügen', + WISHLIST_ADDED_BY_USER: addedBy => `Hinzugefügt von: ${addedBy}`, + WISHLIST_ADDED_BY: 'Hinzugefügt von', + WISHLIST_CONFLICT: 'Einträge werden zu schnell hinzugefügt. Bitte probier es nocheinmal.', + WISHLIST_DELETE: 'Löschen', + WISHLIST_EDIT_ITEM: 'Eintrag bearbeiten', + WISHLIST_IMAGE: 'Bild', + WISHLIST_MOVE_DOWN: 'Nach unten verschieben', + WISHLIST_MOVE_GUARD: 'Falscher Nutzer', + WISHLIST_MOVE_INVALID: 'Ungültige Verschiebung', + WISHLIST_MOVE_ITEM_DOWN: 'Eintrag nach unten verschieben', + WISHLIST_MOVE_ITEM_TOP: 'Eintrag an den Anfang verschieben', + WISHLIST_MOVE_ITEM_UP: 'Einstrag nach oben verschieben', + WISHLIST_MOVE_SUCCESS: 'Eintrag erfolgreich verschoben!', + WISHLIST_MOVE_TOP: 'An den Anfang verschieben', + WISHLIST_MOVE_UP: 'Nach oben verschieben', + WISHLIST_NAME: 'Name', + WISHLIST_NOTE: 'Bemerkung', + WISHLIST_OPTIONAL: 'Optional', + WISHLIST_PLEDGE_DUPLICATE: 'Eintrag ist bereits reserviert', + WISHLIST_PLEDGE_ITEM: 'Eintrag reservieren', + WISHLIST_PLEDGE_SUCCESS: 'Eintrag erfolgreich reserviert!', + WISHLIST_PLEDGE: 'Reservieren', + WISHLIST_PLEDGED: pledgedBy => `Reserviert von ${pledgedBy}`, + WISHLIST_PRICE: 'Preis', + WISHLIST_REFRESH_GUARD: 'Ungültiger Nutzer', + WISHLIST_REFRESH_NO_URL: 'Eintrag hat keine URL.', + WISHLIST_REFRESH_SUCCESS: 'Daten erfolgreich erneuert!', + WISHLIST_REMOVE_GUARD: 'Falscher Nutzer', + WISHLIST_REMOVE_MISSING: 'Eintrag nicht gefunden', + WISHLIST_REMOVE_SUCCESS: 'Erfolgreich von der Wunschliste entfernt', + WISHLIST_TITLE: name => `${_CC.config.siteTitle} - Wunschliste - ${name}`, + WISHLIST_UNPLEDGE_GUARD: 'Du hast das nicht reserviert', // should never happen unless someone makes their own http requests + WISHLIST_UNPLEDGE_MISSING: 'Eintrag nicht gefunden', + WISHLIST_UNPLEDGE_SUCCESS: 'Reservierung erfolgreich aufgehoben!', + WISHLIST_UNPLEDGE: 'Reservierung aufheben', + WISHLIST_URL_LABEL: 'Eintrags-URL oder Name (Unterstützte Seiten)', + WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK', + WISHLIST_URL_REQUIRED: 'Eintrags-URL oder Name wird benötigt', + WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`, + WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`, + WISHLISTS_TITLE: `${_CC.config.siteTitle} - Wunschlisten` +} From e9a9b9141454fac1ac947d176f3500cf454a4db1 Mon Sep 17 00:00:00 2001 From: PeteS4 Date: Mon, 6 Dec 2021 16:03:26 +0100 Subject: [PATCH 2/6] fix: localized pledge button --- views/wishlist.pug | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/wishlist.pug b/views/wishlist.pug index a9c6512..6b2e5c1 100644 --- a/views/wishlist.pug +++ b/views/wishlist.pug @@ -106,12 +106,12 @@ block content form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/pledge/${item.id}`) .field.inline .control.inline - input.inline.button.is-primary(type='submit' value='Pledge') + input.inline.button.is-primary(type='submit' value=lang('WISHLIST_PLEDGE_ITEM')) if item.pledgedBy === req.user._id form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/unpledge/${item.id}`) .field.inline .control.inline - input.inline.button(type='submit' value='Unpledge') + input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) if item.pledgedBy && item.pledgedBy !== req.user._id span.ugc=lang('WISHLIST_PLEDGED', item.pledgedBy) td(data-label='Delete Item') From 1a93e8760dc243bd1c39d704be7d89b559f18cae Mon Sep 17 00:00:00 2001 From: PeteS4 Date: Mon, 6 Dec 2021 16:10:25 +0100 Subject: [PATCH 3/6] fix: German localization improvements --- languages/de-de.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/languages/de-de.js b/languages/de-de.js index 331db24..ce01d83 100644 --- a/languages/de-de.js +++ b/languages/de-de.js @@ -3,8 +3,8 @@ module.exports.momentLocale = 'en' module.exports.strings = { _NOT_LOCALIZED: key => `${key} wurde noch nicht auf Deutsch übersetzt.`, ADMIN_CLEAR_WISHLISTS_BUTTON: 'Alle Wunschlisten leeren', - ADMIN_CLEAR_WISHLISTS_DESCRIPTION: 'Diese Aktion wird sofort und unwiederbringlich alle Wunschlisten löschen! Mache am besten ein Datenbankbackup, bevor Du fortfährst.', - ADMIN_CLEAR_WISHLISTS_HEADER: 'Wunschlistenlöschung', + ADMIN_CLEAR_WISHLISTS_DESCRIPTION: 'Diese Aktion wird sofort und unwiederbringlich alle Wunschlisten leeren! Mache am besten ein Datenbankbackup, bevor Du fortfährst.', + ADMIN_CLEAR_WISHLISTS_HEADER: 'Wunschlistenleerung', ADMIN_SETTINGS_CLEARDB_BUTTON: 'Wunschlisten leeren', ADMIN_SETTINGS_CLEARDB_DESCRIPTION: 'Warnung: Diese Einstellungen löschen Daten! Mache am besten ein Datenbankbackup, bevor Du fortfährst.', ADMIN_SETTINGS_CLEARDB_HEADER: 'Datenlöschung', @@ -143,20 +143,20 @@ module.exports.strings = { WISHLIST_DELETE: 'Löschen', WISHLIST_EDIT_ITEM: 'Eintrag bearbeiten', WISHLIST_IMAGE: 'Bild', - WISHLIST_MOVE_DOWN: 'Nach unten verschieben', + WISHLIST_MOVE_DOWN: 'Runterschieben', WISHLIST_MOVE_GUARD: 'Falscher Nutzer', WISHLIST_MOVE_INVALID: 'Ungültige Verschiebung', - WISHLIST_MOVE_ITEM_DOWN: 'Eintrag nach unten verschieben', - WISHLIST_MOVE_ITEM_TOP: 'Eintrag an den Anfang verschieben', - WISHLIST_MOVE_ITEM_UP: 'Einstrag nach oben verschieben', + WISHLIST_MOVE_ITEM_DOWN: 'Eintrag runterschieben', + WISHLIST_MOVE_ITEM_TOP: 'Eintrag an den Anfang setzen', + WISHLIST_MOVE_ITEM_UP: 'Einstrag hochschieben', WISHLIST_MOVE_SUCCESS: 'Eintrag erfolgreich verschoben!', - WISHLIST_MOVE_TOP: 'An den Anfang verschieben', - WISHLIST_MOVE_UP: 'Nach oben verschieben', + WISHLIST_MOVE_TOP: 'An den Anfang setzen', + WISHLIST_MOVE_UP: 'Hochschieben', WISHLIST_NAME: 'Name', WISHLIST_NOTE: 'Bemerkung', WISHLIST_OPTIONAL: 'Optional', WISHLIST_PLEDGE_DUPLICATE: 'Eintrag ist bereits reserviert', - WISHLIST_PLEDGE_ITEM: 'Eintrag reservieren', + WISHLIST_PLEDGE_ITEM: 'Reservieren', WISHLIST_PLEDGE_SUCCESS: 'Eintrag erfolgreich reserviert!', WISHLIST_PLEDGE: 'Reservieren', WISHLIST_PLEDGED: pledgedBy => `Reserviert von ${pledgedBy}`, @@ -172,9 +172,9 @@ module.exports.strings = { WISHLIST_UNPLEDGE_MISSING: 'Eintrag nicht gefunden', WISHLIST_UNPLEDGE_SUCCESS: 'Reservierung erfolgreich aufgehoben!', WISHLIST_UNPLEDGE: 'Reservierung aufheben', - WISHLIST_URL_LABEL: 'Eintrags-URL oder Name (Unterstützte Seiten)', + WISHLIST_URL_LABEL: 'URL oder Name (Unterstützte Seiten)', WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK', - WISHLIST_URL_REQUIRED: 'Eintrags-URL oder Name wird benötigt', + WISHLIST_URL_REQUIRED: 'URL oder Name wird benötigt', WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`, WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`, WISHLISTS_TITLE: `${_CC.config.siteTitle} - Wunschlisten` From 427ce91408b21aed5779008943b0da57fe4a2989 Mon Sep 17 00:00:00 2001 From: PeteS4 Date: Mon, 6 Dec 2021 16:10:58 +0100 Subject: [PATCH 4/6] fix: momentLocale for German localization --- languages/de-de.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/de-de.js b/languages/de-de.js index ce01d83..a43629e 100644 --- a/languages/de-de.js +++ b/languages/de-de.js @@ -1,4 +1,4 @@ -module.exports.momentLocale = 'en' +module.exports.momentLocale = 'de' module.exports.strings = { _NOT_LOCALIZED: key => `${key} wurde noch nicht auf Deutsch übersetzt.`, From 2bbce4b492b9020e8171884bfaa2234feba887ff Mon Sep 17 00:00:00 2001 From: Wingy Date: Mon, 6 Dec 2021 13:29:33 -0500 Subject: [PATCH 5/6] fixed in #18a1c11 --- views/wishlist.pug | 241 --------------------------------------------- 1 file changed, 241 deletions(-) delete mode 100644 views/wishlist.pug diff --git a/views/wishlist.pug b/views/wishlist.pug deleted file mode 100644 index 6b2e5c1..0000000 --- a/views/wishlist.pug +++ /dev/null @@ -1,241 +0,0 @@ -extends layout.pug - -block title - h1 - .level - .level-left - .level-item - button.button.is-rounded(onclick='this.firstChild.firstChild.classList.add("fa-pulse"); location.reload()') - span.icon - i.fas.fa-sync-alt - .level-item - span= lang('WISHLIST_TITLE', name) - -block content - script(type='data/user_id')= req.user._id - if global._CC.config.wishlist.table - .box - table.table.has-mobile-cards - thead - th # - th(style='width: 15%;')= lang('WISHLIST_IMAGE') - th(style='width: 25%;')= lang('WISHLIST_NAME') - th(style='width: 50%;')= lang('WISHLIST_NOTE') - th(style='width: 10%;')= lang('WISHLIST_PRICE') - th= lang('WISHLIST_EDIT_ITEM') - th= lang('WISHLIST_ADDED_BY') - if req.params.user === req.user._id - th= lang('WISHLIST_MOVE_TOP') - th= lang('WISHLIST_MOVE_UP') - th= lang('WISHLIST_MOVE_DOWN') - else - th= lang('WISHLIST_PLEDGE') - th= lang('WISHLIST_DELETE') - tbody - each item, index in wishlist - if req.user._id === item.addedBy || req.params.user !== req.user._id - tr(id=item.id) - td.rank= index + 1 - td - figure(style='width: 100%; margin: 0;') - img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;') - if item.url - td.ugc(data-label='Name') - a( - href=item.url, - rel='noopener noreferrer', - target='_blank' - )= (item.name ? item.name : item.url) - else - td.ugc(data-label=lang('WISHLIST_NAME'))= item.name - if _CC.config.wishlist.note.markdown - td.ugc(data-label=lang('WISHLIST_NOTE')) - div!= item.note - else - td.ugc(data-label=lang('WISHLIST_NOTE'))= item.note - td.ugc(data-label=lang('WISHLIST_PRICE'))= item.price - td(data-label=lang('WISHLIST_EDIT_ITEM')) - form.inline(method='GET', action=`${_CC.config.base}wishlist/${req.params.user}/note/${item.id}`) - .field.inline - .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;' - disabled=item.addedBy !== req.user._id - ) - span.icon - i.far.fa-edit - td.ugc(data-label=lang('WISHLIST_ADDED_BY'))= item.addedBy - if req.params.user === req.user._id - td(data-label=lang('WISHLIST_MOVE_ITEM_TOP')) - form.topForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/top/${item.id}`) - .field.inline - .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;', - disabled=index === firstCanSee - ) - span.icon - i.fas.fa-angle-double-up - td(data-label=lang('WISHLIST_MOVE_ITEM_UP')) - form.upForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/up/${item.id}`) - .field.inline - .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;', - disabled=index === firstCanSee - ) - span.icon - i.fas.fa-arrow-up - td(data-label=lang('WISHLIST_MOVE_ITEM_DOWN')) - form.downForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/down/${item.id}`) - .field.inline - .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;', - disabled=index === lastCanSee - ) - span.icon - i.fas.fa-arrow-down - else - td(data-label=lang('WISHLIST_PLEDGE')) - if req.params.user !== req.user._id && !item.pledgedBy - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/pledge/${item.id}`) - .field.inline - .control.inline - input.inline.button.is-primary(type='submit' value=lang('WISHLIST_PLEDGE_ITEM')) - if item.pledgedBy === req.user._id - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/unpledge/${item.id}`) - .field.inline - .control.inline - input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) - if item.pledgedBy && item.pledgedBy !== req.user._id - span.ugc=lang('WISHLIST_PLEDGED', item.pledgedBy) - td(data-label='Delete Item') - form.inline( - method='POST', - action=`${_CC.config.base}wishlist/${req.params.user}/${req.user._id === req.params.user ? 'remove' : 'unpledge'}/${item.id}` - ) - .field.inline - .control.inline - button.button.is-text( - type='submit', - style='text-decoration: none;', - disabled=item.addedBy !== req.user._id - ) - span.icon - i.fas.fa-trash - - else - each item, index in wishlist - if req.user._id === item.addedBy || req.params.user !== req.user._id - .box - if item.price - .tag - i.fas.fa-tag(style='margin-right: .5em;') - span= item.price - span.overflowWrap - if item.price - span= ' ' - if item.url - a( - href=item.url, - rel='noopener noreferrer', - target='_blank' - )= (item.name ? item.name : item.url) - else - span= item.name - hr - if item.note || item.image - .columns - if item.image - .column - figure(style='width: 100%; padding: 2em;') - img(src=item.image, style='width: 100%;') - .column.is-three-quarters - if item.note - textarea.textarea.has-fixed-size( - style='height: 100%;' - readonly - )= item.note - span.overflowWrap=lang('WISHLIST_ADDED_BY', item.addedBy) - hr - div - if req.params.user !== req.user._id && !item.pledgedBy - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/pledge/${item.id}`) - .field.inline - .control.inline - input.inline.button.is-primary(type='submit' value=lang('WISHLIST_PLEDGE')) - if item.pledgedBy === req.user._id - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/unpledge/${item.id}`) - .field.inline - .control.inline - input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) - if req.user._id === req.params.user - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/remove/${item.id}`) - .field.inline - .control.inline - input.inline.button.is-warning(type='submit' value=lang('WISHLIST_DELETE')) - if req.user._id === req.params.user || req.user._id === item.addedBy - form.inline(method='GET', action=`${_CC.config.base}wishlist/${req.params.user}/note/${item.id}`) - .field.inline - .control.inline - input.inline.button(type='submit', value=lang('WISHLIST_EDIT_ITEM')) - if index !== firstCanSee && req.user._id === req.params.user - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/up/${item.id}`) - .field.inline - .control.inline - input.inline.button(type='submit' value=lang('WISHLIST_MOVE_ITEM_UP')) - if index !== lastCanSee && req.user._id === req.params.user - form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/down/${item.id}`) - .field.inline - .control.inline - input.inline.button(type='submit' value=lang('WISHLIST_MOVE_ITEM_DOWN')) - form(method='POST') - .field - label.label!=lang('WISHLIST_URL_LABEL') - .control.has-icons-left - input.input( - type='text', - name='itemUrlOrName', - placeholder=lang('WISHLIST_URL_PLACEHOLDER') - ) - span.icon.is-small.is-left - i.fas.fa-gift - .field - label.label= lang('WISHLIST_NOTE') - .control - textarea.textarea( - name='note', - placeholder=lang('WISHLIST_OPTIONAL') - ) - .field - .control - input.button(type='submit' value=(req.user._id === req.params.user ? lang('WISHLIST_ADD') : lang('WISHLIST_PLEDGE_ITEM'))) - script(src=`${_CC.config.base}js/wishlist.js`) - -block print - h1 #{req.params.user}'s Wishlist - .print-gifts - each item, index in wishlist.filter(item => item.addedBy === req.params.user) - .print-gift(style='page-break-inside: avoid;') - if index > 0 - hr(style='margin-top: .5em; margin-bottom: .5em; background-color: black;') - if item.price - .tag - i.fas.fa-tag(style='margin-right: .5em;') - span= item.price - span= ' ' - span.is-size-6.ugc= item.name - span= ' ' - span.ugc.has-text-grey= item.url - span.is-block Added by: #{item.addedBy} - if item.note - .box - if _CC.config.wishlist.note.markdown - span.is-block.ugc!= item.note - else - span.is-block.ugc= item.note From 63289215865387f0c74066dc057659608324f8c8 Mon Sep 17 00:00:00 2001 From: Wingy Date: Mon, 6 Dec 2021 13:39:55 -0500 Subject: [PATCH 6/6] Revert "fixed in #18a1c11" This reverts commit 2bbce4b492b9020e8171884bfaa2234feba887ff. --- views/wishlist.pug | 241 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 views/wishlist.pug diff --git a/views/wishlist.pug b/views/wishlist.pug new file mode 100644 index 0000000..6b2e5c1 --- /dev/null +++ b/views/wishlist.pug @@ -0,0 +1,241 @@ +extends layout.pug + +block title + h1 + .level + .level-left + .level-item + button.button.is-rounded(onclick='this.firstChild.firstChild.classList.add("fa-pulse"); location.reload()') + span.icon + i.fas.fa-sync-alt + .level-item + span= lang('WISHLIST_TITLE', name) + +block content + script(type='data/user_id')= req.user._id + if global._CC.config.wishlist.table + .box + table.table.has-mobile-cards + thead + th # + th(style='width: 15%;')= lang('WISHLIST_IMAGE') + th(style='width: 25%;')= lang('WISHLIST_NAME') + th(style='width: 50%;')= lang('WISHLIST_NOTE') + th(style='width: 10%;')= lang('WISHLIST_PRICE') + th= lang('WISHLIST_EDIT_ITEM') + th= lang('WISHLIST_ADDED_BY') + if req.params.user === req.user._id + th= lang('WISHLIST_MOVE_TOP') + th= lang('WISHLIST_MOVE_UP') + th= lang('WISHLIST_MOVE_DOWN') + else + th= lang('WISHLIST_PLEDGE') + th= lang('WISHLIST_DELETE') + tbody + each item, index in wishlist + if req.user._id === item.addedBy || req.params.user !== req.user._id + tr(id=item.id) + td.rank= index + 1 + td + figure(style='width: 100%; margin: 0;') + img(src=item.image, style='width: 100%; max-height: 20em; object-fit: contain;') + if item.url + td.ugc(data-label='Name') + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) + else + td.ugc(data-label=lang('WISHLIST_NAME'))= item.name + if _CC.config.wishlist.note.markdown + td.ugc(data-label=lang('WISHLIST_NOTE')) + div!= item.note + else + td.ugc(data-label=lang('WISHLIST_NOTE'))= item.note + td.ugc(data-label=lang('WISHLIST_PRICE'))= item.price + td(data-label=lang('WISHLIST_EDIT_ITEM')) + form.inline(method='GET', action=`${_CC.config.base}wishlist/${req.params.user}/note/${item.id}`) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;' + disabled=item.addedBy !== req.user._id + ) + span.icon + i.far.fa-edit + td.ugc(data-label=lang('WISHLIST_ADDED_BY'))= item.addedBy + if req.params.user === req.user._id + td(data-label=lang('WISHLIST_MOVE_ITEM_TOP')) + form.topForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/top/${item.id}`) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;', + disabled=index === firstCanSee + ) + span.icon + i.fas.fa-angle-double-up + td(data-label=lang('WISHLIST_MOVE_ITEM_UP')) + form.upForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/up/${item.id}`) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;', + disabled=index === firstCanSee + ) + span.icon + i.fas.fa-arrow-up + td(data-label=lang('WISHLIST_MOVE_ITEM_DOWN')) + form.downForm.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/down/${item.id}`) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;', + disabled=index === lastCanSee + ) + span.icon + i.fas.fa-arrow-down + else + td(data-label=lang('WISHLIST_PLEDGE')) + if req.params.user !== req.user._id && !item.pledgedBy + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/pledge/${item.id}`) + .field.inline + .control.inline + input.inline.button.is-primary(type='submit' value=lang('WISHLIST_PLEDGE_ITEM')) + if item.pledgedBy === req.user._id + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/unpledge/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) + if item.pledgedBy && item.pledgedBy !== req.user._id + span.ugc=lang('WISHLIST_PLEDGED', item.pledgedBy) + td(data-label='Delete Item') + form.inline( + method='POST', + action=`${_CC.config.base}wishlist/${req.params.user}/${req.user._id === req.params.user ? 'remove' : 'unpledge'}/${item.id}` + ) + .field.inline + .control.inline + button.button.is-text( + type='submit', + style='text-decoration: none;', + disabled=item.addedBy !== req.user._id + ) + span.icon + i.fas.fa-trash + + else + each item, index in wishlist + if req.user._id === item.addedBy || req.params.user !== req.user._id + .box + if item.price + .tag + i.fas.fa-tag(style='margin-right: .5em;') + span= item.price + span.overflowWrap + if item.price + span= ' ' + if item.url + a( + href=item.url, + rel='noopener noreferrer', + target='_blank' + )= (item.name ? item.name : item.url) + else + span= item.name + hr + if item.note || item.image + .columns + if item.image + .column + figure(style='width: 100%; padding: 2em;') + img(src=item.image, style='width: 100%;') + .column.is-three-quarters + if item.note + textarea.textarea.has-fixed-size( + style='height: 100%;' + readonly + )= item.note + span.overflowWrap=lang('WISHLIST_ADDED_BY', item.addedBy) + hr + div + if req.params.user !== req.user._id && !item.pledgedBy + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/pledge/${item.id}`) + .field.inline + .control.inline + input.inline.button.is-primary(type='submit' value=lang('WISHLIST_PLEDGE')) + if item.pledgedBy === req.user._id + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/unpledge/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit' value=lang('WISHLIST_UNPLEDGE')) + if req.user._id === req.params.user + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/remove/${item.id}`) + .field.inline + .control.inline + input.inline.button.is-warning(type='submit' value=lang('WISHLIST_DELETE')) + if req.user._id === req.params.user || req.user._id === item.addedBy + form.inline(method='GET', action=`${_CC.config.base}wishlist/${req.params.user}/note/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit', value=lang('WISHLIST_EDIT_ITEM')) + if index !== firstCanSee && req.user._id === req.params.user + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/up/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit' value=lang('WISHLIST_MOVE_ITEM_UP')) + if index !== lastCanSee && req.user._id === req.params.user + form.inline(method='POST', action=`${_CC.config.base}wishlist/${req.params.user}/move/down/${item.id}`) + .field.inline + .control.inline + input.inline.button(type='submit' value=lang('WISHLIST_MOVE_ITEM_DOWN')) + form(method='POST') + .field + label.label!=lang('WISHLIST_URL_LABEL') + .control.has-icons-left + input.input( + type='text', + name='itemUrlOrName', + placeholder=lang('WISHLIST_URL_PLACEHOLDER') + ) + span.icon.is-small.is-left + i.fas.fa-gift + .field + label.label= lang('WISHLIST_NOTE') + .control + textarea.textarea( + name='note', + placeholder=lang('WISHLIST_OPTIONAL') + ) + .field + .control + input.button(type='submit' value=(req.user._id === req.params.user ? lang('WISHLIST_ADD') : lang('WISHLIST_PLEDGE_ITEM'))) + script(src=`${_CC.config.base}js/wishlist.js`) + +block print + h1 #{req.params.user}'s Wishlist + .print-gifts + each item, index in wishlist.filter(item => item.addedBy === req.params.user) + .print-gift(style='page-break-inside: avoid;') + if index > 0 + hr(style='margin-top: .5em; margin-bottom: .5em; background-color: black;') + if item.price + .tag + i.fas.fa-tag(style='margin-right: .5em;') + span= item.price + span= ' ' + span.is-size-6.ugc= item.name + span= ' ' + span.ugc.has-text-grey= item.url + span.is-block Added by: #{item.addedBy} + if item.note + .box + if _CC.config.wishlist.note.markdown + span.is-block.ugc!= item.note + else + span.is-block.ugc= item.note