-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to see and recycle sent messages (#3353)
- Fix #3246: After the message is sent, it gets stored to the DB and displayed in the Sent panel. - Fix #3247: Add ability to edit sent messages as new. - Compose and Sent panels can now be linked to. - After the message is sent, show it in the Sent panel. Also included are some under the hood changes that will make code more maintainable: - Create MessageForm from the Message model - Use select element instead of input in multiple item selector widget - Use form tags in the template
- Loading branch information
Showing
21 changed files
with
987 additions
and
399 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,10 @@ | |
|
||
.check-box { | ||
padding: 4px 0; | ||
|
||
[type='checkbox'] { | ||
display: none; | ||
} | ||
} | ||
|
||
.check-box:last-child { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from django.contrib import admin | ||
|
||
from pontoon.messaging import models | ||
|
||
|
||
class MessageAdmin(admin.ModelAdmin): | ||
list_display = ("pk", "sent_at", "sender", "subject", "body") | ||
autocomplete_fields = ["sender", "recipients"] | ||
|
||
|
||
admin.site.register(models.Message, MessageAdmin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Generated by Django 4.2.11 on 2024-09-18 19:47 | ||
|
||
import django.db.models.deletion | ||
import django.utils.timezone | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
("base", "0065_fix_projectlocale_permissions"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Message", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
("sent_at", models.DateTimeField(default=django.utils.timezone.now)), | ||
("notification", models.BooleanField(default=False)), | ||
("email", models.BooleanField(default=False)), | ||
("transactional", models.BooleanField(default=False)), | ||
("subject", models.CharField(max_length=255)), | ||
("body", models.TextField()), | ||
("managers", models.BooleanField(default=True)), | ||
("translators", models.BooleanField(default=True)), | ||
("contributors", models.BooleanField(default=True)), | ||
( | ||
"translation_minimum", | ||
models.PositiveIntegerField(blank=True, null=True), | ||
), | ||
( | ||
"translation_maximum", | ||
models.PositiveIntegerField(blank=True, null=True), | ||
), | ||
("translation_from", models.DateField(blank=True, null=True)), | ||
("translation_to", models.DateField(blank=True, null=True)), | ||
("review_minimum", models.PositiveIntegerField(blank=True, null=True)), | ||
("review_maximum", models.PositiveIntegerField(blank=True, null=True)), | ||
("review_from", models.DateField(blank=True, null=True)), | ||
("review_to", models.DateField(blank=True, null=True)), | ||
("login_from", models.DateField(blank=True, null=True)), | ||
("login_to", models.DateField(blank=True, null=True)), | ||
( | ||
"locales", | ||
models.ManyToManyField(related_name="messages", to="base.locale"), | ||
), | ||
( | ||
"projects", | ||
models.ManyToManyField(related_name="messages", to="base.project"), | ||
), | ||
( | ||
"recipients", | ||
models.ManyToManyField( | ||
related_name="received_messages", to=settings.AUTH_USER_MODEL | ||
), | ||
), | ||
( | ||
"sender", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.CASCADE, | ||
related_name="messages", | ||
to=settings.AUTH_USER_MODEL, | ||
), | ||
), | ||
], | ||
), | ||
migrations.AddConstraint( | ||
model_name="message", | ||
constraint=models.CheckConstraint( | ||
check=models.Q( | ||
("notification", True), ("email", True), _connector="OR" | ||
), | ||
name="at_least_one_message_type", | ||
), | ||
), | ||
migrations.AddConstraint( | ||
model_name="message", | ||
constraint=models.CheckConstraint( | ||
check=models.Q( | ||
("managers", True), | ||
("translators", True), | ||
("contributors", True), | ||
_connector="OR", | ||
), | ||
name="at_least_one_user_role", | ||
), | ||
), | ||
] |
Empty file.
Oops, something went wrong.