Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ BULMASWATCH=default
UPDATE_CHECK=true
# Set to false to disable the profile pictures feature
PFP=true
# Set to true to never hide progress bars
ALWAYS_SHOW_PROGRESS_BARS=false
# Language of the interface, options listed in `languages` directory
LANGUAGE=en-US

Expand Down Expand Up @@ -133,4 +135,4 @@ As of writing, there are no code contributors to the main project. However, ther
* Czech: [drSchaps](https://github.com/drSchaps)
* German: [PeteS4](https://github.com/PeteS4)
* French: [zethis](https://github.com/zethis)
* Spanish: [CantisW](https://github.com/CantisW)
* Spanish: [CantisW](https://github.com/CantisW)
3 changes: 2 additions & 1 deletion config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module.exports = {
bulmaswatch: (process.env.BULMASWATCH || 'default').toLowerCase(),
pfp: process.env.PFP !== 'false',
language: process.env.LANGUAGE?.toLowerCase() || 'en-us',
guestPassword: process.env.GUEST_PASSWORD
guestPassword: process.env.GUEST_PASSWORD,
alwaysShowProgressBars: process.env.ALWAYS_SHOW_PROGRESS_BARS === 'true'
}

if (module.exports.guestPassword) module.exports.wishlist.public = false
2 changes: 0 additions & 2 deletions languages/cs-cz.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'Jméno položky nebo odkaz na ni (odkazy na CZ obchody nefunkční) (<a href="/supported-sites">Podporované obchody</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: 'Nevyplněna položka nebo odkaz na ni.',
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Seznamy přání`
}
2 changes: 0 additions & 2 deletions languages/de-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'URL oder Name (<a href="/supported-sites">Unterstützte Seiten</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
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`
}
4 changes: 2 additions & 2 deletions languages/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'Item URL or Name (<a href="/supported-sites">Supported Sites</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: 'Item URL or Name is required',
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_HIDE: 'Hide progress bars',
WISHLISTS_SHOW: 'Show progress bars (make sure nobody else is watching!)',
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Wishlists`
}
2 changes: 0 additions & 2 deletions languages/es-es.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'Nombre de producto o URL (<a href="/supported-sites">Sitios web compatibles</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: 'Necesita un nombre de producto o URL',
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Listas de deseo`
}
2 changes: 0 additions & 2 deletions languages/fr-ca.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'URL ou nom de l\'article (<a href="/supported-sites">Sites supportés</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: "L'URL ou le nom de l'article est requis",
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Listes de souhaits`,
}
2 changes: 0 additions & 2 deletions languages/fr-fr.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'URL ou nom de l\'article (<a href="/supported-sites">Sites supportés</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: "L'URL ou le nom de l'article est requis",
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Listes d'envies`
}
2 changes: 0 additions & 2 deletions languages/ro-ro.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,5 @@ module.exports.strings = {
WISHLIST_URL_LABEL: 'URL-ul sau numele articolului (<a href="/supported-sites">Site-uri Suportate</a>)',
WISHLIST_URL_PLACEHOLDER: 'https://www.amazon.com/dp/B00ZV9RDKK',
WISHLIST_URL_REQUIRED: 'URL-ul sau numele articolului trebuie completat',
WISHLISTS_COUNTS_SELF: name => `${name}: ???/???`,
WISHLISTS_COUNTS: (name, pledged, total) => `${name}: ${pledged}/${total}`,
WISHLISTS_TITLE: `${_CC.config.siteTitle} - Liste cu Dorințe`
}
20 changes: 20 additions & 0 deletions static/js/wishlists.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
function hide() {
document.querySelectorAll('.progressbar').forEach((element) => {
element.classList.add('hidden')
})
document.querySelector('#showButton').classList.remove('hidden')
this.classList.add('hidden')
}

function show() {
document.querySelectorAll('.progressbar').forEach((element) => {
element.classList.remove('hidden')
})
document.querySelector('#hideButton').classList.remove('hidden')
this.classList.add('hidden')
}

setTimeout(() => {
document.querySelector('#hideButton').addEventListener('click', hide)
document.querySelector('#showButton').addEventListener('click', show)
}, 0)
24 changes: 16 additions & 8 deletions views/wishlists.pug
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ mixin wishlistDetails(wishlist, onlyShowAddedByUser)
li= item.name

block content
unless config.alwaysShowProgressBars
style.
.hidden {
display: none
}
script(src=`${_CC.config.base}js/wishlists.js`)
#hideButton.button.hidden= lang('WISHLISTS_HIDE')
#showButton.button= lang('WISHLISTS_SHOW')
style.
.wishlist-dropdown-container-unloaded {
display: none;
Expand Down Expand Up @@ -43,7 +51,6 @@ block content
.wishlist-dropdown-container.wishlist-dropdown-container-active .fa-chevron-down {
display: inline-block;
}

ul.noStyle.noLeftMargin
if req.user._id !== '_CCUNKNOWN'
li
Expand All @@ -54,9 +61,9 @@ block content
.column.is-1(style='overflow: hidden; padding: 0 0.5rem 0 0;')
figure.image.is-square.is-fullwidth.is-marginless(style='display: inline-block;')
img.is-rounded.is-fullwidth(src=req.user.pfp, style='object-fit: cover;')
.column
span
span=lang('WISHLISTS_COUNTS_SELF', req.user._id)
.column= `${req.user._id} `
span.progressbar.hidden
span= '???/???'
progress.progress(value=1, max=1)
+wishlistDetails(req.user.wishlist, req.user._id)
each user in users
Expand All @@ -69,9 +76,10 @@ block content
.column.is-1(style='overflow: hidden; padding: 0 0.5rem 0 0;')
figure.image.is-square.is-fullwidth.is-marginless(style='display: inline-block;')
img.is-rounded.is-fullwidth(src=user.doc.pfp, style='object-fit: cover;')
.column
span= lang('WISHLISTS_COUNTS', user.id, totals(user.doc.wishlist).pledged, user.doc.wishlist.length)
progress.progress.is-info(value=totals(user.doc.wishlist).pledged, max=user.doc.wishlist.length)
.column= `${user.id} `
span.progressbar.hidden
span= `${totals(user.doc.wishlist).pledged}/${user.doc.wishlist.length}`
progress.progress.is-info(value=totals(user.doc.wishlist).pledged, max=user.doc.wishlist.length)
+wishlistDetails(user.doc.wishlist)
script.
document.querySelectorAll('.wishlist-dropdown-button')
Expand All @@ -81,4 +89,4 @@ block content
})
})
document.querySelectorAll('.wishlist-dropdown-container-unloaded')
.forEach(container => container.classList.remove('wishlist-dropdown-container-unloaded'))
.forEach(container => container.classList.remove('wishlist-dropdown-container-unloaded'))