Merge branch 'main' into book-file-links

This commit is contained in:
Mouse Reeve 2022-01-09 13:15:58 -08:00
commit 4931e5cad2
31 changed files with 12128 additions and 2545 deletions

View file

@ -14,6 +14,7 @@ def populate_lists_streams():
for user in users: for user in users:
print(".", end="") print(".", end="")
lists_stream.populate_lists_task.delay(user.id) lists_stream.populate_lists_task.delay(user.id)
print("\nAll done, thank you for your patience!")
class Command(BaseCommand): class Command(BaseCommand):

View file

@ -0,0 +1,36 @@
# Generated by Django 3.2.10 on 2022-01-09 01:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0124_auto_20220106_1759"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("it-it", "Italiano (Italian)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("no-no", "Norsk (Norwegian)"),
("pt-br", "Português do Brasil (Brazilian Portuguese)"),
("pt-pt", "Português Europeu (European Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -196,8 +196,10 @@ LANGUAGES = [
("de-de", _("Deutsch (German)")), ("de-de", _("Deutsch (German)")),
("es-es", _("Español (Spanish)")), ("es-es", _("Español (Spanish)")),
("gl-es", _("Galego (Galician)")), ("gl-es", _("Galego (Galician)")),
("it-it", _("Italiano (Italian)")),
("fr-fr", _("Français (French)")), ("fr-fr", _("Français (French)")),
("lt-lt", _("Lietuvių (Lithuanian)")), ("lt-lt", _("Lietuvių (Lithuanian)")),
("no-no", _("Norsk (Norwegian)")),
("pt-br", _("Português do Brasil (Brazilian Portuguese)")), ("pt-br", _("Português do Brasil (Brazilian Portuguese)")),
("pt-pt", _("Português Europeu (European Portuguese)")), ("pt-pt", _("Português Europeu (European Portuguese)")),
("zh-hans", _("简体中文 (Simplified Chinese)")), ("zh-hans", _("简体中文 (Simplified Chinese)")),
@ -220,6 +222,7 @@ USER_AGENT = f"{agent} (BookWyrm/{VERSION}; +https://{DOMAIN}/)"
# Imagekit generated thumbnails # Imagekit generated thumbnails
ENABLE_THUMBNAIL_GENERATION = env.bool("ENABLE_THUMBNAIL_GENERATION", False) ENABLE_THUMBNAIL_GENERATION = env.bool("ENABLE_THUMBNAIL_GENERATION", False)
IMAGEKIT_CACHEFILE_DIR = "thumbnails" IMAGEKIT_CACHEFILE_DIR = "thumbnails"
IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY = "bookwyrm.thumbnail_generation.Strategy"
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.2/howto/static-files/ # https://docs.djangoproject.com/en/3.2/howto/static-files/

View file

@ -21,7 +21,7 @@
<p class="subtitle notification has-background-primary-light"> <p class="subtitle notification has-background-primary-light">
{% blocktrans trimmed with site_name=site.name %} {% blocktrans trimmed with site_name=site.name %}
{{ site_name }} is part of <em>BookWyrm</em>, a network of independent, self-directed communities for readers. {{ site_name }} is part of <em>BookWyrm</em>, a network of independent, self-directed communities for readers.
While you can interact seemlessly with users anywhere in the <a href="https://joinbookwyrm.com/instances/" target="_blank">BookWyrm network</a>, this community is unique. While you can interact seamlessly with users anywhere in the <a href="https://joinbookwyrm.com/instances/" target="_blank">BookWyrm network</a>, this community is unique.
{% endblocktrans %} {% endblocktrans %}
</p> </p>

View file

@ -168,7 +168,7 @@
<div class="column is-3"> <div class="column is-3">
{% trans "…and the longest" %} {% trans "…and the longest" %}
<p class="title is-4 is-serif is-italic"> <p class="title is-4 is-serif is-italic">
<a href="{{ book_pages_lowest.local_path }}" class="has-text-success-dark"> <a href="{{ book_pages_highest.local_path }}" class="has-text-success-dark">
{{ book_pages_highest.title }} {{ book_pages_highest.title }}
</a> </a>
</p> </p>

View file

@ -0,0 +1,20 @@
"""thumbnail generation strategy for django-imagekit"""
class Strategy:
"""
A strategy that generates the image on source saved (Optimistic),
but also on demand, for old images (JustInTime).
"""
def on_source_saved(self, file): # pylint: disable=no-self-use
"""What happens on source saved"""
file.generate()
def on_existence_required(self, file): # pylint: disable=no-self-use
"""What happens on existence required"""
file.generate()
def on_content_required(self, file): # pylint: disable=no-self-use
"""What happens on content required"""
file.generate()

View file

@ -19,7 +19,9 @@ def about(request):
"status_count": models.Status.objects.filter( "status_count": models.Status.objects.filter(
user__local=True, deleted=False user__local=True, deleted=False
).count(), ).count(),
"admins": models.User.objects.filter(groups__name__in=["admin", "moderator"]), "admins": models.User.objects.filter(
groups__name__in=["admin", "moderator"]
).distinct(),
"version": settings.VERSION, "version": settings.VERSION,
} }

2
bw-dev
View file

@ -114,7 +114,9 @@ case "$CMD" in
git checkout l10n_main locale/es_ES git checkout l10n_main locale/es_ES
git checkout l10n_main locale/fr_FR git checkout l10n_main locale/fr_FR
git checkout l10n_main locale/gl_ES git checkout l10n_main locale/gl_ES
git checkout l10n_main locale/it_IT
git checkout l10n_main locale/lt_LT git checkout l10n_main locale/lt_LT
git checkout l10n_main locale/no_NO
git checkout l10n_main locale/pt_PT git checkout l10n_main locale/pt_PT
git checkout l10n_main locale/pt_BR git checkout l10n_main locale/pt_BR
git checkout l10n_main locale/zh_Hans git checkout l10n_main locale/zh_Hans

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff

Binary file not shown.

File diff suppressed because it is too large Load diff