diff --git a/Dockerfile b/Dockerfile index 1892ae234..349dd82b1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,4 +8,4 @@ WORKDIR /app COPY requirements.txt /app/ RUN pip install -r requirements.txt --no-cache-dir -RUN apt-get update && apt-get install -y gettext libgettextpo-dev && apt-get clean +RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index b9b93694c..5acde9ea6 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -29,8 +29,7 @@ class CustomForm(ModelForm): input_type = visible.field.widget.input_type if isinstance(visible.field.widget, Textarea): input_type = "textarea" - visible.field.widget.attrs["cols"] = None - visible.field.widget.attrs["rows"] = None + visible.field.widget.attrs["rows"] = 5 visible.field.widget.attrs["class"] = css_classes[input_type] @@ -269,7 +268,7 @@ class CreateInviteForm(CustomForm): class ShelfForm(CustomForm): class Meta: model = models.Shelf - fields = ["user", "name", "privacy"] + fields = ["user", "name", "privacy", "description"] class GoalForm(CustomForm): diff --git a/bookwyrm/migrations/0100_shelf_description.py b/bookwyrm/migrations/0100_shelf_description.py new file mode 100644 index 000000000..18185b17d --- /dev/null +++ b/bookwyrm/migrations/0100_shelf_description.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-09-28 23:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0099_readthrough_is_active"), + ] + + operations = [ + migrations.AddField( + model_name="shelf", + name="description", + field=models.TextField(blank=True, max_length=500, null=True), + ), + ] diff --git a/bookwyrm/models/shelf.py b/bookwyrm/models/shelf.py index 89ea9471d..c578f0827 100644 --- a/bookwyrm/models/shelf.py +++ b/bookwyrm/models/shelf.py @@ -21,6 +21,7 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel): name = fields.CharField(max_length=100) identifier = models.CharField(max_length=100) + description = models.TextField(blank=True, null=True, max_length=500) user = fields.ForeignKey( "User", on_delete=models.PROTECT, activitypub_field="owner" ) @@ -52,6 +53,11 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel): """list of books for this shelf, overrides OrderedCollectionMixin""" return self.books.order_by("shelfbook") + @property + def deletable(self): + """can the shelf be safely deleted?""" + return self.editable and not self.shelfbook_set.exists() + def get_remote_id(self): """shelf identifier instead of id""" base_path = self.user.remote_id @@ -61,7 +67,7 @@ class Shelf(OrderedCollectionMixin, BookWyrmModel): def raise_not_deletable(self, viewer): """don't let anyone delete a default shelf""" super().raise_not_deletable(viewer) - if not self.editable: + if not self.deletable: raise PermissionDenied() class Meta: diff --git a/bookwyrm/templates/book/edit_book.html b/bookwyrm/templates/book/edit_book.html index 2f6ca3242..18cf66710 100644 --- a/bookwyrm/templates/book/edit_book.html +++ b/bookwyrm/templates/book/edit_book.html @@ -236,14 +236,12 @@ {{ form.cover }} - {% if book %}
- +
- {% endif %} {% for error in form.cover.errors %}

{{ error | escape }}

{% endfor %} diff --git a/bookwyrm/templates/directory/community_filter.html b/bookwyrm/templates/directory/community_filter.html index bd0ba7785..91783fd36 100644 --- a/bookwyrm/templates/directory/community_filter.html +++ b/bookwyrm/templates/directory/community_filter.html @@ -8,7 +8,7 @@ {% trans "Local users" %} {% endblock %} diff --git a/bookwyrm/templates/directory/sort_filter.html b/bookwyrm/templates/directory/sort_filter.html index 82b561fb7..c7c19f6fe 100644 --- a/bookwyrm/templates/directory/sort_filter.html +++ b/bookwyrm/templates/directory/sort_filter.html @@ -5,8 +5,8 @@
{% endblock %} diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index bf7a7f23e..ce3eee2ba 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -117,7 +117,7 @@ {% if perms.bookwyrm.create_invites or perms.moderate_user %} - + {% endif %} {% if perms.bookwyrm.create_invites and not site.allow_registration %}
  • @@ -133,7 +133,7 @@
  • {% endif %} - +
  • {% trans 'Log out' %} diff --git a/bookwyrm/templates/preferences/blocks.html b/bookwyrm/templates/preferences/blocks.html index 699bfb7e1..f667a0cd6 100644 --- a/bookwyrm/templates/preferences/blocks.html +++ b/bookwyrm/templates/preferences/blocks.html @@ -9,7 +9,7 @@ {% block panel %} {% if not request.user.blocks.exists %} -

    {% trans "No users currently blocked." %}

    +

    {% trans "No users currently blocked." %}

    {% else %}
    -{% include 'user_admin/user_admin_filters.html' %} +{% include 'settings/users/user_admin_filters.html' %}
    {% if not reports %} @@ -39,7 +39,7 @@ {% for report in reports %}
    - {% include 'moderation/report_preview.html' with report=report %} + {% include 'settings/reports/report_preview.html' with report=report %}
    {% endfor %}
    diff --git a/bookwyrm/templates/settings/site.html b/bookwyrm/templates/settings/site.html index 508954857..da5b7705f 100644 --- a/bookwyrm/templates/settings/site.html +++ b/bookwyrm/templates/settings/site.html @@ -5,36 +5,46 @@ {% block header %}{% trans "Site Settings" %}{% endblock %} -{% block panel %} +{% block site-subtabs %} + +{% endblock %} +{% block panel %} {% csrf_token %}

    {% trans "Instance Info" %}

    -
    - - {{ site_form.name }} -
    -
    - - {{ site_form.instance_tagline }} -
    -
    - - {{ site_form.instance_description }} -
    -
    - -

    {% trans "Used when the instance is previewed on joinbookwyrm.com. Does not support html or markdown." %}

    - {{ site_form.instance_short_description }} -
    -
    - - {{ site_form.code_of_conduct }} -
    -
    - - {{ site_form.privacy_policy }} +
    +
    + + {{ site_form.name }} +
    +
    + + {{ site_form.instance_tagline }} +
    +
    + + {{ site_form.instance_description }} +
    +
    + +

    {% trans "Used when the instance is previewed on joinbookwyrm.com. Does not support html or markdown." %}

    + {{ site_form.instance_short_description }} +
    +
    + + {{ site_form.code_of_conduct }} +
    +
    + + {{ site_form.privacy_policy }} +
    @@ -42,16 +52,16 @@

    {% trans "Images" %}

    -
    -
    +
    +
    {{ site_form.logo }}
    -
    +
    {{ site_form.logo_small }}
    -
    +
    {{ site_form.favicon }}
    @@ -62,21 +72,23 @@ @@ -84,35 +96,37 @@

    {% trans "Registration" %}

    -
    - -
    -
    - -
    -
    - -

    {% trans "(Recommended if registration is open)" %}

    -
    -
    - - {{ site_form.registration_closed_text }} -
    -
    - - {{ site_form.invite_request_text }} - {% for error in site_form.invite_request_text.errors %} -

    {{ error|escape }}

    - {% endfor %} +
    +
    + +
    +
    + +
    +
    + +

    {% trans "(Recommended if registration is open)" %}

    +
    +
    + + {{ site_form.registration_closed_text }} +
    +
    + + {{ site_form.invite_request_text }} + {% for error in site_form.invite_request_text.errors %} +

    {{ error|escape }}

    + {% endfor %} +
    diff --git a/bookwyrm/templates/user_admin/delete_user_form.html b/bookwyrm/templates/settings/users/delete_user_form.html similarity index 100% rename from bookwyrm/templates/user_admin/delete_user_form.html rename to bookwyrm/templates/settings/users/delete_user_form.html diff --git a/bookwyrm/templates/user_admin/server_filter.html b/bookwyrm/templates/settings/users/server_filter.html similarity index 100% rename from bookwyrm/templates/user_admin/server_filter.html rename to bookwyrm/templates/settings/users/server_filter.html diff --git a/bookwyrm/templates/settings/users/user.html b/bookwyrm/templates/settings/users/user.html new file mode 100644 index 000000000..676502e6d --- /dev/null +++ b/bookwyrm/templates/settings/users/user.html @@ -0,0 +1,16 @@ +{% extends 'settings/layout.html' %} +{% load i18n %} + +{% block title %}{{ user.username }}{% endblock %} +{% block header %} +{{ user.username }} +{% trans "Back to users" %} +{% endblock %} + +{% block panel %} +{% include 'settings/users/user_info.html' with user=user %} + +{% include 'settings/users/user_moderation_actions.html' with user=user %} + +{% endblock %} + diff --git a/bookwyrm/templates/user_admin/user_admin.html b/bookwyrm/templates/settings/users/user_admin.html similarity index 97% rename from bookwyrm/templates/user_admin/user_admin.html rename to bookwyrm/templates/settings/users/user_admin.html index 024ebfecf..874ce8182 100644 --- a/bookwyrm/templates/user_admin/user_admin.html +++ b/bookwyrm/templates/settings/users/user_admin.html @@ -13,7 +13,7 @@ {% block panel %} -{% include 'user_admin/user_admin_filters.html' %} +{% include 'settings/users/user_admin_filters.html' %} diff --git a/bookwyrm/templates/user_admin/user_admin_filters.html b/bookwyrm/templates/settings/users/user_admin_filters.html similarity index 59% rename from bookwyrm/templates/user_admin/user_admin_filters.html rename to bookwyrm/templates/settings/users/user_admin_filters.html index c9c7a93fc..48a3b7c8a 100644 --- a/bookwyrm/templates/user_admin/user_admin_filters.html +++ b/bookwyrm/templates/settings/users/user_admin_filters.html @@ -1,7 +1,7 @@ {% extends 'snippets/filters_panel/filters_panel.html' %} {% block filter_fields %} -{% include 'user_admin/username_filter.html' %} +{% include 'settings/users/username_filter.html' %} {% include 'directory/community_filter.html' %} -{% include 'user_admin/server_filter.html' %} +{% include 'settings/users/server_filter.html' %} {% endblock %} diff --git a/bookwyrm/templates/user_admin/user_info.html b/bookwyrm/templates/settings/users/user_info.html similarity index 57% rename from bookwyrm/templates/user_admin/user_info.html rename to bookwyrm/templates/settings/users/user_info.html index 7ad57e0ef..8d332b1ae 100644 --- a/bookwyrm/templates/user_admin/user_info.html +++ b/bookwyrm/templates/settings/users/user_info.html @@ -48,58 +48,42 @@
    {% if user.local %} -
    -
    {% trans "Email:" %}
    -
    {{ user.email }}
    -
    +
    {% trans "Email:" %}
    +
    {{ user.email }}
    {% endif %} {% with report_count=user.report_set.count %} -
    -
    {% trans "Reports:" %}
    -
    - {{ report_count|intcomma }} - {% if report_count > 0 %} - - {% trans "(View reports)" %} - - {% endif %} -
    -
    +
    {% trans "Reports:" %}
    +
    + {{ report_count|intcomma }} + {% if report_count > 0 %} + + {% trans "(View reports)" %} + + {% endif %} +
    {% endwith %} -
    -
    {% trans "Blocked by count:" %}
    -
    {{ user.blocked_by.count }}
    -
    +
    {% trans "Blocked by count:" %}
    +
    {{ user.blocked_by.count }}
    -
    -
    {% trans "Last active date:" %}
    -
    {{ user.last_active_date }}
    -
    +
    {% trans "Last active date:" %}
    +
    {{ user.last_active_date }}
    -
    -
    {% trans "Manually approved followers:" %}
    -
    {{ user.manually_approves_followers }}
    -
    +
    {% trans "Manually approved followers:" %}
    +
    {{ user.manually_approves_followers }}
    -
    -
    {% trans "Discoverable:" %}
    -
    {{ user.discoverable }}
    -
    +
    {% trans "Discoverable:" %}
    +
    {{ user.discoverable }}
    {% if not user.is_active %} -
    -
    {% trans "Deactivation reason:" %}
    -
    {{ user.deactivation_reason }}
    -
    +
    {% trans "Deactivation reason:" %}
    +
    {{ user.deactivation_reason }}
    {% endif %} {% if not user.is_active and user.deactivation_reason == "pending" %} -
    -
    {% trans "Confirmation code:" %}
    -
    {{ user.confirmation_code }}
    -
    +
    {% trans "Confirmation code:" %}
    +
    {{ user.confirmation_code }}
    {% endif %}
    @@ -113,18 +97,14 @@ {% if server %}
    {{ server.server_name }}
    -
    -
    {% trans "Software:" %}
    -
    {{ server.application_type }}
    -
    -
    -
    {% trans "Version:" %}
    -
    {{ server.application_version }}
    -
    -
    -
    {% trans "Status:" %}
    -
    {{ server.status }}
    -
    +
    {% trans "Software:" %}
    +
    {{ server.application_type }}
    + +
    {% trans "Version:" %}
    +
    {{ server.application_version }}
    + +
    {% trans "Status:" %}
    +
    {{ server.status }}
    {% if server.notes %}
    {% trans "Notes" %}
    diff --git a/bookwyrm/templates/user_admin/user_moderation_actions.html b/bookwyrm/templates/settings/users/user_moderation_actions.html similarity index 95% rename from bookwyrm/templates/user_admin/user_moderation_actions.html rename to bookwyrm/templates/settings/users/user_moderation_actions.html index 12b70d3ca..a976359f4 100644 --- a/bookwyrm/templates/user_admin/user_moderation_actions.html +++ b/bookwyrm/templates/settings/users/user_moderation_actions.html @@ -36,7 +36,7 @@ {% if user.local %}
    - {% include "user_admin/delete_user_form.html" with controls_text="delete_user" class="mt-2 mb-2" %} + {% include "settings/users/delete_user_form.html" with controls_text="delete_user" class="mt-2 mb-2" %}
    {% endif %} diff --git a/bookwyrm/templates/user_admin/username_filter.html b/bookwyrm/templates/settings/users/username_filter.html similarity index 100% rename from bookwyrm/templates/user_admin/username_filter.html rename to bookwyrm/templates/settings/users/username_filter.html diff --git a/bookwyrm/templates/shelf/create_shelf_form.html b/bookwyrm/templates/shelf/create_shelf_form.html new file mode 100644 index 000000000..e15e1cc1d --- /dev/null +++ b/bookwyrm/templates/shelf/create_shelf_form.html @@ -0,0 +1,13 @@ +{% extends 'components/inline_form.html' %} +{% load i18n %} + +{% block header %} +{% trans "Create Shelf" %} +{% endblock %} + +{% block form %} + + {% include "shelf/form.html" with editable=shelf.editable form=create_form %} + +{% endblock %} + diff --git a/bookwyrm/templates/shelf/edit_shelf_form.html b/bookwyrm/templates/shelf/edit_shelf_form.html new file mode 100644 index 000000000..5951b6da6 --- /dev/null +++ b/bookwyrm/templates/shelf/edit_shelf_form.html @@ -0,0 +1,13 @@ +{% extends 'components/inline_form.html' %} +{% load i18n %} + +{% block header %} +{% trans "Edit Shelf" %} +{% endblock %} + +{% block form %} + + {% include "shelf/form.html" with editable=shelf.editable form=edit_form privacy=shelf.privacy %} + +{% endblock %} + diff --git a/bookwyrm/templates/shelf/form.html b/bookwyrm/templates/shelf/form.html new file mode 100644 index 000000000..ff7f8b5ee --- /dev/null +++ b/bookwyrm/templates/shelf/form.html @@ -0,0 +1,28 @@ +{% load i18n %} +{% load utilities %} +{% with 0|uuid as uuid %} +{% csrf_token %} + + +{% if editable %} +
    + + +
    +{% else %} + +{% endif %} + +
    + + +
    +
    +
    + {% include 'snippets/privacy_select.html' with current=privacy %} +
    +
    + +
    +
    +{% endwith %} diff --git a/bookwyrm/templates/user/shelf/shelf.html b/bookwyrm/templates/shelf/shelf.html similarity index 70% rename from bookwyrm/templates/user/shelf/shelf.html rename to bookwyrm/templates/shelf/shelf.html index 06507d3ed..88f4b2bb6 100644 --- a/bookwyrm/templates/user/shelf/shelf.html +++ b/bookwyrm/templates/shelf/shelf.html @@ -5,7 +5,7 @@ {% load i18n %} {% block title %} -{% include 'user/shelf/books_header.html' %} +{% include 'user/books_header.html' %} {% endblock %} {% block opengraph_images %} @@ -15,7 +15,7 @@ {% block content %}

    - {% include 'user/shelf/books_header.html' %} + {% include 'user/books_header.html' %}

    @@ -60,45 +60,62 @@
    - {% include 'user/shelf/create_shelf_form.html' with controls_text='create_shelf_form' %} + {% include 'shelf/create_shelf_form.html' with controls_text='create_shelf_form' %}
    -
    -
    -

    - {{ shelf.name }} - - {% include 'snippets/privacy-icons.html' with item=shelf %} - - {% with count=books.paginator.count %} - {% if count %} -

    - {% blocktrans trimmed count counter=count with formatted_count=count|intcomma %} - {{ formatted_count }} book - {% plural %} - {{ formatted_count }} books - {% endblocktrans %} - - {% if books.has_other_pages %} - {% blocktrans trimmed with start=books.start_index end=books.end_index %} - (showing {{ start }}-{{ end }}) +

    +
    +
    +

    + {{ shelf.name }} + + {% include 'snippets/privacy-icons.html' with item=shelf %} + + {% with count=books.paginator.count %} + {% if count %} +

    + {% blocktrans trimmed count counter=count with formatted_count=count|intcomma %} + {{ formatted_count }} book + {% plural %} + {{ formatted_count }} books {% endblocktrans %} + + {% if books.has_other_pages %} + {% blocktrans trimmed with start=books.start_index end=books.end_index %} + (showing {{ start }}-{{ end }}) + {% endblocktrans %} + {% endif %} +

    {% endif %} -

    - {% endif %} - {% endwith %} -

    -
    - {% if is_self and shelf.id %} -
    - {% trans "Edit shelf" as button_text %} - {% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_shelf_form" focus="edit_shelf_form_header" %} + {% endwith %} +

    +
    + {% if is_self and shelf.id %} +
    +
    + {% trans "Edit shelf" as button_text %} + {% include 'snippets/toggle/open_button.html' with text=button_text icon_with_text="pencil" controls_text="edit_shelf_form" focus="edit_shelf_form_header" %} + + {% if shelf.deletable %} +
    + {% csrf_token %} + + + + {% endif %} +
    +
    + {% endif %}
    + {% if shelf.description %} +

    {{ shelf.description }}

    {% endif %}
    - {% include 'user/shelf/edit_shelf_form.html' with controls_text="edit_shelf_form" %} + {% include 'shelf/edit_shelf_form.html' with controls_text="edit_shelf_form" %}
    @@ -167,17 +184,7 @@
    {% else %} -

    {% trans "This shelf is empty." %}

    - {% if shelf.id and shelf.editable %} -
    - {% csrf_token %} - - -
    - {% endif %} - +

    {% trans "This shelf is empty." %}

    {% endif %}
    diff --git a/bookwyrm/templates/snippets/privacy_select.html b/bookwyrm/templates/snippets/privacy_select.html index d7184e131..e10530514 100644 --- a/bookwyrm/templates/snippets/privacy_select.html +++ b/bookwyrm/templates/snippets/privacy_select.html @@ -1,7 +1,7 @@ {% load i18n %} {% load utilities %}
    - {% with 0|uuid as uuid %} + {% firstof uuid 0|uuid as uuid %} {% if not no_label %} {% endif %} @@ -20,6 +20,5 @@ {% trans "Private" %} - {% endwith %}
    diff --git a/bookwyrm/templates/snippets/report_button.html b/bookwyrm/templates/snippets/report_button.html index 55001aca5..2638a9fff 100644 --- a/bookwyrm/templates/snippets/report_button.html +++ b/bookwyrm/templates/snippets/report_button.html @@ -6,6 +6,6 @@ {% trans "Report" as button_text %} {% include 'snippets/toggle/toggle_button.html' with class="is-danger is-light is-small is-fullwidth" text=button_text controls_text="report" controls_uid=report_uuid focus="modal_title_report" disabled=is_current %} -{% include 'moderation/report_modal.html' with user=user reporter=request.user controls_text="report" controls_uid=report_uuid %} +{% include 'snippets/report_modal.html' with user=user reporter=request.user controls_text="report" controls_uid=report_uuid %} {% endwith %} diff --git a/bookwyrm/templates/moderation/report_modal.html b/bookwyrm/templates/snippets/report_modal.html similarity index 100% rename from bookwyrm/templates/moderation/report_modal.html rename to bookwyrm/templates/snippets/report_modal.html diff --git a/bookwyrm/templates/user/shelf/books_header.html b/bookwyrm/templates/user/books_header.html similarity index 100% rename from bookwyrm/templates/user/shelf/books_header.html rename to bookwyrm/templates/user/books_header.html diff --git a/bookwyrm/templates/goal.html b/bookwyrm/templates/user/goal.html similarity index 100% rename from bookwyrm/templates/goal.html rename to bookwyrm/templates/user/goal.html diff --git a/bookwyrm/templates/user/relationships/followers.html b/bookwyrm/templates/user/relationships/followers.html index 223f38c7b..c7d6833b7 100644 --- a/bookwyrm/templates/user/relationships/followers.html +++ b/bookwyrm/templates/user/relationships/followers.html @@ -9,6 +9,6 @@ {% block nullstate %}
    - {% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %} + {% blocktrans with username=user.display_name %}{{ username }} has no followers{% endblocktrans %}
    {% endblock %} diff --git a/bookwyrm/templates/user/relationships/following.html b/bookwyrm/templates/user/relationships/following.html index 475d40ab0..3952d045f 100644 --- a/bookwyrm/templates/user/relationships/following.html +++ b/bookwyrm/templates/user/relationships/following.html @@ -9,7 +9,7 @@ {% block nullstate %}
    - {% blocktrans with username=user.display_name %}{{ username }} isn't following any users{% endblocktrans %} + {% blocktrans with username=user.display_name %}{{ username }} isn't following any users{% endblocktrans %}
    {% endblock %} diff --git a/bookwyrm/templates/user/shelf/create_shelf_form.html b/bookwyrm/templates/user/shelf/create_shelf_form.html deleted file mode 100644 index b7ea27de8..000000000 --- a/bookwyrm/templates/user/shelf/create_shelf_form.html +++ /dev/null @@ -1,27 +0,0 @@ -{% extends 'components/inline_form.html' %} -{% load i18n %} - -{% block header %} -{% trans "Create Shelf" %} -{% endblock %} - -{% block form %} -
    - {% csrf_token %} - -
    - - -
    - -
    -
    - {% include 'snippets/privacy_select.html' %} -
    -
    - -
    -
    -
    -{% endblock %} - diff --git a/bookwyrm/templates/user/shelf/edit_shelf_form.html b/bookwyrm/templates/user/shelf/edit_shelf_form.html deleted file mode 100644 index 753d06816..000000000 --- a/bookwyrm/templates/user/shelf/edit_shelf_form.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends 'components/inline_form.html' %} -{% load i18n %} - -{% block header %} -{% trans "Edit Shelf" %} -{% endblock %} - -{% block form %} -
    - {% csrf_token %} - - {% if shelf.editable %} -
    - - -
    - {% else %} - - {% endif %} - -
    -
    - {% include 'snippets/privacy_select.html' with current=shelf.privacy %} -
    -
    - -
    -
    -
    -{% endblock %} - diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index f360a30af..36e646aa9 100755 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -24,7 +24,7 @@ {% if user.bookwyrm_user %}

    - {% include 'user/shelf/books_header.html' %} + {% include 'user/books_header.html' %}

    {% for shelf in shelves %} diff --git a/bookwyrm/templates/user_admin/user.html b/bookwyrm/templates/user_admin/user.html deleted file mode 100644 index e3a2413a9..000000000 --- a/bookwyrm/templates/user_admin/user.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends 'settings/layout.html' %} -{% load i18n %} - -{% block title %}{{ user.username }}{% endblock %} -{% block header %} -{{ user.username }} -

    - {% trans "Back to users" %} -

    - -{% endblock %} - -{% block panel %} -{% include 'user_admin/user_info.html' with user=user %} - -{% include 'user_admin/user_moderation_actions.html' with user=user %} - -{% endblock %} - diff --git a/bookwyrm/tests/views/admin/__init__.py b/bookwyrm/tests/views/admin/__init__.py new file mode 100644 index 000000000..b6e690fd5 --- /dev/null +++ b/bookwyrm/tests/views/admin/__init__.py @@ -0,0 +1 @@ +from . import * diff --git a/bookwyrm/tests/views/test_announcements.py b/bookwyrm/tests/views/admin/test_announcements.py similarity index 100% rename from bookwyrm/tests/views/test_announcements.py rename to bookwyrm/tests/views/admin/test_announcements.py diff --git a/bookwyrm/tests/views/test_dashboard.py b/bookwyrm/tests/views/admin/test_dashboard.py similarity index 88% rename from bookwyrm/tests/views/test_dashboard.py rename to bookwyrm/tests/views/admin/test_dashboard.py index 6ce30c18c..70cc40fe3 100644 --- a/bookwyrm/tests/views/test_dashboard.py +++ b/bookwyrm/tests/views/admin/test_dashboard.py @@ -1,5 +1,6 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory @@ -34,5 +35,8 @@ class DashboardViews(TestCase): request.user.is_superuser = True result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) diff --git a/bookwyrm/tests/views/test_email_blocks.py b/bookwyrm/tests/views/admin/test_email_blocks.py similarity index 86% rename from bookwyrm/tests/views/test_email_blocks.py rename to bookwyrm/tests/views/admin/test_email_blocks.py index be3d9d702..24cdf8a49 100644 --- a/bookwyrm/tests/views/test_email_blocks.py +++ b/bookwyrm/tests/views/admin/test_email_blocks.py @@ -1,5 +1,7 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document + from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory @@ -36,7 +38,10 @@ class EmailBlocklistViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_blocklist_page_post(self): @@ -49,7 +54,10 @@ class EmailBlocklistViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) self.assertTrue( diff --git a/bookwyrm/tests/views/test_federation.py b/bookwyrm/tests/views/admin/test_federation.py similarity index 90% rename from bookwyrm/tests/views/test_federation.py rename to bookwyrm/tests/views/admin/test_federation.py index ebd311d3f..2501a81a1 100644 --- a/bookwyrm/tests/views/test_federation.py +++ b/bookwyrm/tests/views/admin/test_federation.py @@ -1,6 +1,8 @@ """ test for app action functionality """ import json from unittest.mock import patch +from tidylib import tidy_document + from django.core.files.uploadedfile import SimpleUploadedFile from django.template.response import TemplateResponse from django.test import TestCase @@ -46,10 +48,19 @@ class FederationViews(TestCase): request.user.is_superuser = True result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) - def test_server_page(self): + def test_instance_page(self): """there are so many views, this just makes sure it LOADS""" server = models.FederatedServer.objects.create(server_name="hi.there.com") view = views.FederatedServer.as_view() @@ -59,7 +70,10 @@ class FederationViews(TestCase): result = view(request, server.id) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_server_page_block(self): @@ -148,7 +162,10 @@ class FederationViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_add_view_post_create(self): @@ -169,6 +186,7 @@ class FederationViews(TestCase): self.assertEqual(server.application_type, "coolsoft") self.assertEqual(server.status, "blocked") + # pylint: disable=consider-using-with def test_import_blocklist(self): """load a json file with a list of servers to block""" server = models.FederatedServer.objects.create(server_name="hi.there.com") @@ -180,7 +198,7 @@ class FederationViews(TestCase): {"instance": "hi.there.com", "url": "https://explanation.url"}, # existing {"a": "b"}, # invalid ] - json.dump(data, open("file.json", "w")) + json.dump(data, open("file.json", "w")) # pylint: disable=unspecified-encoding view = views.ImportServerBlocklist.as_view() request = self.factory.post( diff --git a/bookwyrm/tests/views/admin/test_ip_blocklist.py b/bookwyrm/tests/views/admin/test_ip_blocklist.py new file mode 100644 index 000000000..fb249b761 --- /dev/null +++ b/bookwyrm/tests/views/admin/test_ip_blocklist.py @@ -0,0 +1,44 @@ +""" test for app action functionality """ +from unittest.mock import patch +from tidylib import tidy_document +from django.template.response import TemplateResponse +from django.test import TestCase +from django.test.client import RequestFactory + +from bookwyrm import models, views + + +class IPBlocklistViews(TestCase): + """every response to a get request, html or json""" + + def setUp(self): + """we need basic test data and mocks""" + self.factory = RequestFactory() + with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch( + "bookwyrm.activitystreams.populate_stream_task.delay" + ): + self.local_user = models.User.objects.create_user( + "mouse@local.com", + "mouse@mouse.mouse", + "password", + local=True, + localname="mouse", + ) + + models.SiteSettings.objects.create() + + def test_blocklist_page_get(self): + """there are so many views, this just makes sure it LOADS""" + view = views.IPBlocklist.as_view() + request = self.factory.get("") + request.user = self.local_user + request.user.is_superuser = True + + result = view(request) + + self.assertIsInstance(result, TemplateResponse) + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) + self.assertEqual(result.status_code, 200) diff --git a/bookwyrm/tests/views/test_reports.py b/bookwyrm/tests/views/admin/test_reports.py similarity index 87% rename from bookwyrm/tests/views/test_reports.py rename to bookwyrm/tests/views/admin/test_reports.py index 9fbeae04a..456dff554 100644 --- a/bookwyrm/tests/views/test_reports.py +++ b/bookwyrm/tests/views/admin/test_reports.py @@ -1,6 +1,8 @@ """ test for app action functionality """ import json from unittest.mock import patch +from tidylib import tidy_document + from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory @@ -42,7 +44,16 @@ class ReportViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_reports_page_with_data(self): @@ -55,7 +66,16 @@ class ReportViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_report_page(self): @@ -69,7 +89,10 @@ class ReportViews(TestCase): result = view(request, report.id) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_report_comment(self): diff --git a/bookwyrm/tests/views/test_user_admin.py b/bookwyrm/tests/views/admin/test_user_admin.py similarity index 82% rename from bookwyrm/tests/views/test_user_admin.py rename to bookwyrm/tests/views/admin/test_user_admin.py index 3917a6fd9..3336cf242 100644 --- a/bookwyrm/tests/views/test_user_admin.py +++ b/bookwyrm/tests/views/admin/test_user_admin.py @@ -1,5 +1,7 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document + from django.contrib.auth.models import Group from django.template.response import TemplateResponse from django.test import TestCase @@ -34,7 +36,10 @@ class UserAdminViews(TestCase): request.user.is_superuser = True result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_user_admin_page(self): @@ -47,7 +52,10 @@ class UserAdminViews(TestCase): result = view(request, self.local_user.id) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) @patch("bookwyrm.suggested_users.rerank_suggestions_task.delay") @@ -69,7 +77,10 @@ class UserAdminViews(TestCase): result = view(request, self.local_user.id) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual( list(self.local_user.groups.values_list("name", flat=True)), ["editor"] diff --git a/bookwyrm/tests/views/preferences/__init__.py b/bookwyrm/tests/views/preferences/__init__.py new file mode 100644 index 000000000..b6e690fd5 --- /dev/null +++ b/bookwyrm/tests/views/preferences/__init__.py @@ -0,0 +1 @@ +from . import * diff --git a/bookwyrm/tests/views/test_block.py b/bookwyrm/tests/views/preferences/test_block.py similarity index 93% rename from bookwyrm/tests/views/test_block.py rename to bookwyrm/tests/views/preferences/test_block.py index f1ec42f03..6663aa634 100644 --- a/bookwyrm/tests/views/test_block.py +++ b/bookwyrm/tests/views/preferences/test_block.py @@ -1,5 +1,7 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document + from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory @@ -44,7 +46,10 @@ class BlockViews(TestCase): request.user = self.local_user result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_block_post(self, _): @@ -75,6 +80,6 @@ class BlockViews(TestCase): request.user = self.local_user with patch("bookwyrm.activitystreams.add_user_statuses_task.delay"): - views.block.unblock(request, self.remote_user.id) + views.unblock(request, self.remote_user.id) self.assertFalse(models.UserBlocks.objects.exists()) diff --git a/bookwyrm/tests/views/preferences/test_change_password.py b/bookwyrm/tests/views/preferences/test_change_password.py new file mode 100644 index 000000000..17afb8f77 --- /dev/null +++ b/bookwyrm/tests/views/preferences/test_change_password.py @@ -0,0 +1,61 @@ +""" test for app action functionality """ +from unittest.mock import patch +from tidylib import tidy_document + +from django.template.response import TemplateResponse +from django.test import TestCase +from django.test.client import RequestFactory + +from bookwyrm import models, views + + +class ChangePasswordViews(TestCase): + """view user and edit profile""" + + def setUp(self): + """we need basic test data and mocks""" + self.factory = RequestFactory() + with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch( + "bookwyrm.activitystreams.populate_stream_task.delay" + ): + self.local_user = models.User.objects.create_user( + "mouse@local.com", + "mouse@mouse.com", + "password", + local=True, + localname="mouse", + ) + models.SiteSettings.objects.create(id=1) + + def test_password_change_get(self): + """there are so many views, this just makes sure it LOADS""" + view = views.ChangePassword.as_view() + request = self.factory.get("") + request.user = self.local_user + + result = view(request) + self.assertIsInstance(result, TemplateResponse) + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) + self.assertEqual(result.status_code, 200) + + def test_password_change(self): + """change password""" + view = views.ChangePassword.as_view() + password_hash = self.local_user.password + request = self.factory.post("", {"password": "hi", "confirm-password": "hi"}) + request.user = self.local_user + with patch("bookwyrm.views.preferences.change_password.login"): + view(request) + self.assertNotEqual(self.local_user.password, password_hash) + + def test_password_change_mismatch(self): + """change password""" + view = views.ChangePassword.as_view() + password_hash = self.local_user.password + request = self.factory.post("", {"password": "hi", "confirm-password": "hihi"}) + request.user = self.local_user + view(request) + self.assertEqual(self.local_user.password, password_hash) diff --git a/bookwyrm/tests/views/preferences/test_delete_user.py b/bookwyrm/tests/views/preferences/test_delete_user.py new file mode 100644 index 000000000..40a28d445 --- /dev/null +++ b/bookwyrm/tests/views/preferences/test_delete_user.py @@ -0,0 +1,89 @@ +""" test for app action functionality """ +import json +from unittest.mock import patch +from tidylib import tidy_document + +from django.contrib.sessions.middleware import SessionMiddleware +from django.template.response import TemplateResponse +from django.test import TestCase +from django.test.client import RequestFactory + +from bookwyrm import forms, models, views + + +@patch("bookwyrm.suggested_users.remove_user_task.delay") +class DeleteUserViews(TestCase): + """view user and edit profile""" + + def setUp(self): + """we need basic test data and mocks""" + self.factory = RequestFactory() + with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch( + "bookwyrm.activitystreams.populate_stream_task.delay" + ): + self.local_user = models.User.objects.create_user( + "mouse@local.com", + "mouse@mouse.mouse", + "password", + local=True, + localname="mouse", + ) + self.rat = models.User.objects.create_user( + "rat@local.com", "rat@rat.rat", "password", local=True, localname="rat" + ) + + self.book = models.Edition.objects.create( + title="test", parent_work=models.Work.objects.create(title="test work") + ) + with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"), patch( + "bookwyrm.activitystreams.add_book_statuses_task.delay" + ): + models.ShelfBook.objects.create( + book=self.book, + user=self.local_user, + shelf=self.local_user.shelf_set.first(), + ) + + models.SiteSettings.objects.create() + + def test_delete_user_page(self, _): + """there are so many views, this just makes sure it LOADS""" + view = views.DeleteUser.as_view() + request = self.factory.get("") + request.user = self.local_user + result = view(request) + self.assertIsInstance(result, TemplateResponse) + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) + self.assertEqual(result.status_code, 200) + + @patch("bookwyrm.suggested_users.rerank_suggestions_task") + def test_delete_user(self, *_): + """use a form to update a user""" + view = views.DeleteUser.as_view() + form = forms.DeleteUserForm() + form.data["password"] = "password" + request = self.factory.post("", form.data) + request.user = self.local_user + middleware = SessionMiddleware() + middleware.process_request(request) + request.session.save() + + self.assertIsNone(self.local_user.name) + with patch( + "bookwyrm.models.activitypub_mixin.broadcast_task.delay" + ) as delay_mock: + view(request) + self.assertEqual(delay_mock.call_count, 1) + activity = json.loads(delay_mock.call_args[0][1]) + self.assertEqual(activity["type"], "Delete") + self.assertEqual(activity["actor"], self.local_user.remote_id) + self.assertEqual( + activity["cc"][0], "https://www.w3.org/ns/activitystreams#Public" + ) + + self.local_user.refresh_from_db() + self.assertFalse(self.local_user.is_active) + self.assertEqual(self.local_user.deactivation_reason, "self_deletion") diff --git a/bookwyrm/tests/views/test_edit_user.py b/bookwyrm/tests/views/preferences/test_edit_user.py similarity index 71% rename from bookwyrm/tests/views/test_edit_user.py rename to bookwyrm/tests/views/preferences/test_edit_user.py index 07e54e4e4..3dccf5188 100644 --- a/bookwyrm/tests/views/test_edit_user.py +++ b/bookwyrm/tests/views/preferences/test_edit_user.py @@ -1,11 +1,10 @@ """ test for app action functionality """ -import json import pathlib from unittest.mock import patch from PIL import Image +from tidylib import tidy_document from django.contrib.auth.models import AnonymousUser -from django.contrib.sessions.middleware import SessionMiddleware from django.core.files.base import ContentFile from django.core.files.uploadedfile import SimpleUploadedFile from django.template.response import TemplateResponse @@ -59,7 +58,10 @@ class EditUserViews(TestCase): request.user = self.local_user result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_edit_user(self, _): @@ -91,8 +93,9 @@ class EditUserViews(TestCase): form.data["default_post_privacy"] = "public" form.data["preferred_timezone"] = "UTC" image_file = pathlib.Path(__file__).parent.joinpath( - "../../static/images/no_cover.jpg" + "../../../static/images/no_cover.jpg" ) + # pylint: disable=consider-using-with form.data["avatar"] = SimpleUploadedFile( image_file, open(image_file, "rb").read(), content_type="image/jpeg" ) @@ -113,50 +116,11 @@ class EditUserViews(TestCase): def test_crop_avatar(self, _): """reduce that image size""" image_file = pathlib.Path(__file__).parent.joinpath( - "../../static/images/no_cover.jpg" + "../../../static/images/no_cover.jpg" ) image = Image.open(image_file) - result = views.edit_user.crop_avatar(image) + result = views.preferences.edit_user.crop_avatar(image) self.assertIsInstance(result, ContentFile) image_result = Image.open(result) self.assertEqual(image_result.size, (120, 120)) - - def test_delete_user_page(self, _): - """there are so many views, this just makes sure it LOADS""" - view = views.DeleteUser.as_view() - request = self.factory.get("") - request.user = self.local_user - result = view(request) - self.assertIsInstance(result, TemplateResponse) - result.render() - self.assertEqual(result.status_code, 200) - - @patch("bookwyrm.suggested_users.rerank_suggestions_task") - def test_delete_user(self, *_): - """use a form to update a user""" - view = views.DeleteUser.as_view() - form = forms.DeleteUserForm() - form.data["password"] = "password" - request = self.factory.post("", form.data) - request.user = self.local_user - middleware = SessionMiddleware() - middleware.process_request(request) - request.session.save() - - self.assertIsNone(self.local_user.name) - with patch( - "bookwyrm.models.activitypub_mixin.broadcast_task.delay" - ) as delay_mock: - view(request) - self.assertEqual(delay_mock.call_count, 1) - activity = json.loads(delay_mock.call_args[0][1]) - self.assertEqual(activity["type"], "Delete") - self.assertEqual(activity["actor"], self.local_user.remote_id) - self.assertEqual( - activity["cc"][0], "https://www.w3.org/ns/activitystreams#Public" - ) - - self.local_user.refresh_from_db() - self.assertFalse(self.local_user.is_active) - self.assertEqual(self.local_user.deactivation_reason, "self_deletion") diff --git a/bookwyrm/tests/views/test_book.py b/bookwyrm/tests/views/test_book.py index 8c423e16a..cf86a5969 100644 --- a/bookwyrm/tests/views/test_book.py +++ b/bookwyrm/tests/views/test_book.py @@ -283,6 +283,46 @@ class BookViews(TestCase): self.assertEqual(book.authors.first().name, "Sappho") self.assertEqual(book.authors.first(), book.parent_work.authors.first()) + def _setup_cover_url(self): + cover_url = "http://example.com" + image_file = pathlib.Path(__file__).parent.joinpath( + "../../static/images/default_avi.jpg" + ) + image = Image.open(image_file) + output = BytesIO() + image.save(output, format=image.format) + responses.add( + responses.GET, + cover_url, + body=output.getvalue(), + status=200, + ) + return cover_url + + @responses.activate + def test_create_book_upload_cover_url(self): + """create an entirely new book and work with cover url""" + self.assertFalse(self.book.cover) + view = views.ConfirmEditBook.as_view() + self.local_user.groups.add(self.group) + cover_url = self._setup_cover_url() + + form = forms.EditionForm() + form.data["title"] = "New Title" + form.data["last_edited_by"] = self.local_user.id + form.data["cover-url"] = cover_url + request = self.factory.post("", form.data) + request.user = self.local_user + + with patch( + "bookwyrm.models.activitypub_mixin.broadcast_task.delay" + ) as delay_mock: + views.upload_cover(request, self.book.id) + self.assertEqual(delay_mock.call_count, 1) + + self.book.refresh_from_db() + self.assertTrue(self.book.cover) + def test_upload_cover_file(self): """add a cover via file upload""" self.assertFalse(self.book.cover) @@ -311,21 +351,8 @@ class BookViews(TestCase): def test_upload_cover_url(self): """add a cover via url""" self.assertFalse(self.book.cover) - image_file = pathlib.Path(__file__).parent.joinpath( - "../../static/images/default_avi.jpg" - ) - image = Image.open(image_file) - output = BytesIO() - image.save(output, format=image.format) - responses.add( - responses.GET, - "http://example.com", - body=output.getvalue(), - status=200, - ) - form = forms.CoverForm(instance=self.book) - form.data["cover-url"] = "http://example.com" + form.data["cover-url"] = self._setup_cover_url() request = self.factory.post("", form.data) request.user = self.local_user diff --git a/bookwyrm/tests/views/test_directory.py b/bookwyrm/tests/views/test_directory.py index 90638b0a6..0193d19d2 100644 --- a/bookwyrm/tests/views/test_directory.py +++ b/bookwyrm/tests/views/test_directory.py @@ -1,5 +1,6 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document from django.contrib.auth.models import AnonymousUser from django.template.response import TemplateResponse @@ -51,7 +52,16 @@ class DirectoryViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_directory_page_empty(self): @@ -62,7 +72,10 @@ class DirectoryViews(TestCase): result = view(request) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document(html.content, options={"drop-empty-elements": False}) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) def test_directory_page_logged_out(self): diff --git a/bookwyrm/tests/views/test_password.py b/bookwyrm/tests/views/test_password.py index 3a1b591dd..47d8bb27b 100644 --- a/bookwyrm/tests/views/test_password.py +++ b/bookwyrm/tests/views/test_password.py @@ -95,33 +95,3 @@ class PasswordViews(TestCase): resp = view(request, code.code) resp.render() self.assertTrue(models.PasswordReset.objects.exists()) - - def test_password_change_get(self): - """there are so many views, this just makes sure it LOADS""" - view = views.ChangePassword.as_view() - request = self.factory.get("") - request.user = self.local_user - - result = view(request) - self.assertIsInstance(result, TemplateResponse) - result.render() - self.assertEqual(result.status_code, 200) - - def test_password_change(self): - """change password""" - view = views.ChangePassword.as_view() - password_hash = self.local_user.password - request = self.factory.post("", {"password": "hi", "confirm-password": "hi"}) - request.user = self.local_user - with patch("bookwyrm.views.password.login"): - view(request) - self.assertNotEqual(self.local_user.password, password_hash) - - def test_password_change_mismatch(self): - """change password""" - view = views.ChangePassword.as_view() - password_hash = self.local_user.password - request = self.factory.post("", {"password": "hi", "confirm-password": "hihi"}) - request.user = self.local_user - view(request) - self.assertEqual(self.local_user.password, password_hash) diff --git a/bookwyrm/tests/views/test_shelf.py b/bookwyrm/tests/views/test_shelf.py index 0d7d01cbc..d769d93c2 100644 --- a/bookwyrm/tests/views/test_shelf.py +++ b/bookwyrm/tests/views/test_shelf.py @@ -1,11 +1,14 @@ """ test for app action functionality """ import json from unittest.mock import patch +from tidylib import tidy_document + +from django.core.exceptions import PermissionDenied from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory -from bookwyrm import models, views +from bookwyrm import forms, models, views from bookwyrm.activitypub import ActivitypubResponse @@ -53,7 +56,16 @@ class ShelfViews(TestCase): is_api.return_value = False result = view(request, self.local_user.username, shelf.identifier) self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) with patch("bookwyrm.views.shelf.is_api_request") as is_api: @@ -122,7 +134,7 @@ class ShelfViews(TestCase): self.assertEqual(shelf.name, "To Read") - def test_handle_shelve(self, *_): + def test_shelve(self, *_): """shelve a book""" request = self.factory.post( "", {"book": self.book.id, "shelf": self.shelf.identifier} @@ -140,7 +152,7 @@ class ShelfViews(TestCase): # make sure the book is on the shelf self.assertEqual(self.shelf.books.get(), self.book) - def test_handle_shelve_to_read(self, *_): + def test_shelve_to_read(self, *_): """special behavior for the to-read shelf""" shelf = models.Shelf.objects.get(identifier="to-read") request = self.factory.post( @@ -153,7 +165,7 @@ class ShelfViews(TestCase): # make sure the book is on the shelf self.assertEqual(shelf.books.get(), self.book) - def test_handle_shelve_reading(self, *_): + def test_shelve_reading(self, *_): """special behavior for the reading shelf""" shelf = models.Shelf.objects.get(identifier="reading") request = self.factory.post( @@ -166,7 +178,7 @@ class ShelfViews(TestCase): # make sure the book is on the shelf self.assertEqual(shelf.books.get(), self.book) - def test_handle_shelve_read(self, *_): + def test_shelve_read(self, *_): """special behavior for the read shelf""" shelf = models.Shelf.objects.get(identifier="read") request = self.factory.post( @@ -179,7 +191,7 @@ class ShelfViews(TestCase): # make sure the book is on the shelf self.assertEqual(shelf.books.get(), self.book) - def test_handle_unshelve(self, *_): + def test_unshelve(self, *_): """remove a book from a shelf""" with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): models.ShelfBook.objects.create( @@ -197,3 +209,76 @@ class ShelfViews(TestCase): self.assertEqual(activity["type"], "Remove") self.assertEqual(activity["object"]["id"], item.remote_id) self.assertEqual(self.shelf.books.count(), 0) + + def test_create_shelf(self, *_): + """a brand new custom shelf""" + form = forms.ShelfForm() + form.data["user"] = self.local_user.id + form.data["name"] = "new shelf name" + form.data["description"] = "desc" + form.data["privacy"] = "unlisted" + request = self.factory.post("", form.data) + request.user = self.local_user + + views.create_shelf(request) + + shelf = models.Shelf.objects.get(name="new shelf name") + self.assertEqual(shelf.privacy, "unlisted") + self.assertEqual(shelf.description, "desc") + self.assertEqual(shelf.user, self.local_user) + + def test_delete_shelf(self, *_): + """delete a brand new custom shelf""" + request = self.factory.post("") + request.user = self.local_user + shelf_id = self.shelf.id + + views.delete_shelf(request, shelf_id) + + self.assertFalse(models.Shelf.objects.filter(id=shelf_id).exists()) + + def test_delete_shelf_unauthorized(self, *_): + """delete a brand new custom shelf""" + with patch("bookwyrm.suggested_users.rerank_suggestions_task.delay"), patch( + "bookwyrm.activitystreams.populate_stream_task.delay" + ): + rat = models.User.objects.create_user( + "rat@local.com", + "rat@mouse.mouse", + "password", + local=True, + localname="rat", + ) + request = self.factory.post("") + request.user = rat + + with self.assertRaises(PermissionDenied): + views.delete_shelf(request, self.shelf.id) + + self.assertTrue(models.Shelf.objects.filter(id=self.shelf.id).exists()) + + def test_delete_shelf_has_book(self, *_): + """delete a brand new custom shelf""" + with patch("bookwyrm.models.activitypub_mixin.broadcast_task.delay"): + models.ShelfBook.objects.create( + book=self.book, user=self.local_user, shelf=self.shelf + ) + request = self.factory.post("") + request.user = self.local_user + + with self.assertRaises(PermissionDenied): + views.delete_shelf(request, self.shelf.id) + + self.assertTrue(models.Shelf.objects.filter(id=self.shelf.id).exists()) + + def test_delete_shelf_not_editable(self, *_): + """delete a brand new custom shelf""" + shelf = self.local_user.shelf_set.first() + self.assertFalse(shelf.editable) + request = self.factory.post("") + request.user = self.local_user + + with self.assertRaises(PermissionDenied): + views.delete_shelf(request, shelf.id) + + self.assertTrue(models.Shelf.objects.filter(id=shelf.id).exists()) diff --git a/bookwyrm/tests/views/test_user.py b/bookwyrm/tests/views/test_user.py index 614f772d7..f2d9b8610 100644 --- a/bookwyrm/tests/views/test_user.py +++ b/bookwyrm/tests/views/test_user.py @@ -1,5 +1,6 @@ """ test for app action functionality """ from unittest.mock import patch +from tidylib import tidy_document from django.contrib.auth.models import AnonymousUser from django.http.response import Http404 @@ -55,7 +56,16 @@ class UserViews(TestCase): is_api.return_value = False result = view(request, "mouse") self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) request.user = self.anonymous_user @@ -63,7 +73,16 @@ class UserViews(TestCase): is_api.return_value = False result = view(request, "mouse") self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) with patch("bookwyrm.views.user.is_api_request") as is_api: @@ -92,7 +111,16 @@ class UserViews(TestCase): is_api.return_value = False result = view(request, "mouse") self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) with patch("bookwyrm.views.user.is_api_request") as is_api: @@ -123,7 +151,16 @@ class UserViews(TestCase): is_api.return_value = False result = view(request, "mouse") self.assertIsInstance(result, TemplateResponse) - result.render() + html = result.render() + _, errors = tidy_document( + html.content, + options={ + "drop-empty-elements": False, + "warn-proprietary-attributes": False, + }, + ) + if errors: + raise Exception(errors) self.assertEqual(result.status_code, 200) with patch("bookwyrm.views.user.is_api_request") as is_api: diff --git a/bookwyrm/views/__init__.py b/bookwyrm/views/__init__.py index 16ebb2bad..e5b083d03 100644 --- a/bookwyrm/views/__init__.py +++ b/bookwyrm/views/__init__.py @@ -1,4 +1,5 @@ """ make sure all our nice views are available """ +# site admin from .admin.announcements import Announcements, Announcement, delete_announcement from .admin.dashboard import Dashboard from .admin.federation import Federation, FederatedServer @@ -19,13 +20,19 @@ from .admin.reports import ( ) from .admin.site import Site from .admin.user_admin import UserAdmin, UserAdminList + +# user preferences +from .preferences.change_password import ChangePassword +from .preferences.edit_user import EditUser +from .preferences.delete_user import DeleteUser +from .preferences.block import Block, unblock + +# misc views from .author import Author, EditAuthor -from .block import Block, unblock from .books import Book, EditBook, ConfirmEditBook from .books import upload_cover, add_description, resolve_book from .directory import Directory from .discover import Discover -from .edit_user import EditUser, DeleteUser from .editions import Editions, switch_edition from .feed import DirectMessage, Feed, Replies, Status from .follow import follow, unfollow @@ -47,7 +54,7 @@ from .reading import delete_readthrough, delete_progressupdate from .reading import ReadingStatus from .register import Register, ConfirmEmail, ConfirmEmailCode, resend_link from .rss_feed import RssFeed -from .password import PasswordResetRequest, PasswordReset, ChangePassword +from .password import PasswordResetRequest, PasswordReset from .search import Search from .shelf import Shelf from .shelf import create_shelf, delete_shelf diff --git a/bookwyrm/views/admin/announcements.py b/bookwyrm/views/admin/announcements.py index e778b709a..92ec1766c 100644 --- a/bookwyrm/views/admin/announcements.py +++ b/bookwyrm/views/admin/announcements.py @@ -41,7 +41,9 @@ class Announcements(View): "form": forms.AnnouncementForm(), "sort": sort, } - return TemplateResponse(request, "settings/announcements.html", data) + return TemplateResponse( + request, "settings/announcements/announcements.html", data + ) def post(self, request): """edit the site settings""" @@ -56,7 +58,9 @@ class Announcements(View): ).get_page(request.GET.get("page")), "form": form, } - return TemplateResponse(request, "settings/announcements.html", data) + return TemplateResponse( + request, "settings/announcements/announcements.html", data + ) @method_decorator(login_required, name="dispatch") @@ -74,7 +78,9 @@ class Announcement(View): "announcement": announcement, "form": forms.AnnouncementForm(instance=announcement), } - return TemplateResponse(request, "settings/announcement.html", data) + return TemplateResponse( + request, "settings/announcements/announcement.html", data + ) def post(self, request, announcement_id): """edit announcement""" @@ -87,7 +93,9 @@ class Announcement(View): "announcement": announcement, "form": form, } - return TemplateResponse(request, "settings/announcement.html", data) + return TemplateResponse( + request, "settings/announcements/announcement.html", data + ) @login_required diff --git a/bookwyrm/views/admin/dashboard.py b/bookwyrm/views/admin/dashboard.py index 161dc6da1..e02b9143e 100644 --- a/bookwyrm/views/admin/dashboard.py +++ b/bookwyrm/views/admin/dashboard.py @@ -85,4 +85,4 @@ class Dashboard(View): "user_stats": user_stats, "status_stats": status_stats, } - return TemplateResponse(request, "settings/dashboard.html", data) + return TemplateResponse(request, "settings/dashboard/dashboard.html", data) diff --git a/bookwyrm/views/admin/email_blocklist.py b/bookwyrm/views/admin/email_blocklist.py index cd3d83fdb..eecad4ffb 100644 --- a/bookwyrm/views/admin/email_blocklist.py +++ b/bookwyrm/views/admin/email_blocklist.py @@ -22,7 +22,9 @@ class EmailBlocklist(View): "domains": models.EmailBlocklist.objects.order_by("-created_date").all(), "form": forms.EmailBlocklistForm(), } - return TemplateResponse(request, "settings/email_blocklist.html", data) + return TemplateResponse( + request, "settings/email_blocklist/email_blocklist.html", data + ) def post(self, request, domain_id=None): """create a new domain block""" @@ -35,11 +37,15 @@ class EmailBlocklist(View): "form": form, } if not form.is_valid(): - return TemplateResponse(request, "settings/email_blocklist.html", data) + return TemplateResponse( + request, "settings/email_blocklist/email_blocklist.html", data + ) form.save() data["form"] = forms.EmailBlocklistForm() - return TemplateResponse(request, "settings/email_blocklist.html", data) + return TemplateResponse( + request, "settings/email_blocklist/email_blocklist.html", data + ) # pylint: disable=unused-argument def delete(self, request, domain_id): diff --git a/bookwyrm/views/admin/federation.py b/bookwyrm/views/admin/federation.py index 97dfd6ff0..19bba30d6 100644 --- a/bookwyrm/views/admin/federation.py +++ b/bookwyrm/views/admin/federation.py @@ -44,7 +44,7 @@ class Federation(View): "sort": sort, "form": forms.ServerForm(), } - return TemplateResponse(request, "settings/federation.html", data) + return TemplateResponse(request, "settings/federation/instance_list.html", data) class AddFederatedServer(View): @@ -53,14 +53,16 @@ class AddFederatedServer(View): def get(self, request): """add server form""" data = {"form": forms.ServerForm()} - return TemplateResponse(request, "settings/edit_server.html", data) + return TemplateResponse(request, "settings/federation/edit_instance.html", data) def post(self, request): """add a server from the admin panel""" form = forms.ServerForm(request.POST) if not form.is_valid(): data = {"form": form} - return TemplateResponse(request, "settings/edit_server.html", data) + return TemplateResponse( + request, "settings/federation/edit_instance.html", data + ) server = form.save() return redirect("settings-federated-server", server.id) @@ -75,7 +77,7 @@ class ImportServerBlocklist(View): def get(self, request): """add server form""" - return TemplateResponse(request, "settings/server_blocklist.html") + return TemplateResponse(request, "settings/federation/instance_blocklist.html") def post(self, request): """add a server from the admin panel""" @@ -98,7 +100,9 @@ class ImportServerBlocklist(View): server.block() success_count += 1 data = {"failed": failed, "succeeded": success_count} - return TemplateResponse(request, "settings/server_blocklist.html", data) + return TemplateResponse( + request, "settings/federation/instance_blocklist.html", data + ) @method_decorator(login_required, name="dispatch") @@ -123,7 +127,7 @@ class FederatedServer(View): user_subject__in=users.all() ), } - return TemplateResponse(request, "settings/federated_server.html", data) + return TemplateResponse(request, "settings/federation/instance.html", data) def post(self, request, server): # pylint: disable=unused-argument """update note""" diff --git a/bookwyrm/views/admin/invite.py b/bookwyrm/views/admin/invite.py index f4c82e485..8a3db61a9 100644 --- a/bookwyrm/views/admin/invite.py +++ b/bookwyrm/views/admin/invite.py @@ -45,7 +45,7 @@ class ManageInvites(View): ), "form": forms.CreateInviteForm(), } - return TemplateResponse(request, "settings/manage_invites.html", data) + return TemplateResponse(request, "settings/invites/manage_invites.html", data) def post(self, request): """creates an invite database entry""" @@ -64,7 +64,7 @@ class ManageInvites(View): PAGE_LENGTH, ) data = {"invites": paginated.page(1), "form": form} - return TemplateResponse(request, "settings/manage_invites.html", data) + return TemplateResponse(request, "settings/invites/manage_invites.html", data) class Invite(View): @@ -135,7 +135,9 @@ class ManageInviteRequests(View): ), "sort": sort, } - return TemplateResponse(request, "settings/manage_invite_requests.html", data) + return TemplateResponse( + request, "settings/invites/manage_invite_requests.html", data + ) def post(self, request): """send out an invite""" diff --git a/bookwyrm/views/admin/ip_blocklist.py b/bookwyrm/views/admin/ip_blocklist.py index 643dae22c..d57a2422c 100644 --- a/bookwyrm/views/admin/ip_blocklist.py +++ b/bookwyrm/views/admin/ip_blocklist.py @@ -22,7 +22,9 @@ class IPBlocklist(View): "addresses": models.IPBlocklist.objects.all(), "form": forms.IPBlocklistForm(), } - return TemplateResponse(request, "settings/ip_blocklist.html", data) + return TemplateResponse( + request, "settings/ip_blocklist/ip_blocklist.html", data + ) def post(self, request, block_id=None): """create a new ip address block""" @@ -35,11 +37,15 @@ class IPBlocklist(View): "form": form, } if not form.is_valid(): - return TemplateResponse(request, "settings/ip_blocklist.html", data) + return TemplateResponse( + request, "settings/ip_blocklist/ip_blocklist.html", data + ) form.save() data["form"] = forms.IPBlocklistForm() - return TemplateResponse(request, "settings/ip_blocklist.html", data) + return TemplateResponse( + request, "settings/ip_blocklist/ip_blocklist.html", data + ) # pylint: disable=unused-argument def delete(self, request, domain_id): diff --git a/bookwyrm/views/admin/reports.py b/bookwyrm/views/admin/reports.py index 23bb6fa3d..f72d7970b 100644 --- a/bookwyrm/views/admin/reports.py +++ b/bookwyrm/views/admin/reports.py @@ -40,7 +40,7 @@ class Reports(View): "server": server, "reports": models.Report.objects.filter(**filters), } - return TemplateResponse(request, "moderation/reports.html", data) + return TemplateResponse(request, "settings/reports/reports.html", data) @method_decorator(login_required, name="dispatch") @@ -60,7 +60,7 @@ class Report(View): data = { "report": get_object_or_404(models.Report, id=report_id), } - return TemplateResponse(request, "moderation/report.html", data) + return TemplateResponse(request, "settings/reports/report.html", data) def post(self, request, report_id): """comment on a report""" diff --git a/bookwyrm/views/admin/user_admin.py b/bookwyrm/views/admin/user_admin.py index b29214e73..aa8479590 100644 --- a/bookwyrm/views/admin/user_admin.py +++ b/bookwyrm/views/admin/user_admin.py @@ -57,7 +57,7 @@ class UserAdminList(View): "sort": sort, "server": server, } - return TemplateResponse(request, "user_admin/user_admin.html", data) + return TemplateResponse(request, "settings/users/user_admin.html", data) @method_decorator(login_required, name="dispatch") @@ -72,7 +72,7 @@ class UserAdmin(View): """user view""" user = get_object_or_404(models.User, id=user) data = {"user": user, "group_form": forms.UserGroupForm()} - return TemplateResponse(request, "user_admin/user.html", data) + return TemplateResponse(request, "settings/users/user.html", data) def post(self, request, user): """update user group""" @@ -81,4 +81,4 @@ class UserAdmin(View): if form.is_valid(): form.save() data = {"user": user, "group_form": form} - return TemplateResponse(request, "user_admin/user.html", data) + return TemplateResponse(request, "settings/users/user.html", data) diff --git a/bookwyrm/views/books.py b/bookwyrm/views/books.py index e2878aca7..71199e543 100644 --- a/bookwyrm/views/books.py +++ b/bookwyrm/views/books.py @@ -191,6 +191,8 @@ class EditBook(View): data["confirm_mode"] = True # this isn't preserved because it isn't part of the form obj data["remove_authors"] = request.POST.getlist("remove_authors") + data["cover_url"] = request.POST.get("cover-url") + # make sure the dates are passed in as datetime, they're currently a string # QueryDicts are immutable, we need to copy formcopy = data["form"].data.copy() @@ -267,12 +269,20 @@ class ConfirmEditBook(View): work = models.Work.objects.create(title=form.cleaned_data["title"]) work.authors.set(book.authors.all()) book.parent_work = work - # we don't tell the world when creating a book - book.save(broadcast=False) for author_id in request.POST.getlist("remove_authors"): book.authors.remove(author_id) + # import cover, if requested + url = request.POST.get("cover-url") + if url: + image = set_cover_from_url(url) + if image: + book.cover.save(*image, save=False) + + # we don't tell the world when creating a book + book.save(broadcast=False) + return redirect(f"/book/{book.id}") diff --git a/bookwyrm/views/directory.py b/bookwyrm/views/directory.py index 8d893047a..81898af26 100644 --- a/bookwyrm/views/directory.py +++ b/bookwyrm/views/directory.py @@ -25,10 +25,10 @@ class Directory(View): users = suggested_users.get_annotated_users(request.user, **filters) sort = request.GET.get("sort") - if sort == "recent": - users = users.order_by("-last_active_date") - else: + if sort == "suggested": users = users.order_by("-mutuals", "-last_active_date") + else: + users = users.order_by("-last_active_date") paginated = Paginator(users, 12) diff --git a/bookwyrm/views/get_started.py b/bookwyrm/views/get_started.py index 4a6b55c58..68eedeffe 100644 --- a/bookwyrm/views/get_started.py +++ b/bookwyrm/views/get_started.py @@ -13,7 +13,7 @@ from django.views import View from bookwyrm import forms, models from bookwyrm.connectors import connector_manager from bookwyrm.suggested_users import suggested_users -from .edit_user import save_user_form +from .preferences.edit_user import save_user_form # pylint: disable= no-self-use diff --git a/bookwyrm/views/goal.py b/bookwyrm/views/goal.py index 105c8b90b..b28c04766 100644 --- a/bookwyrm/views/goal.py +++ b/bookwyrm/views/goal.py @@ -41,7 +41,7 @@ class Goal(View): "year": year, "is_self": request.user == user, } - return TemplateResponse(request, "goal.html", data) + return TemplateResponse(request, "user/goal.html", data) def post(self, request, username, year): """update or create an annual goal""" @@ -58,7 +58,7 @@ class Goal(View): "goal": goal, "year": year, } - return TemplateResponse(request, "goal.html", data) + return TemplateResponse(request, "user/goal.html", data) goal = form.save() if request.POST.get("post-status"): diff --git a/bookwyrm/views/password.py b/bookwyrm/views/password.py index b9cb99ded..ff2a02622 100644 --- a/bookwyrm/views/password.py +++ b/bookwyrm/views/password.py @@ -1,10 +1,8 @@ """ class views for password management """ from django.contrib.auth import login -from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.shortcuts import redirect from django.template.response import TemplateResponse -from django.utils.decorators import method_decorator from django.utils.translation import gettext_lazy as _ from django.views import View @@ -82,26 +80,3 @@ class PasswordReset(View): login(request, user) reset_code.delete() return redirect("/") - - -@method_decorator(login_required, name="dispatch") -class ChangePassword(View): - """change password as logged in user""" - - def get(self, request): - """change password page""" - data = {"user": request.user} - return TemplateResponse(request, "preferences/change_password.html", data) - - def post(self, request): - """allow a user to change their password""" - new_password = request.POST.get("password") - confirm_password = request.POST.get("confirm-password") - - if new_password != confirm_password: - return redirect("prefs-password") - - request.user.set_password(new_password) - request.user.save(broadcast=False, update_fields=["password"]) - login(request, request.user) - return redirect("user-feed", request.user.localname) diff --git a/bookwyrm/views/preferences/__init__.py b/bookwyrm/views/preferences/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/bookwyrm/views/block.py b/bookwyrm/views/preferences/block.py similarity index 100% rename from bookwyrm/views/block.py rename to bookwyrm/views/preferences/block.py diff --git a/bookwyrm/views/preferences/change_password.py b/bookwyrm/views/preferences/change_password.py new file mode 100644 index 000000000..cdfc9d333 --- /dev/null +++ b/bookwyrm/views/preferences/change_password.py @@ -0,0 +1,31 @@ +""" class views for password management """ +from django.contrib.auth import login +from django.contrib.auth.decorators import login_required +from django.shortcuts import redirect +from django.template.response import TemplateResponse +from django.utils.decorators import method_decorator +from django.views import View + + +# pylint: disable= no-self-use +@method_decorator(login_required, name="dispatch") +class ChangePassword(View): + """change password as logged in user""" + + def get(self, request): + """change password page""" + data = {"user": request.user} + return TemplateResponse(request, "preferences/change_password.html", data) + + def post(self, request): + """allow a user to change their password""" + new_password = request.POST.get("password") + confirm_password = request.POST.get("confirm-password") + + if new_password != confirm_password: + return redirect("prefs-password") + + request.user.set_password(new_password) + request.user.save(broadcast=False, update_fields=["password"]) + login(request, request.user) + return redirect("user-feed", request.user.localname) diff --git a/bookwyrm/views/preferences/delete_user.py b/bookwyrm/views/preferences/delete_user.py new file mode 100644 index 000000000..17daf0216 --- /dev/null +++ b/bookwyrm/views/preferences/delete_user.py @@ -0,0 +1,38 @@ +""" edit your own account """ +from django.contrib.auth import logout +from django.contrib.auth.decorators import login_required +from django.shortcuts import redirect +from django.template.response import TemplateResponse +from django.utils.decorators import method_decorator +from django.views import View + +from bookwyrm import forms, models + + +# pylint: disable=no-self-use +@method_decorator(login_required, name="dispatch") +class DeleteUser(View): + """delete user view""" + + def get(self, request): + """delete page for a user""" + data = { + "form": forms.DeleteUserForm(), + "user": request.user, + } + return TemplateResponse(request, "preferences/delete_user.html", data) + + def post(self, request): + """les get fancy with images""" + form = forms.DeleteUserForm(request.POST, instance=request.user) + # idk why but I couldn't get check_password to work on request.user + user = models.User.objects.get(id=request.user.id) + if form.is_valid() and user.check_password(form.cleaned_data["password"]): + user.deactivation_reason = "self_deletion" + user.delete() + logout(request) + return redirect("/") + + form.errors["password"] = ["Invalid password"] + data = {"form": form, "user": request.user} + return TemplateResponse(request, "preferences/delete_user.html", data) diff --git a/bookwyrm/views/edit_user.py b/bookwyrm/views/preferences/edit_user.py similarity index 67% rename from bookwyrm/views/edit_user.py rename to bookwyrm/views/preferences/edit_user.py index 0a2d93275..275304d76 100644 --- a/bookwyrm/views/edit_user.py +++ b/bookwyrm/views/preferences/edit_user.py @@ -1,9 +1,8 @@ -""" edit or delete ones own account""" +""" edit your own account """ from io import BytesIO from uuid import uuid4 from PIL import Image -from django.contrib.auth import logout from django.contrib.auth.decorators import login_required from django.core.files.base import ContentFile from django.shortcuts import redirect @@ -11,7 +10,7 @@ from django.template.response import TemplateResponse from django.utils.decorators import method_decorator from django.views import View -from bookwyrm import forms, models +from bookwyrm import forms # pylint: disable=no-self-use @@ -39,35 +38,6 @@ class EditUser(View): return redirect("user-feed", request.user.localname) -# pylint: disable=no-self-use -@method_decorator(login_required, name="dispatch") -class DeleteUser(View): - """delete user view""" - - def get(self, request): - """delete page for a user""" - data = { - "form": forms.DeleteUserForm(), - "user": request.user, - } - return TemplateResponse(request, "preferences/delete_user.html", data) - - def post(self, request): - """les get fancy with images""" - form = forms.DeleteUserForm(request.POST, instance=request.user) - # idk why but I couldn't get check_password to work on request.user - user = models.User.objects.get(id=request.user.id) - if form.is_valid() and user.check_password(form.cleaned_data["password"]): - user.deactivation_reason = "self_deletion" - user.delete() - logout(request) - return redirect("/") - - form.errors["password"] = ["Invalid password"] - data = {"form": form, "user": request.user} - return TemplateResponse(request, "preferences/delete_user.html", data) - - def save_user_form(form): """special handling for the user form""" user = form.save(commit=False) diff --git a/bookwyrm/views/shelf.py b/bookwyrm/views/shelf.py index 6e75cc999..35f660b5f 100644 --- a/bookwyrm/views/shelf.py +++ b/bookwyrm/views/shelf.py @@ -85,12 +85,14 @@ class Shelf(View): "shelves": shelves, "shelf": shelf, "books": page, + "edit_form": forms.ShelfForm(instance=shelf if shelf_identifier else None), + "create_form": forms.ShelfForm(), "page_range": paginated.get_elided_page_range( page.number, on_each_side=2, on_ends=1 ), } - return TemplateResponse(request, "user/shelf/shelf.html", data) + return TemplateResponse(request, "shelf/shelf.html", data) @method_decorator(login_required, name="dispatch") # pylint: disable=unused-argument @@ -128,7 +130,7 @@ def create_shelf(request): def delete_shelf(request, shelf_id): """user generated shelves""" shelf = get_object_or_404(models.Shelf, id=shelf_id) - shelf.raise_not_deletable() + shelf.raise_not_deletable(request.user) shelf.delete() return redirect("user-shelves", request.user.localname) diff --git a/locale/de_DE/LC_MESSAGES/django.po b/locale/de_DE/LC_MESSAGES/django.po index cec74f9d9..d0345fb6a 100644 --- a/locale/de_DE/LC_MESSAGES/django.po +++ b/locale/de_DE/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-03-02 17:19-0800\n" "Last-Translator: Mouse Reeve \n" "Language-Team: English \n" @@ -18,67 +18,68 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 #, fuzzy #| msgid "A user with that username already exists." msgid "A user with this email already exists." msgstr "Dieser Benutzename ist bereits vergeben." -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "Ein Tag" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "Eine Woche" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "Ein Monat" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "Läuft nicht aus" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" -msgstr "%(count)d Benutzungen" +#: bookwyrm/forms.py:262 +#, fuzzy, python-brace-format +#| msgid "Max uses" +msgid "{i} uses" +msgstr "Maximale Benutzungen" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 #, fuzzy #| msgid "Unlisted" msgid "Unlimited" msgstr "Ungelistet" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "Reihenfolge der Liste" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 #, fuzzy #| msgid "Title" msgid "Book Title" msgstr "Titel" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "Sortieren nach" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 #, fuzzy #| msgid "Started reading" msgid "Ascending" msgstr "Zu lesen angefangen" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 #, fuzzy #| msgid "Started reading" msgid "Descending" @@ -92,29 +93,29 @@ msgstr "" msgid "Could not find a match for book" msgstr "" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 #, fuzzy #| msgid "Started reading" msgid "Pending" msgstr "Zu lesen angefangen" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 #, fuzzy #| msgid "Moderator Comments" msgid "Moderator suspension" msgstr "Moderator:innenkommentare" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 #, fuzzy #| msgid "List curation:" msgid "Moderator deletion" msgstr "Listenkuratierung:" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 msgid "Domain block" msgstr "" @@ -143,7 +144,7 @@ msgstr "%(value)s ist keine gültige remote_id" msgid "%(value)s is not a valid username" msgstr "%(value)s ist kein gültiger Username" -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "Username" @@ -353,7 +354,7 @@ msgstr "" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -483,7 +484,7 @@ msgstr "Themen" msgid "Places" msgstr "Orte" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -499,7 +500,7 @@ msgstr "Zur Liste" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -847,7 +848,7 @@ msgstr "Bestätigungslink erneut senden" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "E-Mail Adresse" @@ -876,7 +877,7 @@ msgstr "Föderiert" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "Vereichnis" @@ -959,7 +960,7 @@ msgstr "Alle bekannten Nutzer*innen" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 #, fuzzy #| msgid "Discard" msgid "Discover" @@ -1095,7 +1096,7 @@ msgid "Direct Messages with %(username)s" msgstr "Direktnachrichten mit %(username)s" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "Direktnachrichten" @@ -1182,7 +1183,7 @@ msgid "What are you reading?" msgstr "Zu lesen angefangen" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "Nach einem Buch suchen" @@ -1200,8 +1201,8 @@ msgstr "Du kannst Bücher hinzufügen, wenn du %(site_name)s benutzt." #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1220,7 +1221,7 @@ msgid "Popular on %(site_name)s" msgstr "Über %(site_name)s" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "Keine Bücher gefunden" @@ -1274,12 +1275,12 @@ msgid "Finish" msgstr "Abgeschlossen" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "Displayname:" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "Bio:" @@ -1288,17 +1289,17 @@ msgid "A little bit about you" msgstr "Etwas über dich" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "Folgende manuell bestätigen" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "Diesen Account in vorgeschlagenen Usern zeigen" @@ -1538,31 +1539,37 @@ msgstr "Danke! Deine Anfrage ist eingegangen." msgid "Your Account" msgstr "Dein Account" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, fuzzy, python-format +#| msgid "About %(site_name)s" +msgid "%(site_name)s search" +msgstr "Über %(site_name)s" + +#: bookwyrm/templates/layout.html:43 #, fuzzy #| msgid "Search for a book or user" msgid "Search for a book, user, or list" msgstr "Suche nach Buch oder Benutzer*in" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "Navigationshauptmenü" -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 #, fuzzy #| msgid "Your books" msgid "Your Books" msgstr "Deine Bücher" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "Einstellungen" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1570,77 +1577,77 @@ msgstr "Einstellungen" msgid "Invites" msgstr "Einladungen" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "Abmelden" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "Benachrichtigungen" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "Passwort" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "Passwort vergessen?" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "Anmelden" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 #, fuzzy #| msgid "Successfully imported" msgid "Successfully posted status" msgstr "Erfolgreich importiert" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 #, fuzzy #| msgid "Boost status" msgid "Error posting status" msgstr "Status teilen" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 #, fuzzy #| msgid "About this server" msgid "About this instance" msgstr "Über diesen Server" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "Admin kontaktieren" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 #, fuzzy #| msgid "List curation:" msgid "Documentation" msgstr "Listenkuratierung:" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "%(site_name)s auf %(support_title)s unterstützen" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "BookWyrm ist open source Software. Du kannst dich auf GitHub beteiligen oder etwas melden." @@ -1746,7 +1753,7 @@ msgstr "Offen" msgid "Anyone can add books to this list" msgstr "Alle können Bücher hinzufügen" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 #, fuzzy #| msgid "Delete status" msgid "Delete list" @@ -1772,7 +1779,7 @@ msgstr "Diese Liste ist momentan leer" msgid "Added by %(username)s" msgstr "Direktnachrichten mit %(username)s" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 #, fuzzy #| msgid "List curation:" msgid "List position" @@ -1784,46 +1791,46 @@ msgstr "Listenkuratierung:" msgid "Set" msgstr "Gestartet" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "Entfernen" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 #, fuzzy #| msgid "Your Lists" msgid "Sort List" msgstr "Deine Listen" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 #, fuzzy #| msgid "List curation:" msgid "Direction" msgstr "Listenkuratierung:" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "Bücher hinzufügen" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "Bücher vorschlagen" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "suchen" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "Suche leeren" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "Keine passenden Bücher zu \"%(query)s\" gefunden" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "Vorschlagen" @@ -2112,7 +2119,7 @@ msgstr "Passwort zurücksetzen" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "Blockierte Nutzer*innen" @@ -2123,7 +2130,7 @@ msgstr "Momentan keine Nutzer*innen blockiert." #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "Passwort ändern" @@ -2134,7 +2141,7 @@ msgstr "Neues Passwort:" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 #, fuzzy #| msgid "Create an Account" @@ -2151,46 +2158,62 @@ msgstr "Das Löschen des Accounts kann nicht rückgängig gemacht werden. Der Us #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "Profil bearbeiten:" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "Profil" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +#, fuzzy +#| msgid "Email preference" +msgid "Display preferences" +msgstr "E-Mail Einstellungen" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +#, fuzzy +#| msgid "Private" +msgid "Privacy" +msgstr "Privat" + +#: bookwyrm/templates/preferences/edit_user.html:72 #, fuzzy #| msgid "Show set reading goal prompt in feed:" msgid "Show reading goal prompt in feed:" msgstr "Angegebenes Leseziel im Feed anzeigen." -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 #, fuzzy #| msgid "Suggest Books" msgid "Show suggested users:" msgstr "Bücher vorschlagen" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "Dein Account wird im directory angezeigt und eventuell anderen Usern empfohlen." -#: bookwyrm/templates/preferences/edit_user.html:68 +#: bookwyrm/templates/preferences/edit_user.html:89 +msgid "Preferred Timezone: " +msgstr "Bevorzugte Zeitzone:" + +#: bookwyrm/templates/preferences/edit_user.html:110 #, fuzzy #| msgid "Goal privacy:" msgid "Default post privacy:" msgstr "Sichtbarkeit des Ziels" -#: bookwyrm/templates/preferences/edit_user.html:75 -msgid "Preferred Timezone: " -msgstr "Bevorzugte Zeitzone:" - #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "Profil" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "Beziehungen" @@ -3604,7 +3627,7 @@ msgstr "Zu lesen angefangen" msgid "Show more" msgstr "Mehr anzeigen" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "Weniger anzeigen" @@ -3938,7 +3961,7 @@ msgstr "" msgid "Not a valid csv file" msgstr "E-Mail Adresse" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "Username oder Passwort sind falsch" @@ -3949,8 +3972,9 @@ msgid "No user with that email address was found." msgstr "Dieser Benutzename ist bereits vergeben." #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, fuzzy, python-brace-format +#| msgid "A password reset link sent to %s" +msgid "A password reset link sent to {email}" msgstr "Ein Passwortwiederherstellungslinl wurde zu %s gesendet" #: bookwyrm/views/rss_feed.py:34 @@ -3958,6 +3982,9 @@ msgstr "Ein Passwortwiederherstellungslinl wurde zu %s gesendet" msgid "Status updates from {obj.display_name}" msgstr "Status updates von {obj.display_name}" +#~ msgid "%(count)d uses" +#~ msgstr "%(count)d Benutzungen" + #~ msgid "This instance is closed" #~ msgstr "Diese Instanz ist geschlossen" diff --git a/locale/en_US/LC_MESSAGES/django.po b/locale/en_US/LC_MESSAGES/django.po index a9daa819b..7b6fcda5a 100644 --- a/locale/en_US/LC_MESSAGES/django.po +++ b/locale/en_US/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-02-28 17:19-0800\n" "Last-Translator: Mouse Reeve \n" "Language-Team: English \n" @@ -18,59 +18,59 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 msgid "A user with this email already exists." msgstr "" -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" +#: bookwyrm/forms.py:262 +#, python-brace-format +msgid "{i} uses" msgstr "" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 msgid "Unlimited" msgstr "" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 msgid "Book Title" msgstr "" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 msgid "Ascending" msgstr "" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 msgid "Descending" msgstr "" @@ -82,23 +82,23 @@ msgstr "" msgid "Could not find a match for book" msgstr "" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 msgid "Pending" msgstr "" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 msgid "Moderator suspension" msgstr "" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 msgid "Moderator deletion" msgstr "" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 msgid "Domain block" msgstr "" @@ -125,7 +125,7 @@ msgstr "" msgid "%(value)s is not a valid username" msgstr "" -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "" @@ -321,7 +321,7 @@ msgstr "" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -438,7 +438,7 @@ msgstr "" msgid "Places" msgstr "" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -452,7 +452,7 @@ msgstr "" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -772,7 +772,7 @@ msgstr "" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "" @@ -795,7 +795,7 @@ msgstr "" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "" @@ -867,7 +867,7 @@ msgstr "" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 msgid "Discover" msgstr "" @@ -993,7 +993,7 @@ msgid "Direct Messages with %(username)s" msgstr "" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "" @@ -1073,7 +1073,7 @@ msgid "What are you reading?" msgstr "" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "" @@ -1091,8 +1091,8 @@ msgstr "" #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1108,7 +1108,7 @@ msgid "Popular on %(site_name)s" msgstr "" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "" @@ -1153,12 +1153,12 @@ msgid "Finish" msgstr "" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "" @@ -1167,17 +1167,17 @@ msgid "A little bit about you" msgstr "" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "" @@ -1408,27 +1408,32 @@ msgstr "" msgid "Your Account" msgstr "" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, python-format +msgid "%(site_name)s search" +msgstr "" + +#: bookwyrm/templates/layout.html:43 msgid "Search for a book, user, or list" msgstr "" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "" -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 msgid "Your Books" msgstr "" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1436,69 +1441,69 @@ msgstr "" msgid "Invites" msgstr "" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 msgid "Successfully posted status" msgstr "" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 msgid "Error posting status" msgstr "" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 msgid "About this instance" msgstr "" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 msgid "Documentation" msgstr "" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "" @@ -1598,7 +1603,7 @@ msgstr "" msgid "Anyone can add books to this list" msgstr "" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 msgid "Delete list" msgstr "" @@ -1619,7 +1624,7 @@ msgstr "" msgid "Added by %(username)s" msgstr "" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 msgid "List position" msgstr "" @@ -1627,42 +1632,42 @@ msgstr "" msgid "Set" msgstr "" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 msgid "Sort List" msgstr "" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 msgid "Direction" msgstr "" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "" @@ -1926,7 +1931,7 @@ msgstr "" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "" @@ -1937,7 +1942,7 @@ msgstr "" #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "" @@ -1948,7 +1953,7 @@ msgstr "" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 msgid "Delete Account" msgstr "" @@ -1963,40 +1968,52 @@ msgstr "" #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +msgid "Display preferences" +msgstr "" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +msgid "Privacy" +msgstr "" + +#: bookwyrm/templates/preferences/edit_user.html:72 msgid "Show reading goal prompt in feed:" msgstr "" -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 msgid "Show suggested users:" msgstr "" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "" -#: bookwyrm/templates/preferences/edit_user.html:68 -msgid "Default post privacy:" +#: bookwyrm/templates/preferences/edit_user.html:89 +msgid "Preferred Timezone: " msgstr "" -#: bookwyrm/templates/preferences/edit_user.html:75 -msgid "Preferred Timezone: " +#: bookwyrm/templates/preferences/edit_user.html:110 +msgid "Default post privacy:" msgstr "" #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "" @@ -3211,7 +3228,7 @@ msgstr "" msgid "Show more" msgstr "" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "" @@ -3505,7 +3522,7 @@ msgstr "" msgid "Not a valid csv file" msgstr "" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "" @@ -3514,8 +3531,8 @@ msgid "No user with that email address was found." msgstr "" #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, python-brace-format +msgid "A password reset link sent to {email}" msgstr "" #: bookwyrm/views/rss_feed.py:34 diff --git a/locale/es/LC_MESSAGES/django.po b/locale/es/LC_MESSAGES/django.po index 05bc44d21..e9c8d7e89 100644 --- a/locale/es/LC_MESSAGES/django.po +++ b/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-03-19 11:49+0800\n" "Last-Translator: Reese Porter \n" "Language-Team: LANGUAGE \n" @@ -18,59 +18,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 msgid "A user with this email already exists." msgstr "Ya existe un usuario con ese correo electrónico." -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "Un día" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "Una semana" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "Un mes" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "Nunca se vence" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" -msgstr "%(count)d usos" +#: bookwyrm/forms.py:262 +#, fuzzy, python-brace-format +#| msgid "Max uses" +msgid "{i} uses" +msgstr "Número máximo de usos" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 msgid "Unlimited" msgstr "Sin límite" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "Orden de la lista" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 msgid "Book Title" msgstr "Título" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "Calificación" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "Ordenar por" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 msgid "Ascending" msgstr "Ascendente" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 msgid "Descending" msgstr "Descendente" @@ -82,23 +83,23 @@ msgstr "Error en cargar libro" msgid "Could not find a match for book" msgstr "No se pudo encontrar el libro" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 msgid "Pending" msgstr "Pendiente" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "Auto-eliminación" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 msgid "Moderator suspension" msgstr "Suspensión de moderador" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 msgid "Moderator deletion" msgstr "Eliminación de moderador" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 msgid "Domain block" msgstr "Bloqueo de dominio" @@ -125,7 +126,7 @@ msgstr "%(value)s no es un remote_id válido" msgid "%(value)s is not a valid username" msgstr "%(value)s no es un usuario válido" -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "nombre de usuario" @@ -321,7 +322,7 @@ msgstr "Clave Goodreads:" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -438,7 +439,7 @@ msgstr "Sujetos" msgid "Places" msgstr "Lugares" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -452,7 +453,7 @@ msgstr "Agregar a lista" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -772,7 +773,7 @@ msgstr "Reenviar enlace de confirmación" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "Dirección de correo electrónico:" @@ -795,7 +796,7 @@ msgstr "Comunidad federalizada" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "Directorio" @@ -867,7 +868,7 @@ msgstr "Todos los usuarios conocidos" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 msgid "Discover" msgstr "Descubrir" @@ -993,7 +994,7 @@ msgid "Direct Messages with %(username)s" msgstr "Mensajes directos con %(username)s" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "Mensajes directos" @@ -1073,7 +1074,7 @@ msgid "What are you reading?" msgstr "¿Qué estás leyendo?" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "Buscar libros" @@ -1091,8 +1092,8 @@ msgstr "Puedes agregar libros cuando comiences a usar %(site_name)s." #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1108,7 +1109,7 @@ msgid "Popular on %(site_name)s" msgstr "Popular en %(site_name)s" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "No se encontró ningún libro" @@ -1153,12 +1154,12 @@ msgid "Finish" msgstr "Terminar" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "Nombre de visualización:" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "Resumen:" @@ -1167,17 +1168,17 @@ msgid "A little bit about you" msgstr "Un poco sobre ti" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "Avatar:" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "Aprobar seguidores a mano:" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "Mostrar esta cuenta en los usuarios sugeridos:" @@ -1409,29 +1410,35 @@ msgstr "¡Gracias! Tu solicitud ha sido recibido." msgid "Your Account" msgstr "Tu cuenta" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, fuzzy, python-format +#| msgid "About %(site_name)s" +msgid "%(site_name)s search" +msgstr "Sobre %(site_name)s" + +#: bookwyrm/templates/layout.html:43 #, fuzzy #| msgid "Search for a book or user" msgid "Search for a book, user, or list" msgstr "Buscar un libro o un usuario" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "Menú de navigación central" -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "Actividad" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 msgid "Your Books" msgstr "Tus libros" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "Configuración" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1439,69 +1446,69 @@ msgstr "Configuración" msgid "Invites" msgstr "Invitaciones" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "Admin" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "Cerrar sesión" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "Notificaciones" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "Nombre de usuario:" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "contraseña" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "¿Olvidaste tu contraseña?" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "Iniciar sesión" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "Unirse" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 msgid "Successfully posted status" msgstr "Status publicado exitosamente" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 msgid "Error posting status" msgstr "Error en publicar status" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 msgid "About this instance" msgstr "Sobre esta instancia" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "Contactarse con administradores del sitio" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 msgid "Documentation" msgstr "Documentación de Django" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "Apoyar %(site_name)s en %(support_title)s" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "BookWyrm es software de código abierto. Puedes contribuir o reportar problemas en GitHub." @@ -1601,7 +1608,7 @@ msgstr "Abierto" msgid "Anyone can add books to this list" msgstr "Cualquer usuario puede agregar libros a esta lista" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 msgid "Delete list" msgstr "Eliminar lista" @@ -1622,7 +1629,7 @@ msgstr "Esta lista está vacia" msgid "Added by %(username)s" msgstr "Agregado por %(username)s" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 msgid "List position" msgstr "Posición" @@ -1630,42 +1637,42 @@ msgstr "Posición" msgid "Set" msgstr "Establecido" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "Quitar" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 msgid "Sort List" msgstr "Ordena la lista" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 msgid "Direction" msgstr "Dirección" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "Agregar libros" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "Sugerir libros" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "buscar" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "Borrar búsqueda" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "No se encontró ningún libro correspondiente a la búsqueda: \"%(query)s\"" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "Sugerir" @@ -1929,7 +1936,7 @@ msgstr "Restablecer contraseña" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "Usuarios bloqueados" @@ -1940,7 +1947,7 @@ msgstr "No hay ningún usuario bloqueado actualmente." #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "Cambiar contraseña" @@ -1951,7 +1958,7 @@ msgstr "Nueva contraseña:" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 msgid "Delete Account" msgstr "Quitar cuenta" @@ -1966,40 +1973,56 @@ msgstr "Eliminar tu cuenta no puede ser deshecho. El nombre de usuario no será #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "Editar perfil" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "Perfil" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +#, fuzzy +#| msgid "Email preference" +msgid "Display preferences" +msgstr "Preferencia de correo electrónico" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +#, fuzzy +#| msgid "Post privacy" +msgid "Privacy" +msgstr "Privacidad de publicación" + +#: bookwyrm/templates/preferences/edit_user.html:72 msgid "Show reading goal prompt in feed:" msgstr "Mostrar sugerencia de meta de lectura en el feed:" -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 msgid "Show suggested users:" msgstr "Mostrar usuarios sugeridos:" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "Tu cuenta se aparecerá en el directorio, y puede ser recomendado a otros usuarios de BookWyrm." -#: bookwyrm/templates/preferences/edit_user.html:68 -msgid "Default post privacy:" -msgstr "Privacidad de publicación por defecto:" - -#: bookwyrm/templates/preferences/edit_user.html:75 +#: bookwyrm/templates/preferences/edit_user.html:89 msgid "Preferred Timezone: " msgstr "Huso horario preferido" +#: bookwyrm/templates/preferences/edit_user.html:110 +msgid "Default post privacy:" +msgstr "Privacidad de publicación por defecto:" + #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "Cuenta" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "Perfil" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "Relaciones" @@ -3232,7 +3255,7 @@ msgstr "En orden descendente" msgid "Show more" msgstr "Mostrar más" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "Mostrar menos" @@ -3526,7 +3549,7 @@ msgstr "%(title)s: %(subtitle)s" msgid "Not a valid csv file" msgstr "No un archivo csv válido" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "Nombre de usuario o contraseña es incorrecta" @@ -3535,8 +3558,9 @@ msgid "No user with that email address was found." msgstr "No se pudo encontrar un usuario con esa dirección de correo electrónico." #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, fuzzy, python-brace-format +#| msgid "A password reset link sent to %s" +msgid "A password reset link sent to {email}" msgstr "Un enlace para reestablecer tu contraseña se enviará a %s" #: bookwyrm/views/rss_feed.py:34 @@ -3544,6 +3568,9 @@ msgstr "Un enlace para reestablecer tu contraseña se enviará a %s" msgid "Status updates from {obj.display_name}" msgstr "Actualizaciones de status de {obj.display_name}" +#~ msgid "%(count)d uses" +#~ msgstr "%(count)d usos" + #~ msgid "This instance is closed" #~ msgstr "Esta instancia está cerrada." diff --git a/locale/fr_FR/LC_MESSAGES/django.po b/locale/fr_FR/LC_MESSAGES/django.po index 6a3e7d32f..e84c9e74a 100644 --- a/locale/fr_FR/LC_MESSAGES/django.po +++ b/locale/fr_FR/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-04-05 12:44+0100\n" "Last-Translator: Fabien Basmaison \n" "Language-Team: Mouse Reeve \n" @@ -18,59 +18,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 msgid "A user with this email already exists." msgstr "Cet email est déjà associé à un compte." -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "Un jour" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "Une semaine" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "Un mois" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "Sans expiration" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" -msgstr "%(count)d utilisations" +#: bookwyrm/forms.py:262 +#, fuzzy, python-brace-format +#| msgid "Max uses" +msgid "{i} uses" +msgstr "Nombre maximum d’utilisations" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 msgid "Unlimited" msgstr "Sans limite" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "Ordre de la liste" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 msgid "Book Title" msgstr "Titre du livre" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "Note" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "Trier par" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 msgid "Ascending" msgstr "Ordre croissant" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 msgid "Descending" msgstr "Ordre décroissant" @@ -82,29 +83,29 @@ msgstr "" msgid "Could not find a match for book" msgstr "" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 #, fuzzy #| msgid "Ascending" msgid "Pending" msgstr "Ordre croissant" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 #, fuzzy #| msgid "Moderator Comments" msgid "Moderator suspension" msgstr "Commentaires de l’équipe de modération" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 #, fuzzy #| msgid "List curation:" msgid "Moderator deletion" msgstr "Modération de la liste :" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 #, fuzzy #| msgid "Un-block" msgid "Domain block" @@ -133,7 +134,7 @@ msgstr "%(value)s n’est pas une remote_id valide." msgid "%(value)s is not a valid username" msgstr "%(value)s n’est pas un nom de compte valide." -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "nom du compte :" @@ -333,7 +334,7 @@ msgstr "Clé Goodreads :" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -450,7 +451,7 @@ msgstr "Sujets" msgid "Places" msgstr "Lieux" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -464,7 +465,7 @@ msgstr "Ajouter à la liste" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -786,7 +787,7 @@ msgstr "Envoyer le lien de confirmation de nouveau" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "Adresse email :" @@ -809,7 +810,7 @@ msgstr "Communauté fédérée" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "Répertoire" @@ -883,7 +884,7 @@ msgstr "Tous les comptes connus" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 #, fuzzy #| msgid "Discard" msgid "Discover" @@ -1013,7 +1014,7 @@ msgid "Direct Messages with %(username)s" msgstr "Messages directs avec %(username)s" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "Messages directs" @@ -1098,7 +1099,7 @@ msgid "What are you reading?" msgstr "Que lisez‑vous ?" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "Chercher un livre" @@ -1116,8 +1117,8 @@ msgstr "Vous pourrez ajouter des livres lorsque vous commencerez à utiliser %(s #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1133,7 +1134,7 @@ msgid "Popular on %(site_name)s" msgstr "Populaire sur %(site_name)s" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "Aucun livre trouvé" @@ -1178,12 +1179,12 @@ msgid "Finish" msgstr "Terminer" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "Nom affiché :" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "Résumé :" @@ -1192,17 +1193,17 @@ msgid "A little bit about you" msgstr "Parlez‑nous de vous" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "Avatar :" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "Autoriser les abonnements manuellement :" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "Afficher ce compte dans ceux suggérés :" @@ -1438,29 +1439,35 @@ msgstr "Merci ! Votre demande a bien été reçue." msgid "Your Account" msgstr "Votre compte" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, fuzzy, python-format +#| msgid "About %(site_name)s" +msgid "%(site_name)s search" +msgstr "À propos de %(site_name)s" + +#: bookwyrm/templates/layout.html:43 #, fuzzy #| msgid "Search for a book or user" msgid "Search for a book, user, or list" msgstr "Chercher un livre ou un compte" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "Menu de navigation principal " -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "Fil d’actualité" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 msgid "Your Books" msgstr "Vos Livres" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "Paramètres" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1468,73 +1475,73 @@ msgstr "Paramètres" msgid "Invites" msgstr "Invitations" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "Admin" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "Se déconnecter" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "Notifications" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "Nom du compte :" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "Mot de passe" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "Mot de passe oublié ?" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "Se connecter" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "Rejoindre" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 #, fuzzy #| msgid "Successfully imported" msgid "Successfully posted status" msgstr "Importation réussie" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 #, fuzzy #| msgid "Boost status" msgid "Error posting status" msgstr "Partager le statut" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 msgid "About this instance" msgstr "À propos de cette instance" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "Contacter l’administrateur du site" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 msgid "Documentation" msgstr "Documentation" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "Soutenez %(site_name)s avec %(support_title)s" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "BookWyrm est un logiciel libre. Vous pouvez contribuer ou faire des rapports de bogues via GitHub." @@ -1638,7 +1645,7 @@ msgstr "Ouverte" msgid "Anyone can add books to this list" msgstr "N’importe qui peut suggérer des livres" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 #, fuzzy #| msgid "Delete status" msgid "Delete list" @@ -1661,7 +1668,7 @@ msgstr "Cette liste est actuellement vide" msgid "Added by %(username)s" msgstr "Ajouté par %(username)s" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 msgid "List position" msgstr "Position" @@ -1669,42 +1676,42 @@ msgstr "Position" msgid "Set" msgstr "Appliquer" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "Retirer" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 msgid "Sort List" msgstr "Trier la liste" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 msgid "Direction" msgstr "Direction" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "Ajouter des livres" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "Suggérer des livres" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "chercher" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "Vider la requête" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "Aucun livre trouvé pour la requête « %(query)s »" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "Suggérer" @@ -1974,7 +1981,7 @@ msgstr "Changer de mot de passe" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "Comptes bloqués" @@ -1985,7 +1992,7 @@ msgstr "Aucun compte bloqué actuellement" #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "Changer le mot de passe" @@ -1996,7 +2003,7 @@ msgstr "Nouveau mot de passe :" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 #, fuzzy #| msgid "Create an Account" @@ -2013,46 +2020,62 @@ msgstr "" #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "Modifier le profil" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "Profil" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +#, fuzzy +#| msgid "Email preference" +msgid "Display preferences" +msgstr "Paramètres d’email" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +#, fuzzy +#| msgid "Post privacy" +msgid "Privacy" +msgstr "Confidentialité du statut" + +#: bookwyrm/templates/preferences/edit_user.html:72 #, fuzzy #| msgid "Show set reading goal prompt in feed:" msgid "Show reading goal prompt in feed:" msgstr "Afficher le message pour définir un défi lecture dans le fil d’actualité :" -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 #, fuzzy #| msgid "Show this account in suggested users:" msgid "Show suggested users:" msgstr "Afficher ce compte dans ceux suggérés :" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "Votre compte sera listé dans le répertoire et pourra être recommandé à d’autres utilisateurs ou utilisatrices de BookWyrm." -#: bookwyrm/templates/preferences/edit_user.html:68 +#: bookwyrm/templates/preferences/edit_user.html:89 +msgid "Preferred Timezone: " +msgstr "Fuseau horaire préféré" + +#: bookwyrm/templates/preferences/edit_user.html:110 #, fuzzy #| msgid "Post privacy" msgid "Default post privacy:" msgstr "Confidentialité du statut" -#: bookwyrm/templates/preferences/edit_user.html:75 -msgid "Preferred Timezone: " -msgstr "Fuseau horaire préféré" - #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "Compte" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "Profil" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "Relations" @@ -3347,7 +3370,7 @@ msgstr "Trié par ordre décroissant" msgid "Show more" msgstr "Déplier" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "Replier" @@ -3662,7 +3685,7 @@ msgstr "%(title)s (%(subtitle)s)" msgid "Not a valid csv file" msgstr "Fichier CSV non valide" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "" @@ -3671,8 +3694,9 @@ msgid "No user with that email address was found." msgstr "Aucun compte avec cette adresse email n’a été trouvé." #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, fuzzy, python-brace-format +#| msgid "A password reset link sent to %s" +msgid "A password reset link sent to {email}" msgstr "Un lien de réinitialisation a été envoyé à %s." #: bookwyrm/views/rss_feed.py:34 @@ -3680,6 +3704,9 @@ msgstr "Un lien de réinitialisation a été envoyé à %s." msgid "Status updates from {obj.display_name}" msgstr "" +#~ msgid "%(count)d uses" +#~ msgstr "%(count)d utilisations" + #~ msgid "This instance is closed" #~ msgstr "Cette instance est fermée" diff --git a/locale/zh_Hans/LC_MESSAGES/django.po b/locale/zh_Hans/LC_MESSAGES/django.po index 93e5b1aff..142045a9f 100644 --- a/locale/zh_Hans/LC_MESSAGES/django.po +++ b/locale/zh_Hans/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-03-20 00:56+0000\n" "Last-Translator: Kana \n" "Language-Team: Mouse Reeve \n" @@ -18,59 +18,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 msgid "A user with this email already exists." msgstr "已经存在使用该邮箱的用户。" -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "一天" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "一周" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "一个月" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "永不失效" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" -msgstr "%(count)d 次使用" +#: bookwyrm/forms.py:262 +#, fuzzy, python-brace-format +#| msgid "Max uses" +msgid "{i} uses" +msgstr "最大使用次数" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 msgid "Unlimited" msgstr "不受限" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "列表顺序" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 msgid "Book Title" msgstr "书名" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "评价" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "排序方式" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 msgid "Ascending" msgstr "升序" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 msgid "Descending" msgstr "降序" @@ -82,29 +83,29 @@ msgstr "" msgid "Could not find a match for book" msgstr "" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 #, fuzzy #| msgid "Ascending" msgid "Pending" msgstr "升序" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 #, fuzzy #| msgid "Moderator Comments" msgid "Moderator suspension" msgstr "监察员评论" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 #, fuzzy #| msgid "Mentions" msgid "Moderator deletion" msgstr "提及" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 #, fuzzy #| msgid "Un-block" msgid "Domain block" @@ -133,7 +134,7 @@ msgstr "%(value)s 不是有效的 remote_id" msgid "%(value)s is not a valid username" msgstr "%(value)s 不是有效的用户名" -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "用户名" @@ -329,7 +330,7 @@ msgstr "Goodreads key:" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -445,7 +446,7 @@ msgstr "主题" msgid "Places" msgstr "地点" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -459,7 +460,7 @@ msgstr "添加到列表" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -781,7 +782,7 @@ msgstr "重新发送确认链接" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "邮箱地址:" @@ -804,7 +805,7 @@ msgstr "跨站社区" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "目录" @@ -874,7 +875,7 @@ msgstr "所有已知用户" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 msgid "Discover" msgstr "发现" @@ -1000,7 +1001,7 @@ msgid "Direct Messages with %(username)s" msgstr "与 %(username)s 私信" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "私信" @@ -1084,7 +1085,7 @@ msgid "What are you reading?" msgstr "你在阅读什么?" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "搜索书目" @@ -1102,8 +1103,8 @@ msgstr "你可以在开始使用 %(site_name)s 后添加书目。" #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1119,7 +1120,7 @@ msgid "Popular on %(site_name)s" msgstr "%(site_name)s 上的热门" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "没有找到书目" @@ -1164,12 +1165,12 @@ msgid "Finish" msgstr "完成" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "显示名称:" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "概要:" @@ -1178,17 +1179,17 @@ msgid "A little bit about you" msgstr "少许关于你的信息" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "头像:" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "手动批准关注者:" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "在推荐的用户中显示此帐号:" @@ -1420,29 +1421,35 @@ msgstr "谢谢你!我们已经收到了你的请求。" msgid "Your Account" msgstr "你的帐号" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, fuzzy, python-format +#| msgid "About %(site_name)s" +msgid "%(site_name)s search" +msgstr "关于 %(site_name)s" + +#: bookwyrm/templates/layout.html:43 #, fuzzy #| msgid "Search for a book or user" msgid "Search for a book, user, or list" msgstr "搜索书目或用户" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "主导航菜单" -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "动态" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 msgid "Your Books" msgstr "你的书目" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "设置" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1450,73 +1457,73 @@ msgstr "设置" msgid "Invites" msgstr "邀请" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "管理员" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "登出" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "通知" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "用户名:" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "密码" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "忘记了密码?" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "登录" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "加入" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 #, fuzzy #| msgid "Successfully imported" msgid "Successfully posted status" msgstr "成功导入了" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 #, fuzzy #| msgid "Boost status" msgid "Error posting status" msgstr "转发状态" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 msgid "About this instance" msgstr "关于本实例" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "联系站点管理员" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 msgid "Documentation" msgstr "文档" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "在 %(support_title)s 上支持 %(site_name)s" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "BookWyrm 是开源软件。你可以在 GitHub 贡献或报告问题。" @@ -1618,7 +1625,7 @@ msgstr "开放" msgid "Anyone can add books to this list" msgstr "任何人都可以向此列表中添加书目" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 #, fuzzy #| msgid "Delete status" msgid "Delete list" @@ -1641,7 +1648,7 @@ msgstr "此列表当前是空的" msgid "Added by %(username)s" msgstr "由 %(username)s 添加" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 msgid "List position" msgstr "列表位置:" @@ -1649,42 +1656,42 @@ msgstr "列表位置:" msgid "Set" msgstr "设定" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "移除" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 msgid "Sort List" msgstr "排序列表" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 msgid "Direction" msgstr "方向" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "添加书目" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "推荐书目" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "搜索" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "清除搜索" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "没有符合 “%(query)s” 请求的书目" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "推荐" @@ -1955,7 +1962,7 @@ msgstr "重设密码" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "屏蔽的用户" @@ -1966,7 +1973,7 @@ msgstr "当前没有被屏蔽的用户。" #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "更改密码" @@ -1977,7 +1984,7 @@ msgstr "新密码:" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 msgid "Delete Account" msgstr "删除帐号" @@ -1992,44 +1999,60 @@ msgstr "删除帐号的操作将无法被撤销。对应用户名也无法被再 #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "编辑个人资料" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "个人资料" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +#, fuzzy +#| msgid "Email preference" +msgid "Display preferences" +msgstr "邮箱偏好" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +#, fuzzy +#| msgid "Post privacy" +msgid "Privacy" +msgstr "发文隐私" + +#: bookwyrm/templates/preferences/edit_user.html:72 #, fuzzy #| msgid "Show set reading goal prompt in feed:" msgid "Show reading goal prompt in feed:" msgstr "在消息流中显示设置阅读目标的提示:" -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 #, fuzzy #| msgid "Show this account in suggested users:" msgid "Show suggested users:" msgstr "在推荐的用户中显示此帐号:" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "你的帐号会显示在 目录 中,并可能受其它 BookWyrm 用户推荐。" -#: bookwyrm/templates/preferences/edit_user.html:68 -msgid "Default post privacy:" -msgstr "默认发文隐私:" - -#: bookwyrm/templates/preferences/edit_user.html:75 +#: bookwyrm/templates/preferences/edit_user.html:89 msgid "Preferred Timezone: " msgstr "偏好的时区:" +#: bookwyrm/templates/preferences/edit_user.html:110 +msgid "Default post privacy:" +msgstr "默认发文隐私:" + #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "帐号" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "个人资料" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "关系" @@ -3292,7 +3315,7 @@ msgstr "降序排序" msgid "Show more" msgstr "显示更多" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "显示更少" @@ -3601,7 +3624,7 @@ msgstr "%(title)s:%(subtitle)s" msgid "Not a valid csv file" msgstr "不是有效的 csv 文件" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "用户名或密码不正确" @@ -3610,8 +3633,9 @@ msgid "No user with that email address was found." msgstr "没有找到使用该邮箱的用户。" #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, fuzzy, python-brace-format +#| msgid "A password reset link sent to %s" +msgid "A password reset link sent to {email}" msgstr "密码重置连接已发送给 %s" #: bookwyrm/views/rss_feed.py:34 @@ -3619,6 +3643,9 @@ msgstr "密码重置连接已发送给 %s" msgid "Status updates from {obj.display_name}" msgstr "" +#~ msgid "%(count)d uses" +#~ msgstr "%(count)d 次使用" + #~ msgid "This instance is closed" #~ msgstr "本实例不开放。" diff --git a/locale/zh_Hant/LC_MESSAGES/django.po b/locale/zh_Hant/LC_MESSAGES/django.po index b9fbcc39b..20bf0d1bb 100644 --- a/locale/zh_Hant/LC_MESSAGES/django.po +++ b/locale/zh_Hant/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-09-20 19:44+0000\n" +"POT-Creation-Date: 2021-09-28 18:31+0000\n" "PO-Revision-Date: 2021-06-30 10:36+0000\n" "Last-Translator: Grace Cheng \n" "Language-Team: LANGUAGE \n" @@ -18,59 +18,60 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: bookwyrm/forms.py:242 +#: bookwyrm/forms.py:241 msgid "A user with this email already exists." msgstr "已經存在使用該郵箱的使用者。" -#: bookwyrm/forms.py:256 +#: bookwyrm/forms.py:255 msgid "One Day" msgstr "一天" -#: bookwyrm/forms.py:257 +#: bookwyrm/forms.py:256 msgid "One Week" msgstr "一週" -#: bookwyrm/forms.py:258 +#: bookwyrm/forms.py:257 msgid "One Month" msgstr "一個月" -#: bookwyrm/forms.py:259 +#: bookwyrm/forms.py:258 msgid "Does Not Expire" msgstr "永不失效" -#: bookwyrm/forms.py:264 -#, python-format -msgid "%(count)d uses" -msgstr "%(count)d 次使用" +#: bookwyrm/forms.py:262 +#, fuzzy, python-brace-format +#| msgid "Max uses" +msgid "{i} uses" +msgstr "最大使用次數" -#: bookwyrm/forms.py:267 +#: bookwyrm/forms.py:263 msgid "Unlimited" msgstr "不受限" -#: bookwyrm/forms.py:329 +#: bookwyrm/forms.py:325 msgid "List Order" msgstr "列表順序" -#: bookwyrm/forms.py:330 +#: bookwyrm/forms.py:326 msgid "Book Title" msgstr "書名" -#: bookwyrm/forms.py:331 +#: bookwyrm/forms.py:327 #: bookwyrm/templates/snippets/create_status/review.html:33 #: bookwyrm/templates/user/shelf/shelf.html:117 #: bookwyrm/templates/user/shelf/shelf.html:148 msgid "Rating" msgstr "評價" -#: bookwyrm/forms.py:333 bookwyrm/templates/lists/list.html:107 +#: bookwyrm/forms.py:329 bookwyrm/templates/lists/list.html:109 msgid "Sort By" msgstr "排序方式" -#: bookwyrm/forms.py:337 +#: bookwyrm/forms.py:333 msgid "Ascending" msgstr "升序" -#: bookwyrm/forms.py:338 +#: bookwyrm/forms.py:334 msgid "Descending" msgstr "降序" @@ -82,29 +83,29 @@ msgstr "" msgid "Could not find a match for book" msgstr "" -#: bookwyrm/models/base_model.py:13 +#: bookwyrm/models/base_model.py:16 #, fuzzy #| msgid "Ascending" msgid "Pending" msgstr "升序" -#: bookwyrm/models/base_model.py:14 +#: bookwyrm/models/base_model.py:17 msgid "Self deletion" msgstr "" -#: bookwyrm/models/base_model.py:15 +#: bookwyrm/models/base_model.py:18 #, fuzzy #| msgid "Moderator Comments" msgid "Moderator suspension" msgstr "監察員評論" -#: bookwyrm/models/base_model.py:16 +#: bookwyrm/models/base_model.py:19 #, fuzzy #| msgid "Mentions" msgid "Moderator deletion" msgstr "提及" -#: bookwyrm/models/base_model.py:17 +#: bookwyrm/models/base_model.py:20 #, fuzzy #| msgid "Un-block" msgid "Domain block" @@ -133,7 +134,7 @@ msgstr "%(value)s 不是有效的 remote_id" msgid "%(value)s is not a valid username" msgstr "%(value)s 不是有效的使用者名稱" -#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:169 +#: bookwyrm/models/fields.py:181 bookwyrm/templates/layout.html:171 msgid "username" msgstr "使用者名稱" @@ -335,7 +336,7 @@ msgstr "Goodreads key:" #: bookwyrm/templates/book/readthrough.html:76 #: bookwyrm/templates/lists/bookmark_button.html:15 #: bookwyrm/templates/lists/form.html:44 -#: bookwyrm/templates/preferences/edit_user.html:80 +#: bookwyrm/templates/preferences/edit_user.html:118 #: bookwyrm/templates/settings/announcement_form.html:69 #: bookwyrm/templates/settings/edit_server.html:68 #: bookwyrm/templates/settings/federated_server.html:98 @@ -451,7 +452,7 @@ msgstr "主題" msgid "Places" msgstr "地點" -#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:73 +#: bookwyrm/templates/book/book.html:292 bookwyrm/templates/layout.html:75 #: bookwyrm/templates/lists/lists.html:5 bookwyrm/templates/lists/lists.html:12 #: bookwyrm/templates/search/layout.html:25 #: bookwyrm/templates/search/layout.html:50 @@ -465,7 +466,7 @@ msgstr "新增到列表" #: bookwyrm/templates/book/book.html:313 #: bookwyrm/templates/book/cover_modal.html:31 -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 #: bookwyrm/templates/settings/domain_form.html:26 #: bookwyrm/templates/settings/ip_address_form.html:32 msgid "Add" @@ -795,7 +796,7 @@ msgstr "" #: bookwyrm/templates/confirm_email/resend_form.html:11 #: bookwyrm/templates/landing/layout.html:67 #: bookwyrm/templates/password_reset_request.html:18 -#: bookwyrm/templates/preferences/edit_user.html:38 +#: bookwyrm/templates/preferences/edit_user.html:56 #: bookwyrm/templates/snippets/register_form.html:13 msgid "Email address:" msgstr "郵箱地址:" @@ -820,7 +821,7 @@ msgstr "跨站社群" #: bookwyrm/templates/directory/directory.html:4 #: bookwyrm/templates/directory/directory.html:9 -#: bookwyrm/templates/layout.html:99 +#: bookwyrm/templates/layout.html:101 msgid "Directory" msgstr "目錄" @@ -892,7 +893,7 @@ msgstr "所有已知使用者" #: bookwyrm/templates/discover/discover.html:4 #: bookwyrm/templates/discover/discover.html:10 -#: bookwyrm/templates/layout.html:76 +#: bookwyrm/templates/layout.html:78 #, fuzzy #| msgid "Discard" msgid "Discover" @@ -1024,7 +1025,7 @@ msgid "Direct Messages with %(username)s" msgstr "與 %(username)s 私信" #: bookwyrm/templates/feed/direct_messages.html:10 -#: bookwyrm/templates/layout.html:109 +#: bookwyrm/templates/layout.html:111 msgid "Direct Messages" msgstr "私信" @@ -1109,7 +1110,7 @@ msgid "What are you reading?" msgstr "你在閱讀什麼?" #: bookwyrm/templates/get_started/books.html:9 -#: bookwyrm/templates/layout.html:43 bookwyrm/templates/lists/list.html:135 +#: bookwyrm/templates/layout.html:45 bookwyrm/templates/lists/list.html:137 msgid "Search for a book" msgstr "搜尋書目" @@ -1127,8 +1128,8 @@ msgstr "你可以在開始使用 %(site_name)s 後新增書目。" #: bookwyrm/templates/get_started/books.html:17 #: bookwyrm/templates/get_started/users.html:18 #: bookwyrm/templates/get_started/users.html:19 -#: bookwyrm/templates/layout.html:49 bookwyrm/templates/layout.html:50 -#: bookwyrm/templates/lists/list.html:139 +#: bookwyrm/templates/layout.html:51 bookwyrm/templates/layout.html:52 +#: bookwyrm/templates/lists/list.html:141 #: bookwyrm/templates/search/layout.html:4 #: bookwyrm/templates/search/layout.html:9 msgid "Search" @@ -1144,7 +1145,7 @@ msgid "Popular on %(site_name)s" msgstr "%(site_name)s 上的熱門" #: bookwyrm/templates/get_started/books.html:58 -#: bookwyrm/templates/lists/list.html:152 +#: bookwyrm/templates/lists/list.html:154 msgid "No books found" msgstr "沒有找到書目" @@ -1189,12 +1190,12 @@ msgid "Finish" msgstr "完成" #: bookwyrm/templates/get_started/profile.html:15 -#: bookwyrm/templates/preferences/edit_user.html:24 +#: bookwyrm/templates/preferences/edit_user.html:42 msgid "Display name:" msgstr "顯示名稱:" #: bookwyrm/templates/get_started/profile.html:22 -#: bookwyrm/templates/preferences/edit_user.html:31 +#: bookwyrm/templates/preferences/edit_user.html:49 msgid "Summary:" msgstr "概要:" @@ -1203,17 +1204,17 @@ msgid "A little bit about you" msgstr "少許關於你的資訊" #: bookwyrm/templates/get_started/profile.html:32 -#: bookwyrm/templates/preferences/edit_user.html:17 +#: bookwyrm/templates/preferences/edit_user.html:27 msgid "Avatar:" msgstr "頭像:" #: bookwyrm/templates/get_started/profile.html:42 -#: bookwyrm/templates/preferences/edit_user.html:62 +#: bookwyrm/templates/preferences/edit_user.html:104 msgid "Manually approve followers:" msgstr "手動批准關注者:" #: bookwyrm/templates/get_started/profile.html:48 -#: bookwyrm/templates/preferences/edit_user.html:54 +#: bookwyrm/templates/preferences/edit_user.html:80 msgid "Show this account in suggested users:" msgstr "在推薦的使用者中顯示此帳號:" @@ -1449,29 +1450,35 @@ msgstr "謝謝你!我們已經受到了你的請求。" msgid "Your Account" msgstr "你的帳號" -#: bookwyrm/templates/layout.html:41 +#: bookwyrm/templates/layout.html:13 +#, fuzzy, python-format +#| msgid "About %(site_name)s" +msgid "%(site_name)s search" +msgstr "關於 %(site_name)s" + +#: bookwyrm/templates/layout.html:43 #, fuzzy #| msgid "Search for a book or user" msgid "Search for a book, user, or list" msgstr "搜尋書目或使用者" -#: bookwyrm/templates/layout.html:59 bookwyrm/templates/layout.html:60 +#: bookwyrm/templates/layout.html:61 bookwyrm/templates/layout.html:62 msgid "Main navigation menu" msgstr "主導航選單" -#: bookwyrm/templates/layout.html:70 +#: bookwyrm/templates/layout.html:72 msgid "Feed" msgstr "動態" -#: bookwyrm/templates/layout.html:104 +#: bookwyrm/templates/layout.html:106 msgid "Your Books" msgstr "你的書目" -#: bookwyrm/templates/layout.html:114 +#: bookwyrm/templates/layout.html:116 msgid "Settings" msgstr "設定" -#: bookwyrm/templates/layout.html:123 +#: bookwyrm/templates/layout.html:125 #: bookwyrm/templates/settings/layout.html:40 #: bookwyrm/templates/settings/manage_invite_requests.html:15 #: bookwyrm/templates/settings/manage_invites.html:3 @@ -1479,73 +1486,73 @@ msgstr "設定" msgid "Invites" msgstr "邀請" -#: bookwyrm/templates/layout.html:130 +#: bookwyrm/templates/layout.html:132 msgid "Admin" msgstr "管理員" -#: bookwyrm/templates/layout.html:137 +#: bookwyrm/templates/layout.html:139 msgid "Log out" msgstr "登出" -#: bookwyrm/templates/layout.html:145 bookwyrm/templates/layout.html:146 +#: bookwyrm/templates/layout.html:147 bookwyrm/templates/layout.html:148 #: bookwyrm/templates/notifications.html:6 #: bookwyrm/templates/notifications.html:11 msgid "Notifications" msgstr "通知" -#: bookwyrm/templates/layout.html:168 bookwyrm/templates/layout.html:172 +#: bookwyrm/templates/layout.html:170 bookwyrm/templates/layout.html:174 #: bookwyrm/templates/login.html:21 #: bookwyrm/templates/snippets/register_form.html:4 msgid "Username:" msgstr "使用者名稱:" -#: bookwyrm/templates/layout.html:173 +#: bookwyrm/templates/layout.html:175 msgid "password" msgstr "密碼" -#: bookwyrm/templates/layout.html:174 bookwyrm/templates/login.html:40 +#: bookwyrm/templates/layout.html:176 bookwyrm/templates/login.html:40 msgid "Forgot your password?" msgstr "忘記了密碼?" -#: bookwyrm/templates/layout.html:177 bookwyrm/templates/login.html:7 +#: bookwyrm/templates/layout.html:179 bookwyrm/templates/login.html:7 #: bookwyrm/templates/login.html:37 msgid "Log in" msgstr "登入" -#: bookwyrm/templates/layout.html:185 +#: bookwyrm/templates/layout.html:187 msgid "Join" msgstr "加入" -#: bookwyrm/templates/layout.html:219 +#: bookwyrm/templates/layout.html:221 #, fuzzy #| msgid "Successfully imported" msgid "Successfully posted status" msgstr "成功匯入了" -#: bookwyrm/templates/layout.html:220 +#: bookwyrm/templates/layout.html:222 #, fuzzy #| msgid "Boost status" msgid "Error posting status" msgstr "轉發狀態" -#: bookwyrm/templates/layout.html:228 +#: bookwyrm/templates/layout.html:230 msgid "About this instance" msgstr "關於本實例" -#: bookwyrm/templates/layout.html:232 +#: bookwyrm/templates/layout.html:234 msgid "Contact site admin" msgstr "聯絡網站管理員" -#: bookwyrm/templates/layout.html:236 +#: bookwyrm/templates/layout.html:238 msgid "Documentation" msgstr "文件:" -#: bookwyrm/templates/layout.html:243 +#: bookwyrm/templates/layout.html:245 #, python-format msgid "Support %(site_name)s on %(support_title)s" msgstr "在 %(support_title)s 上支援 %(site_name)s" -#: bookwyrm/templates/layout.html:247 +#: bookwyrm/templates/layout.html:249 msgid "BookWyrm's source code is freely available. You can contribute or report issues on GitHub." msgstr "BookWyrm 是開源軟體。你可以在 GitHub 貢獻或報告問題。" @@ -1647,7 +1654,7 @@ msgstr "開放" msgid "Anyone can add books to this list" msgstr "任何人都可以向此列表新增書目" -#: bookwyrm/templates/lists/form.html:49 +#: bookwyrm/templates/lists/form.html:50 #, fuzzy #| msgid "Delete status" msgid "Delete list" @@ -1670,7 +1677,7 @@ msgstr "此列表當前是空的" msgid "Added by %(username)s" msgstr "由 %(username)s 新增" -#: bookwyrm/templates/lists/list.html:74 +#: bookwyrm/templates/lists/list.html:75 msgid "List position" msgstr "列表位置:" @@ -1678,42 +1685,42 @@ msgstr "列表位置:" msgid "Set" msgstr "設定" -#: bookwyrm/templates/lists/list.html:89 +#: bookwyrm/templates/lists/list.html:91 #: bookwyrm/templates/snippets/shelf_selector.html:26 msgid "Remove" msgstr "移除" -#: bookwyrm/templates/lists/list.html:103 -#: bookwyrm/templates/lists/list.html:120 +#: bookwyrm/templates/lists/list.html:105 +#: bookwyrm/templates/lists/list.html:122 msgid "Sort List" msgstr "排序列表" -#: bookwyrm/templates/lists/list.html:113 +#: bookwyrm/templates/lists/list.html:115 msgid "Direction" msgstr "方向" -#: bookwyrm/templates/lists/list.html:127 +#: bookwyrm/templates/lists/list.html:129 msgid "Add Books" msgstr "新增書目" -#: bookwyrm/templates/lists/list.html:129 +#: bookwyrm/templates/lists/list.html:131 msgid "Suggest Books" msgstr "推薦書目" -#: bookwyrm/templates/lists/list.html:140 +#: bookwyrm/templates/lists/list.html:142 msgid "search" msgstr "搜尋" -#: bookwyrm/templates/lists/list.html:146 +#: bookwyrm/templates/lists/list.html:148 msgid "Clear search" msgstr "清除搜尋" -#: bookwyrm/templates/lists/list.html:151 +#: bookwyrm/templates/lists/list.html:153 #, python-format msgid "No books found matching the query \"%(query)s\"" msgstr "沒有符合 \"%(query)s\" 請求的書目" -#: bookwyrm/templates/lists/list.html:179 +#: bookwyrm/templates/lists/list.html:181 msgid "Suggest" msgstr "推薦" @@ -1983,7 +1990,7 @@ msgstr "重設密碼" #: bookwyrm/templates/preferences/blocks.html:4 #: bookwyrm/templates/preferences/blocks.html:7 -#: bookwyrm/templates/preferences/layout.html:30 +#: bookwyrm/templates/preferences/layout.html:31 msgid "Blocked Users" msgstr "封鎖的使用者" @@ -1994,7 +2001,7 @@ msgstr "當前沒有被封鎖的使用者。" #: bookwyrm/templates/preferences/change_password.html:4 #: bookwyrm/templates/preferences/change_password.html:7 #: bookwyrm/templates/preferences/change_password.html:21 -#: bookwyrm/templates/preferences/layout.html:19 +#: bookwyrm/templates/preferences/layout.html:20 msgid "Change Password" msgstr "更改密碼" @@ -2005,7 +2012,7 @@ msgstr "新密碼:" #: bookwyrm/templates/preferences/delete_user.html:4 #: bookwyrm/templates/preferences/delete_user.html:7 #: bookwyrm/templates/preferences/delete_user.html:26 -#: bookwyrm/templates/preferences/layout.html:23 +#: bookwyrm/templates/preferences/layout.html:24 #: bookwyrm/templates/user_admin/delete_user_form.html:23 #, fuzzy #| msgid "Create an Account" @@ -2022,46 +2029,62 @@ msgstr "" #: bookwyrm/templates/preferences/edit_user.html:4 #: bookwyrm/templates/preferences/edit_user.html:7 +#: bookwyrm/templates/preferences/layout.html:15 msgid "Edit Profile" msgstr "編輯使用者資料" -#: bookwyrm/templates/preferences/edit_user.html:46 +#: bookwyrm/templates/preferences/edit_user.html:12 +#: bookwyrm/templates/preferences/edit_user.html:25 +#: bookwyrm/templates/user_admin/user_info.html:7 +msgid "Profile" +msgstr "使用者資料" + +#: bookwyrm/templates/preferences/edit_user.html:13 +#: bookwyrm/templates/preferences/edit_user.html:68 +#, fuzzy +#| msgid "Email preference" +msgid "Display preferences" +msgstr "郵箱偏好" + +#: bookwyrm/templates/preferences/edit_user.html:14 +#: bookwyrm/templates/preferences/edit_user.html:100 +#, fuzzy +#| msgid "Post privacy" +msgid "Privacy" +msgstr "發文隱私" + +#: bookwyrm/templates/preferences/edit_user.html:72 #, fuzzy #| msgid "Show set reading goal prompt in feed:" msgid "Show reading goal prompt in feed:" msgstr "在即時動態中顯示設定的閱讀目標提示:" -#: bookwyrm/templates/preferences/edit_user.html:50 +#: bookwyrm/templates/preferences/edit_user.html:76 #, fuzzy #| msgid "Show this account in suggested users:" msgid "Show suggested users:" msgstr "在推薦的使用者中顯示此帳號:" -#: bookwyrm/templates/preferences/edit_user.html:58 +#: bookwyrm/templates/preferences/edit_user.html:85 #, python-format msgid "Your account will show up in the directory, and may be recommended to other BookWyrm users." msgstr "你的帳號會顯示在 目錄 中,並可能受其它 BookWyrm 使用者推薦。" -#: bookwyrm/templates/preferences/edit_user.html:68 +#: bookwyrm/templates/preferences/edit_user.html:89 +msgid "Preferred Timezone: " +msgstr "偏好時區:" + +#: bookwyrm/templates/preferences/edit_user.html:110 #, fuzzy #| msgid "Post privacy" msgid "Default post privacy:" msgstr "發文隱私" -#: bookwyrm/templates/preferences/edit_user.html:75 -msgid "Preferred Timezone: " -msgstr "偏好時區:" - #: bookwyrm/templates/preferences/layout.html:11 msgid "Account" msgstr "帳號" -#: bookwyrm/templates/preferences/layout.html:15 -#: bookwyrm/templates/user_admin/user_info.html:7 -msgid "Profile" -msgstr "使用者資料" - -#: bookwyrm/templates/preferences/layout.html:26 +#: bookwyrm/templates/preferences/layout.html:27 msgid "Relationships" msgstr "關係" @@ -3347,7 +3370,7 @@ msgstr "降序排序" msgid "Show more" msgstr "顯示更多" -#: bookwyrm/templates/snippets/trimmed_text.html:34 +#: bookwyrm/templates/snippets/trimmed_text.html:35 msgid "Show less" msgstr "顯示更少" @@ -3657,7 +3680,7 @@ msgstr "" msgid "Not a valid csv file" msgstr "不是有效的 csv 檔案" -#: bookwyrm/views/login.py:70 +#: bookwyrm/views/login.py:68 msgid "Username or password are incorrect" msgstr "" @@ -3666,8 +3689,9 @@ msgid "No user with that email address was found." msgstr "沒有找到使用該郵箱的使用者。" #: bookwyrm/views/password.py:41 -#, python-format -msgid "A password reset link sent to %s" +#, fuzzy, python-brace-format +#| msgid "A password reset link sent to %s" +msgid "A password reset link sent to {email}" msgstr "密碼重置連結已傳送給 %s" #: bookwyrm/views/rss_feed.py:34 @@ -3675,6 +3699,9 @@ msgstr "密碼重置連結已傳送給 %s" msgid "Status updates from {obj.display_name}" msgstr "" +#~ msgid "%(count)d uses" +#~ msgstr "%(count)d 次使用" + #~ msgid "This instance is closed" #~ msgstr "本實例不開放。" diff --git a/requirements.txt b/requirements.txt index f01f2bcbd..2d79a475b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,3 +26,4 @@ pytest==6.1.2 pytest-cov==2.10.1 pytest-env==0.6.2 pytest-xdist==2.3.0 +pytidylib==0.3.2