From e09e78be2574504c5f1b997d1178f5d97bfc811a Mon Sep 17 00:00:00 2001
From: Henri Dickson <90480431+alphatownsman@users.noreply.github.com>
Date: Thu, 30 May 2024 00:35:57 -0400
Subject: [PATCH] i18n for discover page
---
catalog/jobs/discover.py | 3 +--
catalog/templates/discover.html | 2 +-
common/static/scss/_item.scss | 6 +++++-
locale/zh_Hans/LC_MESSAGES/django.po | 2 +-
neodb.env.example | 11 ++++-------
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/catalog/jobs/discover.py b/catalog/jobs/discover.py
index f176fcff..62cd731e 100644
--- a/catalog/jobs/discover.py
+++ b/catalog/jobs/discover.py
@@ -88,8 +88,7 @@ class DiscoverGenerator(BaseJob):
gallery_list.append(
{
"name": "popular_" + category.value,
- "title": ""
- + (category.label if category != ItemCategory.Book else _("Book")),
+ "category": category,
"items": items,
}
)
diff --git a/catalog/templates/discover.html b/catalog/templates/discover.html
index 37a9c1c5..04a7ea94 100644
--- a/catalog/templates/discover.html
+++ b/catalog/templates/discover.html
@@ -51,7 +51,7 @@
then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})">
-
{{ gallery.title }}
+ {{ gallery.category.label }}
{% for item in gallery.items %}
-
diff --git a/common/static/scss/_item.scss b/common/static/scss/_item.scss
index 9984c8d7..0d07bb98 100644
--- a/common/static/scss/_item.scss
+++ b/common/static/scss/_item.scss
@@ -111,13 +111,17 @@
align-items: center;
}
- .item-action button {
+ .item-mark-buttons button {
margin-left: 0.2em;
margin-right: 0.2em;
max-width: 31%;
white-space: nowrap;
}
+ .mark button.edit {
+ min-width: 75%;
+ }
+
.mark {
text-align: center;
}
diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po
index af0daf63..b3bda62d 100644
--- a/locale/zh_Hans/LC_MESSAGES/django.po
+++ b/locale/zh_Hans/LC_MESSAGES/django.po
@@ -291,7 +291,7 @@ msgstr "苹果播客"
#: common/templates/_header.html:25
#: journal/templates/_sidebar_user_mark_list.html:31
msgid "Book"
-msgstr "书"
+msgstr "图书"
#: catalog/common/models.py:127
msgid "TV Serie"
diff --git a/neodb.env.example b/neodb.env.example
index b89eba52..580ac1ac 100644
--- a/neodb.env.example
+++ b/neodb.env.example
@@ -7,14 +7,15 @@ NEODB_SECRET_KEY=change_me
NEODB_SITE_NAME=Example Site
NEODB_SITE_DOMAIN=example.site
-# Change these too
+# Change these to customize your site
NEODB_SITE_INTRO=/welcome.html
NEODB_SITE_LOGO=/logo.png
NEODB_SITE_ICON=/icon.png
NEODB_SITE_LINKS=@NiceDB=https://donotban.com/@testie,@NeoDB=https://mastodon.social/@neodb
-# Turn off DEBUG only when you are ready for production service
-# NEODB_DEBUG=False
+# Uncomment these if you are doing development
+# NEODB_DEBUG=True
+# NEODB_IMAGE=neodb/neodb:edge
# HTTP port your reverse proxy should send request to
# NEODB_PORT=8000
@@ -30,7 +31,3 @@ NEODB_SITE_LINKS=@NiceDB=https://donotban.com/@testie,@NeoDB=https://mastodon.so
# TAKAHE_WEB_WORKER_NUM=32
# TAKAHE_STATOR_CONCURRENCY=10
# TAKAHE_STATOR_CONCURRENCY_PER_MODEL=10
-
-# pull NeoDB Docker image from a specific tag
-# see available tags: https://hub.docker.com/r/neodb/neodb/tags
-# NEODB_IMAGE=neodb/neodb:main