Updates and fixes
This commit is contained in:
parent
0bf6f721d6
commit
656c2b01aa
@ -28,7 +28,8 @@ class CommentCreateForm(forms.ModelForm):
|
||||
message = self.cleaned_data.get('content')
|
||||
post = Post.objects.get(pk=self.cleaned_data['object_id'])
|
||||
recipients = list(post.recipients.all().values_list('email', flat=True))
|
||||
recipients.remove(author.email)
|
||||
if author in recipients:
|
||||
recipients.remove(author.email)
|
||||
|
||||
send_mail(
|
||||
post.title,
|
||||
|
||||
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')
|
||||
recipients = models.ManyToManyField(
|
||||
User,
|
||||
blank=True,
|
||||
null=True,
|
||||
related_name='subscriptions'
|
||||
)
|
||||
tags = GenericRelation(Tag)
|
||||
|
||||
@ -125,7 +125,8 @@ tbody tr.has-link {
|
||||
textarea {
|
||||
box-sizing: border-box;
|
||||
font: inherit;
|
||||
font-size: 1.25rem;
|
||||
font-family: 'PT Mono', monospace;
|
||||
font-size: 2rem;
|
||||
padding: 0.5rem 1rem;
|
||||
width: 100%;
|
||||
resize: vertical;
|
||||
@ -134,6 +135,7 @@ textarea {
|
||||
|
||||
|
||||
button,
|
||||
input[type=submit],
|
||||
.action-button {
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
@ -248,8 +250,41 @@ main {
|
||||
}
|
||||
.post__content {
|
||||
font-family: 'STIX Two Text';
|
||||
font-size: 200%;
|
||||
font-size: 2rem;
|
||||
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 {
|
||||
font-family: 'STIX Two Text';
|
||||
font-size: 200%;
|
||||
font-size: 2rem;
|
||||
/*max-width: 64ch;*/
|
||||
}
|
||||
|
||||
@ -300,6 +335,13 @@ main {
|
||||
font-size: 1.125em;
|
||||
}
|
||||
|
||||
.comment__content blockquote {
|
||||
font-size: 1.75rem;
|
||||
padding: 0.5rem 1rem;
|
||||
margin: 0 0 1rem;
|
||||
padding: 0 5rem;
|
||||
}
|
||||
|
||||
.comment p {
|
||||
line-height: 1.75;
|
||||
}
|
||||
@ -309,7 +351,7 @@ main {
|
||||
|
||||
|
||||
.comments__form textarea {
|
||||
font-family: 'STIX Two Text';
|
||||
font-size: 200%;
|
||||
font-family: 'PT Mono';
|
||||
font-size: 2rem;
|
||||
line-height: 1.75;
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<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 %}
|
||||
<link rel="stylesheet" type="text/css" href="{% static "styles/main.css" %}">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user