diff --git a/bookwyrm/templates/author.html b/bookwyrm/templates/author.html deleted file mode 100644 index a7ea9db56..000000000 --- a/bookwyrm/templates/author.html +++ /dev/null @@ -1,40 +0,0 @@ -{% extends 'layout.html' %} -{% load i18n %} -{% load bookwyrm_tags %} - -{% block title %}{{ author.name }}{% endblock %} - -{% block content %} -
-
-
-

{{ author.name }}

-
- {% if request.user.is_authenticated and perms.bookwyrm.edit_book %} - - {% endif %} -
-
- -
- {% if author.bio %} - {{ author.bio | to_markdown | safe }} - {% endif %} - - {% if author.wikipedia_link %} -

{% trans "Wikipedia" %}

- {% endif %} -
- -
-

{% blocktrans with name=author.name %}Books by {{ name }}{% endblocktrans %}

- {% include 'snippets/book_tiles.html' with books=books %} -
-{% endblock %} - diff --git a/bookwyrm/templates/author/author.html b/bookwyrm/templates/author/author.html new file mode 100644 index 000000000..d342da47c --- /dev/null +++ b/bookwyrm/templates/author/author.html @@ -0,0 +1,84 @@ +{% extends 'layout.html' %} +{% load i18n %} +{% load bookwyrm_tags %} +{% load humanize %} + +{% block title %}{{ author.name }}{% endblock %} + +{% block content %} +
+
+
+

{{ author.name }}

+
+ {% if request.user.is_authenticated and perms.bookwyrm.edit_book %} + + {% endif %} +
+
+ +
+ {% if author.aliases or author.born or author.died or author.wikipedia_link %} +
+
+
+ {% if author.aliases %} +
+
{% trans "Aliases:" %}
+
{{ author.aliases|join:', ' }}
+
+ {% endif %} + {% if author.born %} +
+
{% trans "Born:" %}
+
{{ author.born|naturalday }}
+
+ {% endif %} + {% if author.aliases %} +
+
{% trans "Died:" %}
+
{{ author.died|naturalday }}
+
+ {% endif %} +
+ + {% if author.wikipedia_link %} +

{% trans "Wikipedia" %}

+ {% endif %} + {% if author.openlibrary_key %} +

+ {% trans "View on OpenLibrary" %} +

+ {% endif %} + {% if author.inventaire_id %} +

+ {% trans "View on Inventaire" %} +

+ {% endif %} +
+
+ {% endif %} +
+ {% if author.bio %} + {{ author.bio | to_markdown | safe }} + {% endif %} +
+
+ +
+

{% blocktrans with name=author.name %}Books by {{ name }}{% endblocktrans %}

+
+ {% for book in books %} +
+ {% include 'discover/small-book.html' with book=book %} +
+ {% endfor %} +
+
+{% endblock %} diff --git a/bookwyrm/templates/edit_author.html b/bookwyrm/templates/author/edit_author.html similarity index 56% rename from bookwyrm/templates/edit_author.html rename to bookwyrm/templates/author/edit_author.html index b575bbb2f..010d36efc 100644 --- a/bookwyrm/templates/edit_author.html +++ b/bookwyrm/templates/author/edit_author.html @@ -29,44 +29,64 @@

{% trans "Metadata" %}

-

{{ form.name }}

+

{{ form.name }}

{% for error in form.name.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.bio }}

+

+ + {{ form.aliases }} + {% trans "Separate multiple values with commas." %} +

+ {% for error in form.aliases.errors %} +

{{ error | escape }}

+ {% endfor %} + +

{{ form.bio }}

{% for error in form.bio.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.wikipedia_link }}

+

{{ form.wikipedia_link }}

{% for error in form.wikipedia_link.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.born }}

+

+ + +

{% for error in form.born.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.died }}

+

+ + +

{% for error in form.died.errors %}

{{ error | escape }}

{% endfor %}

{% trans "Author Identifiers" %}

-

{{ form.openlibrary_key }}

+

{{ form.openlibrary_key }}

{% for error in form.openlibrary_key.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.librarything_key }}

+

{{ form.inventaire_id }}

+ {% for error in form.inventaire_id.errors %} +

{{ error | escape }}

+ {% endfor %} + +

{{ form.librarything_key }}

{% for error in form.librarything_key.errors %}

{{ error | escape }}

{% endfor %} -

{{ form.goodreads_key }}

+

{{ form.goodreads_key }}

{% for error in form.goodreads_key.errors %}

{{ error | escape }}

{% endfor %} diff --git a/bookwyrm/templates/book/edit_book.html b/bookwyrm/templates/book/edit_book.html index bcf111267..a230e290c 100644 --- a/bookwyrm/templates/book/edit_book.html +++ b/bookwyrm/templates/book/edit_book.html @@ -125,7 +125,7 @@

{{ form.publishers }} - {% trans "Separate multiple publishers with commas." %} + {% trans "Separate multiple values with commas." %}

{% for error in form.publishers.errors %}

{{ error | escape }}

@@ -162,7 +162,7 @@ {% endif %} -

Separate multiple author names with commas.

+ {% trans "Separate multiple values with commas." %}
diff --git a/bookwyrm/templates/snippets/book_tiles.html b/bookwyrm/templates/snippets/book_tiles.html deleted file mode 100644 index 25249c96c..000000000 --- a/bookwyrm/templates/snippets/book_tiles.html +++ /dev/null @@ -1,16 +0,0 @@ -
- {% for book in books %} -
-
- - - {% include 'snippets/shelve_button/shelve_button.html' with book=book switch_mode=True %} -
-
- {% endfor %} -
- diff --git a/bookwyrm/views/author.py b/bookwyrm/views/author.py index 41298161c..e51dc7d83 100644 --- a/bookwyrm/views/author.py +++ b/bookwyrm/views/author.py @@ -29,7 +29,7 @@ class Author(View): "author": author, "books": [b.default_edition for b in books], } - return TemplateResponse(request, "author.html", data) + return TemplateResponse(request, "author/author.html", data) @method_decorator(login_required, name="dispatch") @@ -43,7 +43,7 @@ class EditAuthor(View): """info about a book""" author = get_object_or_404(models.Author, id=author_id) data = {"author": author, "form": forms.AuthorForm(instance=author)} - return TemplateResponse(request, "edit_author.html", data) + return TemplateResponse(request, "author/edit_author.html", data) def post(self, request, author_id): """edit a author cool""" @@ -52,7 +52,7 @@ class EditAuthor(View): form = forms.AuthorForm(request.POST, request.FILES, instance=author) if not form.is_valid(): data = {"author": author, "form": form} - return TemplateResponse(request, "edit_author.html", data) + return TemplateResponse(request, "author/edit_author.html", data) author = form.save() return redirect("/author/%s" % author.id)