1
0
Fork 0

Merge branch 'main' into tour

- we need to do this because of conflicting migrations
This commit is contained in:
Hugh Rundle 2022-07-17 16:30:45 +10:00
commit 17dc5e7eb1
71 changed files with 7456 additions and 1373 deletions

View file

@ -19,16 +19,8 @@
name="email"
class="input"
id="email"
aria-described-by="id_email_errors"
required
>
{% if error %}
<div id="id_email_errors">
<p class="help is-danger">
{% trans "No user matching this email address found." %}
</p>
</div>
{% endif %}
</div>
</div>
{% endblock %}

View file

@ -26,7 +26,16 @@
{% trans "Password:" %}
</label>
<div class="control">
<input type="password" name="password" maxlength="128" class="input" required="" id="id_new_password" aria-describedby="form_errors">
<input
type="password"
name="password"
maxlength="128"
class="input"
required=""
id="id_new_password"
aria-describedby="desc_password"
>
{% include 'snippets/form_errors.html' with errors_list=form.password.errors id="desc_password" %}
</div>
</div>
<div class="field">
@ -34,7 +43,8 @@
{% trans "Confirm password:" %}
</label>
<div class="control">
<input type="password" name="confirm-password" maxlength="128" class="input" required="" id="id_confirm_password" aria-describedby="form_errors">
{{ form.confirm_password }}
{% include 'snippets/form_errors.html' with errors_list=form.confirm_password.errors id="desc_confirm_password" %}
</div>
</div>
<div class="field is-grouped">

View file

@ -118,7 +118,7 @@
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-muted{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
{% include 'notifications/items/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-text-muted">
{{ related_status.published_date|timesince }}

View file

@ -119,7 +119,7 @@
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-muted{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
{% include 'notifications/items/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-text-muted">
{{ related_status.published_date|timesince }}

View file

@ -2,7 +2,7 @@
{% load humanize %}
{% related_status notification as related_status %}
{% with related_users=notification.related_users.all.distinct %}
{% get_related_users notification as related_users %}
{% with related_user_count=notification.related_users.count %}
<div class="notification {% if notification.id in unread %}has-background-primary{% endif %}">
<div class="columns is-mobile {% if notification.id in unread %}has-text-white{% else %}has-text-more-muted{% endif %}">
@ -16,7 +16,7 @@
{% if related_user_count > 1 %}
<div class="block">
<ul class="is-flex">
{% for user in related_users|slice:10 %}
{% for user in related_users %}
<li class="mr-2">
<a href="{{ user.local_path }}">
{% include 'snippets/avatar.html' with user=user %}
@ -28,7 +28,7 @@
{% endif %}
<div class="block content">
{% if related_user_count == 1 %}
{% with user=related_users.first %}
{% with user=related_users.0 %}
{% spaceless %}
<a href="{{ user.local_path }}" class="mr-2">
{% include 'snippets/avatar.html' with user=user %}
@ -37,8 +37,8 @@
{% endwith %}
{% endif %}
{% with related_user=related_users.first.display_name %}
{% with related_user_link=related_users.first.local_path %}
{% with related_user=related_users.0.display_name %}
{% with related_user_link=related_users.0.local_path %}
{% with second_user=related_users.1.display_name %}
{% with second_user_link=related_users.1.local_path %}
{% with other_user_count=related_user_count|add:"-1" %}
@ -61,4 +61,3 @@
</div>
</div>
{% endwith %}
{% endwith %}

View file

@ -51,7 +51,7 @@
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-default{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
{% include 'notifications/items/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-text-default">
{{ related_status.published_date|timesince }}

View file

@ -54,7 +54,7 @@
<div class="notification py-2 {% if notification.id in unread %}is-primary is-light{% else %}has-background-body has-text-default{% endif %}">
<div class="columns">
<div class="column is-clipped">
{% include 'snippets/status_preview.html' with status=related_status %}
{% include 'notifications/items/status_preview.html' with status=related_status %}
</div>
<div class="column is-narrow has-text-default">
{{ related_status.published_date|timesince }}

View file

@ -1,4 +1,17 @@
{% if status.content %}
{% load i18n %}
{% if status.content_warning %}
{% trans "Content warning" as text %}
<span>
<span class="icon icon-warning is-size-5" title="{{ text }}">
<span class="is-sr-only">{{ text }}</span>
</span>
<a href="{{ status.local_path }}">
{{ status.content_warning }}
</a>
</span>
{% elif status.content %}
<a href="{{ status.local_path }}">
{{ status.content | safe | truncatewords_html:10 }}{% if status.mention_books %} <em>{{ status.mention_books.first.title }}</em>{% endif %}
</a>

View file

@ -8,15 +8,31 @@
{% endblock %}
{% block panel %}
{% if success %}
<div class="notification is-success is-light">
<span class="icon icon-check" aria-hidden="true"></span>
<span>
{% trans "Successfully changed password" %}
</span>
</div>
{% endif %}
<form name="edit-profile" action="{% url 'prefs-password' %}" method="post" enctype="multipart/form-data">
{% csrf_token %}
<div class="field">
<label class="label" for="id_password">{% trans "Current password:" %}</label>
{{ form.current_password }}
{% include 'snippets/form_errors.html' with errors_list=form.current_password.errors id="desc_current_password" %}
</div>
<hr aria-hidden="true" />
<div class="field">
<label class="label" for="id_password">{% trans "New password:" %}</label>
<input type="password" name="password" maxlength="128" class="input" required="" id="id_password">
{{ form.password }}
{% include 'snippets/form_errors.html' with errors_list=form.password.errors id="desc_current_password" %}
</div>
<div class="field">
<label class="label" for="id_confirm_password">{% trans "Confirm password:" %}</label>
<input type="password" name="confirm-password" maxlength="128" class="input" required="" id="id_confirm_password">
{{ form.confirm_password }}
{% include 'snippets/form_errors.html' with errors_list=form.confirm_password.errors id="desc_confirm_password" %}
</div>
<button class="button is-primary" type="submit">{% trans "Change Password" %}</button>
</form>

View file

@ -13,10 +13,13 @@
{% trans "Your export will include all the books on your shelves, books you have reviewed, and books with reading activity." %}
</p>
<p>
<a href="{% url 'prefs-export-file' %}" class="button">
<span class="icon icon-download" aria-hidden="true"></span>
<span>Download file</span>
</a>
<form name="export" method="POST" href="{% url 'prefs-export' %}">
{% csrf_token %}
<button type="submit" class="button">
<span class="icon icon-download" aria-hidden="true"></span>
<span>{% trans "Download file" %}</span>
</button>
</form>
</p>
</div>
{% endblock %}

View file

@ -26,7 +26,7 @@
<form action="{% url 'unfollow' %}" method="POST" class="interaction follow_{{ user.id }} {% if not relationship.is_following and not relationship.is_follow_pending %}is-hidden{%endif %}" data-id="follow_{{ user.id }}">
{% csrf_token %}
<input type="hidden" name="user" value="{{ user.username }}">
{% if user.manually_approves_followers and not relationship.is_following %}
{% if relationship.is_follow_pending %}
<button class="button is-small is-danger is-light" type="submit">
{% trans "Undo follow request" %}
</button>

View file

@ -68,9 +68,15 @@
<li class="navbar-divider" role="presentation" aria-hidden="true">&nbsp;</li>
<li role="menuitem">
<a href="{% url 'logout' %}" class="navbar-item">
{% trans 'Log out' %}
</a>
<form
name="logout"
method="POST"
action="{% url 'logout' %}"
class="navbar-item"
>
{% csrf_token %}
<button type="submit">{% trans 'Log out' %}</button>
</form>
</li>
</ul>
</div>