template and migration fixes

This commit is contained in:
Hugh Rundle 2023-10-27 22:22:58 +11:00
parent 6f3b1b565f
commit 4d35fd45df
No known key found for this signature in database
GPG key ID: A7E35779918253F9
4 changed files with 13 additions and 37 deletions

View file

@ -1,4 +1,4 @@
# Generated by Django 3.2.20 on 2023-09-24 08:21
# Generated by Django 3.2.20 on 2023-10-27 11:22
import bookwyrm.models.activitypub_mixin
import bookwyrm.models.fields
@ -57,37 +57,6 @@ class Migration(migrations.Migration):
max_length=255,
),
),
migrations.CreateModel(
name="MoveUserNotification",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
(
"target",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="moved_user_notification_target",
to=settings.AUTH_USER_MODEL,
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
related_name="moved_user_notifications",
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="Move",
fields=[

View file

@ -26,11 +26,11 @@
<nav class="navbar" aria-label="main navigation">
<div class="container">
{% with notification_count=request.user.unread_notification_count has_unread_mentions=request.user.has_unread_mentions %}
{% if not request.user.moved_to %}
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="{% blocktrans with site_name=site.name %}{{ site_name }} home page{% endblocktrans %}" loading="lazy" decoding="async">
</a>
{% if not request.user.moved_to %}
<form class="navbar-item column is-align-items-start pt-5" action="{% url 'search' %}">
<div class="field has-addons">
<div class="control">
@ -151,6 +151,12 @@
{% endif %}
</div>
</div>
{% else %}
<div class="navbar-brand">
<a class="navbar-item" href="/">
<img class="image logo" src="{% if site.logo_small %}{% get_media_prefix %}{{ site.logo_small }}{% else %}{% static "images/logo-small.png" %}{% endif %}" alt="{% blocktrans with site_name=site.name %}{{ site_name }} home page{% endblocktrans %}" loading="lazy" decoding="async">
</a>
</div>
{% endif %}
{% endwith %}
</div>

View file

@ -19,10 +19,10 @@
<div class="notification is-warning">
<p>
{% id_to_username request.user.moved_to as username %}
{% blocktrans %}
<strong>You have moved your account</strong> to <a href="{{user.moved_to}}">
<strong>You have moved your account</strong> to <a href="{{user.moved_to}}">{{ username }}</a>
{% endblocktrans %}
{% id_to_username request.user.moved_to %}</a>
</p>
{% blocktrans %}
<p class="mt-2">You can undo the move to restore full functionality, but some followers may have already unfollowed this account.</p>

View file

@ -14,9 +14,10 @@
{% block description %}
{% if related_user_moved_to %}
{% id_to_username request.user.moved_to as username %}
{% blocktrans %}
{{ related_user }} has moved to <a href="{{ related_user_moved_to }}">
{% endblocktrans %}{% id_to_username related_user_moved_to %}</a>
{{ related_user }} has moved to <a href="{{ related_user_moved_to }}">{{ username }}</a>
{% endblocktrans %}
<div class="row shrink my-2">
{% include 'snippets/move_user_buttons.html' with group=notification.related_group %}
</div>