Updates and fixes
This commit is contained in:
parent
0bf6f721d6
commit
656c2b01aa
@ -28,6 +28,7 @@ class CommentCreateForm(forms.ModelForm):
|
|||||||
message = self.cleaned_data.get('content')
|
message = self.cleaned_data.get('content')
|
||||||
post = Post.objects.get(pk=self.cleaned_data['object_id'])
|
post = Post.objects.get(pk=self.cleaned_data['object_id'])
|
||||||
recipients = list(post.recipients.all().values_list('email', flat=True))
|
recipients = list(post.recipients.all().values_list('email', flat=True))
|
||||||
|
if author in recipients:
|
||||||
recipients.remove(author.email)
|
recipients.remove(author.email)
|
||||||
|
|
||||||
send_mail(
|
send_mail(
|
||||||
|
|||||||
20
src/core/migrations/0006_alter_post_recipients.py
Normal file
20
src/core/migrations/0006_alter_post_recipients.py
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# Generated by Django 4.0.6 on 2022-07-20 21:37
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('core', '0005_post_recipients'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='post',
|
||||||
|
name='recipients',
|
||||||
|
field=models.ManyToManyField(blank=True, null=True, related_name='subscriptions', to=settings.AUTH_USER_MODEL),
|
||||||
|
),
|
||||||
|
]
|
||||||
@ -129,6 +129,8 @@ class Post(models.Model):
|
|||||||
comments = GenericRelation(Comment, related_query_name='parent')
|
comments = GenericRelation(Comment, related_query_name='parent')
|
||||||
recipients = models.ManyToManyField(
|
recipients = models.ManyToManyField(
|
||||||
User,
|
User,
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
related_name='subscriptions'
|
related_name='subscriptions'
|
||||||
)
|
)
|
||||||
tags = GenericRelation(Tag)
|
tags = GenericRelation(Tag)
|
||||||
|
|||||||
@ -125,7 +125,8 @@ tbody tr.has-link {
|
|||||||
textarea {
|
textarea {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font: inherit;
|
font: inherit;
|
||||||
font-size: 1.25rem;
|
font-family: 'PT Mono', monospace;
|
||||||
|
font-size: 2rem;
|
||||||
padding: 0.5rem 1rem;
|
padding: 0.5rem 1rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
@ -134,6 +135,7 @@ textarea {
|
|||||||
|
|
||||||
|
|
||||||
button,
|
button,
|
||||||
|
input[type=submit],
|
||||||
.action-button {
|
.action-button {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border: none;
|
border: none;
|
||||||
@ -248,8 +250,41 @@ main {
|
|||||||
}
|
}
|
||||||
.post__content {
|
.post__content {
|
||||||
font-family: 'STIX Two Text';
|
font-family: 'STIX Two Text';
|
||||||
font-size: 200%;
|
font-size: 2rem;
|
||||||
margin-bottom: 4rem;
|
margin-bottom: 4rem;
|
||||||
|
line-height: 1.75;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post__content h1,
|
||||||
|
.post__content h2,
|
||||||
|
.post__content h3,
|
||||||
|
.post__content h4,
|
||||||
|
.post__content h5 {
|
||||||
|
font-family: 'STIX Two Text';
|
||||||
|
text-transform: unset;
|
||||||
|
margin: 2em 0 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post__content h1 {
|
||||||
|
font-size: 1.802em;
|
||||||
|
}
|
||||||
|
.post__content h2 {
|
||||||
|
font-size: 1.602em;
|
||||||
|
}
|
||||||
|
.post__content h3 {
|
||||||
|
font-size: 1.424em;
|
||||||
|
}
|
||||||
|
.post__content h4 {
|
||||||
|
font-size: 1.266em;
|
||||||
|
}
|
||||||
|
.post__content h5 {
|
||||||
|
font-size: 1.125em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.post__content blockquote {
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
padding-left: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -270,7 +305,7 @@ main {
|
|||||||
|
|
||||||
.comment__content {
|
.comment__content {
|
||||||
font-family: 'STIX Two Text';
|
font-family: 'STIX Two Text';
|
||||||
font-size: 200%;
|
font-size: 2rem;
|
||||||
/*max-width: 64ch;*/
|
/*max-width: 64ch;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,6 +335,13 @@ main {
|
|||||||
font-size: 1.125em;
|
font-size: 1.125em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.comment__content blockquote {
|
||||||
|
font-size: 1.75rem;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
margin: 0 0 1rem;
|
||||||
|
padding: 0 5rem;
|
||||||
|
}
|
||||||
|
|
||||||
.comment p {
|
.comment p {
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
@ -309,7 +351,7 @@ main {
|
|||||||
|
|
||||||
|
|
||||||
.comments__form textarea {
|
.comments__form textarea {
|
||||||
font-family: 'STIX Two Text';
|
font-family: 'PT Mono';
|
||||||
font-size: 200%;
|
font-size: 2rem;
|
||||||
line-height: 1.75;
|
line-height: 1.75;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,700;0,900;1,400;1,700;1,900&family=STIX+Two+Text:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,700;0,900;1,400;1,700;1,900&family=PT+Mono&family=STIX+Two+Text:ital,wght@0,400;0,700;1,400;1,700&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
{% compress css %}
|
{% compress css %}
|
||||||
<link rel="stylesheet" type="text/css" href="{% static "styles/main.css" %}">
|
<link rel="stylesheet" type="text/css" href="{% static "styles/main.css" %}">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user