Merge branch 'main' into html-interaction

This commit is contained in:
Mouse Reeve
2021-01-15 09:45:33 -08:00
committed by GitHub
72 changed files with 4891 additions and 4146 deletions

View File

@ -223,7 +223,7 @@
</div>
</div>
<div class="block">
<div class="block" id="reviews">
{% for review in reviews %}
<div class="block">
{% include 'snippets/status.html' with status=review hide_book=True depth=1 %}
@ -231,25 +231,28 @@
{% endfor %}
<div class="block is-flex is-flex-wrap-wrap">
{% for rating in ratings %}
<div class="block mr-5">
<div class="media">
<div class="media-left">{% include 'snippets/avatar.html' with user=rating.user %}</div>
<div class="media-content">
<div>
{% include 'snippets/username.html' with user=rating.user %}
</div>
<div class="field is-grouped mb-0">
<div>rated it</div>
{% include 'snippets/stars.html' with rating=rating.rating %}
</div>
<div>
<a href="{{ rating.remote_id }}">{{ rating.published_date | naturaltime }}</a>
{% for rating in ratings %}
<div class="block mr-5">
<div class="media">
<div class="media-left">{% include 'snippets/avatar.html' with user=rating.user %}</div>
<div class="media-content">
<div>
{% include 'snippets/username.html' with user=rating.user %}
</div>
<div class="field is-grouped mb-0">
<div>rated it</div>
{% include 'snippets/stars.html' with rating=rating.rating %}
</div>
<div>
<a href="{{ rating.remote_id }}">{{ rating.published_date | naturaltime }}</a>
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
<div class="block">
{% include 'snippets/pagination.html' with page=reviews path=book.local_path anchor="#reviews" %}
</div>
</div>

View File

@ -13,25 +13,7 @@
</div>
{% endfor %}
<nav class="pagination" role="navigation" aria-label="pagination">
{% if prev %}
<p class="pagination-previous">
<a href="{{ prev }}">
<span class="icon icon-arrow-left"></span>
Previous
</a>
</p>
{% endif %}
{% if next %}
<p class="pagination-next">
<a href="{{ next }}">
Next
<span class="icon icon-arrow-right"></span>
</a>
</p>
{% endif %}
</nav>
{% include 'snippets/pagination.html' with page=activities path="direct-messages" %}
</div>
{% endblock %}

View File

@ -16,7 +16,7 @@
<div class="tile is-child box has-background-primary-light content">
{% if site.allow_registration %}
<h2 class="title">Join {{ site.name }}</h2>
<form name="register" method="post" action="/user-register">
<form name="register" method="post" action="/register">
{% include 'snippets/register_form.html' %}
</form>
{% else %}

View File

@ -18,7 +18,7 @@
</div>
{% endif %}
<form class="block" name="edit-author" action="/edit-author/{{ author.id }}" method="post">
<form class="block" name="edit-author" action="{{ author.local_path }}/edit" method="post">
{% csrf_token %}
<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">

View File

@ -18,7 +18,7 @@
</div>
{% endif %}
<form class="block" name="edit-book" action="/edit-book/{{ book.id }}" method="post" enctype="multipart/form-data">
<form class="block" name="edit-book" action="{{ book.local_path }}/edit" method="post" enctype="multipart/form-data">
{% csrf_token %}
<input type="hidden" name="last_edited_by" value="{{ request.user.id }}">
<div class="columns">

View File

@ -94,25 +94,7 @@
</div>
{% endfor %}
<nav class="pagination" role="navigation" aria-label="pagination">
{% if prev %}
<p class="pagination-previous">
<a href="{{ prev }}">
<span class="icon icon-arrow-left"></span>
Previous
</a>
</p>
{% endif %}
{% if next %}
<p class="pagination-next">
<a href="{{ next }}">
Next
<span class="icon icon-arrow-right"></span>
</a>
</p>
{% endif %}
</nav>
{% include 'snippets/pagination.html' with page=activities path='/'|add:tab anchor="#feed" %}
</div>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
<div class="block">
<h1 class="title">Import Books from GoodReads</h1>
<form name="import" action="/import-data/" method="post" enctype="multipart/form-data">
<form name="import" action="/import" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="field">
{{ import_form.as_p }}
@ -30,7 +30,7 @@
{% endif %}
<ul>
{% for job in jobs %}
<li><a href="/import-status/{{ job.id }}">{{ job.created_date | naturaltime }}</a></li>
<li><a href="/import/{{ job.id }}">{{ job.created_date | naturaltime }}</a></li>
{% endfor %}
</ul>
</div>

View File

@ -30,9 +30,8 @@
<div class="block">
<h2 class="title is-4">Failed to load</h2>
{% if not job.retry %}
<form name="retry" action="/retry-import/" method="post">
<form name="retry" action="/import/{{ job.id }}" method="post">
{% csrf_token %}
<input type="hidden" name="import_job" value="{{ job.id }}">
<ul>
<fieldset>
{% for item in failed_items %}

View File

@ -7,7 +7,7 @@
{% if valid %}
<h1 class="title">Create an Account</h1>
<div>
<form name="register" method="post" action="/user-register">
<form name="register" method="post" action="/register">
<input type=hidden name="invite_code" value="{{ invite.code }}">
{% include 'snippets/register_form.html' %}
</form>

View File

@ -82,7 +82,7 @@
</a>
</li>
<li>
<a href="/user-edit" class="navbar-item">
<a href="/edit-profile" class="navbar-item">
Settings
</a>
</li>
@ -122,10 +122,10 @@
</div>
{% else %}
<div class="navbar-item">
{% if request.path != '/login' and request.path != '/login/' and request.path != '/user-login' %}
{% if request.path != '/login' and request.path != '/login/' %}
<div class="columns">
<div class="column">
<form name="login" method="post" action="/user-login">
<form name="login" method="post" action="/login">
{% csrf_token %}
<div class="columns is-variable is-1">
<div class="column">

View File

@ -8,7 +8,7 @@
{% if login_form.non_field_errors %}
<p class="notification is-danger">{{ login_form.non_field_errors }}</p>
{% endif %}
<form name="login" method="post" action="/user-login">
<form name="login" method="post" action="/login">
{% csrf_token %}
<div class="field">
<label class="label" for="id_localname">Username:</label>
@ -38,7 +38,7 @@
<div class="box has-background-primary-light">
{% if site.allow_registration %}
<h2 class="title">Create an Account</h2>
<form name="register" method="post" action="/user-register">
<form name="register" method="post" action="/register">
{% include 'snippets/register_form.html' %}
</form>
{% else %}

View File

@ -27,7 +27,7 @@
<div class="block">
<h2 class="title is-4">Generate New Invite</h2>
<form name="invite" action="/create-invite/" method="post">
<form name="invite" action="/invite/" method="post">
{% csrf_token %}
<div class="field is-grouped">
<div class="control">

View File

@ -5,7 +5,7 @@
<div class="block">
<h1 class="title">Notifications</h1>
<form name="clear" action="/clear-notifications" method="POST">
<form name="clear" action="/notifications" method="POST">
{% csrf_token %}
<button class="button is-danger is-light" type="submit" class="secondary">Delete notifications</button>
</form>
@ -63,7 +63,7 @@
boosted your <a href="{{ related_status.local_path }}">{{ related_status | status_preview_name|safe }}</a>
{% endif %}
{% else %}
your <a href="/import-status/{{ notification.related_import.id }}">import</a> completed.
your <a href="/import/{{ notification.related_import.id }}">import</a> completed.
{% endif %}
</p>
</div>

View File

@ -8,9 +8,8 @@
{% for error in errors %}
<p class="is-danger">{{ error }}</p>
{% endfor %}
<form name="reset-password" method="post" action="/reset-password">
<form name="password-reset" method="post" action="/password-reset/{{ code }}">
{% csrf_token %}
<input type="hidden" name="reset-code" value="{{ code }}">
<div class="field">
<label class="label" for="id_password">Password:</label>
<div class="control">

View File

@ -7,7 +7,7 @@
<h1 class="title">Reset Password</h1>
{% if message %}<p>{{ message }}</p>{% endif %}
<p>A link to reset your password will be sent to your email address</p>
<form name="reset-password" method="post" action="/reset-password-request">
<form name="password-reset" method="post" action="/password-reset">
{% csrf_token %}
<div class="field">
<label class="label" for="id_email_register">Email address:</label>

View File

@ -39,5 +39,5 @@
<div>
<input class="toggle-control" type="radio" name="status-tabs-{{ book.id }}" id="quote-{{ book.id }}">
{% include 'snippets/create_status_form.html' with type="quote" placeholder="An excerpt from '"|add:book.title|add:"'" %}
{% include 'snippets/create_status_form.html' with type="quotation" placeholder="An excerpt from '"|add:book.title|add:"'" %}
</div>

View File

@ -1,4 +1,4 @@
<form class="toggle-content hidden tab-option-{{ book.id }}" name="{{ type }}" action="/{{ type }}" method="post" id="tab-{{ type }}-{{ book.id }}">
<form class="toggle-content hidden tab-option-{{ book.id }}" name="{{ type }}" action="/post/{{ type }}" method="post" id="tab-{{ type }}-{{ book.id }}">
{% csrf_token %}
<input type="hidden" name="book" value="{{ book.id }}">
<input type="hidden" name="user" value="{{ request.user.id }}">
@ -9,7 +9,7 @@
</div>
{% endif %}
<div class="control">
<label class="label" for="id_{% if type == 'quote' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}">{{ type|title }}:</label>
<label class="label" for="id_{% if type == 'quotation' %}quote{% else %}content{% endif %}_{{ book.id }}_{{ type }}">{{ type|title }}:</label>
{% include 'snippets/content_warning_field.html' %}
{% if type == 'review' %}
@ -28,13 +28,13 @@
</fieldset>
{% endif %}
{% if type == 'quote' %}
{% if type == 'quotation' %}
<textarea name="quote" class="textarea" id="id_quote_{{ book.id }}_{{ type }}" placeholder="{{ placeholder }}" required></textarea>
{% else %}
<textarea name="content" class="textarea" id="id_content_{{ book.id }}_{{ type }}" placeholder="{{ placeholder }}" required></textarea>
{% endif %}
</div>
{% if type == 'quote' %}
{% if type == 'quotation' %}
<div class="control">
<label class="label" for="id_content_{{ book.id }}_quote">Comment:</label>
<textarea name="content" class="textarea is-small" id="id_content_{{ book.id }}_quote"></textarea>

View File

@ -0,0 +1,19 @@
<nav class="pagination" role="navigation" aria-label="pagination">
{% if page.has_previous %}
<p class="pagination-previous">
<a href="{{ path }}?page={{ page.previous_page_number }}{{ anchor }}">
<span class="icon icon-arrow-left"></span>
Previous
</a>
</p>
{% endif %}
{% if page.has_next %}
<p class="pagination-next">
<a href="{{ path }}?page={{ page.next_page_number }}{{ anchor }}">
Next
<span class="icon icon-arrow-right"></span>
</a>
</p>
{% endif %}
</nav>

View File

@ -1,5 +1,6 @@
{% load bookwyrm_tags %}
<form class="is-flex-grow-1" name="reply" action="/reply" method="post">
{% with status.id|uuid as uuid %}
<form class="is-flex-grow-1" name="reply" action="/post/reply" method="post">
<div class="columns is-align-items-flex-end">
{% csrf_token %}
<input type="hidden" name="reply_parent" value="{{ status.id }}">

View File

@ -7,7 +7,7 @@
</div>
{% if is_self %}
<div class="column is-narrow">
<a href="/user-edit/">
<a href="/edit-profile">
<span class="icon icon-pencil" title="Edit profile">
<span class="is-sr-only">Edit profile</span>
</span>
@ -45,7 +45,7 @@
<h2 class="title">User Activity</h2>
</div>
{% for activity in activities %}
<div class="block">
<div class="block" id="feed">
{% include 'snippets/status.html' with status=activity %}
</div>
{% endfor %}
@ -55,25 +55,7 @@
</div>
{% endif %}
<nav class="pagination" role="navigation" aria-label="pagination">
{% if prev %}
<p class="pagination-previous">
<a href="{{ prev }}">
<span class="icon icon-arrow-left"></span>
Previous
</a>
</p>
{% endif %}
{% if next %}
<p class="pagination-next">
<a href="{{ next }}">
Next
<span class="icon icon-arrow-right"></span>
</a>
</p>
{% endif %}
</nav>
{% include 'snippets/pagination.html' with page=activities path=user.local_path anchor="#feed" %}
</div>
{% endblock %}