-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2676 from carpentries/feature/2675-ui-improvement…
…s-for-emails [Emails] UI improvements for emails
- Loading branch information
Showing
6 changed files
with
63 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import django_filters | ||
|
||
from emails.models import EmailTemplate, ScheduledEmail | ||
from workshops.filters import AMYFilterSet | ||
|
||
|
||
class EmailTemplateFilter(AMYFilterSet): | ||
name = django_filters.CharFilter(lookup_expr="icontains") | ||
signal = django_filters.CharFilter(lookup_expr="icontains") | ||
from_header = django_filters.CharFilter(lookup_expr="icontains") | ||
subject = django_filters.CharFilter(lookup_expr="icontains") | ||
body = django_filters.CharFilter(lookup_expr="icontains") | ||
|
||
order_by = django_filters.OrderingFilter( | ||
fields=( | ||
"name", | ||
"signal", | ||
), | ||
) | ||
|
||
class Meta: | ||
model = EmailTemplate | ||
fields = [ | ||
"name", | ||
"active", | ||
"signal", | ||
"from_header", | ||
"subject", | ||
"body", | ||
] | ||
|
||
|
||
class ScheduledEmailFilter(AMYFilterSet): | ||
name = django_filters.CharFilter( | ||
field_name="template__name", | ||
lookup_expr="icontains", | ||
label="Name", | ||
) | ||
subject = django_filters.CharFilter(lookup_expr="icontains") | ||
|
||
order_by = django_filters.OrderingFilter( | ||
fields=( | ||
"template__name", | ||
"state", | ||
"scheduled_at", | ||
"subject", | ||
), | ||
) | ||
|
||
class Meta: | ||
model = ScheduledEmail | ||
fields = [ | ||
"name", | ||
"state", | ||
"subject", | ||
] |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% extends "base_nav.html" %} | ||
{% extends "base_nav_sidebar.html" %} | ||
|
||
{% load pagination %} | ||
{% load tags %} | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{% extends "base_nav.html" %} | ||
{% extends "base_nav_sidebar.html" %} | ||
|
||
{% load pagination %} | ||
{% load tags %} | ||
|
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