-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rendered preview in admin. Fixes: #325 #383
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Close stale issues and pull requests | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: '0 0 * * *' # Run every day at midnight | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v8 | ||
with: | ||
days-before-stale: 30 | ||
exempt-issue-labels: in-progress,help-wanted,pinned,security,enhancement |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 3.2.10 on 2021-12-12 02:17 | ||
|
||
from django.db import migrations, models | ||
import jsonfield.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('post_office', '0011_models_help_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='emailtemplate', | ||
name='example_context', | ||
field=jsonfield.fields.JSONField(blank=True, null=True, verbose_name='Context'), | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -269,6 +269,7 @@ class EmailTemplate(models.Model): | |
default='', blank=True) | ||
default_template = models.ForeignKey('self', related_name='translated_templates', | ||
null=True, default=None, verbose_name=_('Default template'), on_delete=models.CASCADE) | ||
example_context = context_field_class(_('Context'), blank=True, null=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we adding a new field to the model? Adding a preview to admin shouldn't necessitate adding a new field. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the variable name is self explanatory, but it's to add a context to the rendered preview so all variables can be rendered with a useful value. |
||
|
||
objects = EmailTemplateManager() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you move this dedicated preview functionality to a new view?