mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-06-05 23:38:53 +00:00
template and migration fixes
This commit is contained in:
parent
6f3b1b565f
commit
4d35fd45df
4 changed files with 13 additions and 37 deletions
|
@ -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.activitypub_mixin
|
||||||
import bookwyrm.models.fields
|
import bookwyrm.models.fields
|
||||||
|
@ -57,37 +57,6 @@ class Migration(migrations.Migration):
|
||||||
max_length=255,
|
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(
|
migrations.CreateModel(
|
||||||
name="Move",
|
name="Move",
|
||||||
fields=[
|
fields=[
|
|
@ -26,11 +26,11 @@
|
||||||
<nav class="navbar" aria-label="main navigation">
|
<nav class="navbar" aria-label="main navigation">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
{% with notification_count=request.user.unread_notification_count has_unread_mentions=request.user.has_unread_mentions %}
|
{% 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">
|
<div class="navbar-brand">
|
||||||
<a class="navbar-item" href="/">
|
<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">
|
<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>
|
</a>
|
||||||
{% if not request.user.moved_to %}
|
|
||||||
<form class="navbar-item column is-align-items-start pt-5" action="{% url 'search' %}">
|
<form class="navbar-item column is-align-items-start pt-5" action="{% url 'search' %}">
|
||||||
<div class="field has-addons">
|
<div class="field has-addons">
|
||||||
<div class="control">
|
<div class="control">
|
||||||
|
@ -151,6 +151,12 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</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 %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -19,10 +19,10 @@
|
||||||
|
|
||||||
<div class="notification is-warning">
|
<div class="notification is-warning">
|
||||||
<p>
|
<p>
|
||||||
|
{% id_to_username request.user.moved_to as username %}
|
||||||
{% blocktrans %}
|
{% 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 %}
|
{% endblocktrans %}
|
||||||
{% id_to_username request.user.moved_to %}</a>
|
|
||||||
</p>
|
</p>
|
||||||
{% blocktrans %}
|
{% blocktrans %}
|
||||||
<p class="mt-2">You can undo the move to restore full functionality, but some followers may have already unfollowed this account.</p>
|
<p class="mt-2">You can undo the move to restore full functionality, but some followers may have already unfollowed this account.</p>
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
|
|
||||||
{% block description %}
|
{% block description %}
|
||||||
{% if related_user_moved_to %}
|
{% if related_user_moved_to %}
|
||||||
|
{% id_to_username request.user.moved_to as username %}
|
||||||
{% blocktrans %}
|
{% blocktrans %}
|
||||||
{{ related_user }} has moved to <a href="{{ related_user_moved_to }}">
|
{{ related_user }} has moved to <a href="{{ related_user_moved_to }}">{{ username }}</a>
|
||||||
{% endblocktrans %}{% id_to_username related_user_moved_to %}</a>
|
{% endblocktrans %}
|
||||||
<div class="row shrink my-2">
|
<div class="row shrink my-2">
|
||||||
{% include 'snippets/move_user_buttons.html' with group=notification.related_group %}
|
{% include 'snippets/move_user_buttons.html' with group=notification.related_group %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue