-
Notifications
You must be signed in to change notification settings - Fork 6
Feature/email reminder #378
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
Open
Fredrikke0
wants to merge
12
commits into
main
Choose a base branch
from
feature/email-reminder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
0bce833
epost søl
Fredrikke0 c38f81e
Created email form
Fredrikke0 c5dda3c
Created button for email form
Fredrikke0 a9f4ccc
Created form for writing email, as well as its corresponding content …
Fredrikke0 9f0e44a
Created a view related to email creation and urls with it.
Fredrikke0 213a83b
Merge remote-tracking branch 'origin/dev' into feature/email-reminder
Fredrikke0 820baf3
Rename 0020_auto_20210420_1410.py to 0020_added_hyphen_to_fieldname_m…
Fredrikke0 b2d52e0
Rename 0021_auto_20210420_1410.py to 0021_create_emailbase.py
Fredrikke0 edea6a8
Update news/templates/news/timeplace_email.html
Fredrikke0 b7f4439
Rename 0020_merge_20210419_1301.py to 0020_empty.py
Fredrikke0 6b9875c
Fixed depency name
Fredrikke0 f0113d5
Update 0021_create_emailbase.py
Fredrikke0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
18 changes: 18 additions & 0 deletions
18
make_queue/migrations/0020_added_hyphen_to_fieldname_multiperiod.py
This file contains hidden or 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,18 @@ | ||
| # Generated by Django 3.1.6 on 2021-04-20 12:10 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('make_queue', '0019_add_related_names'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterField( | ||
| model_name='reservationrule', | ||
| name='max_inside_border_crossed', | ||
| field=models.FloatField(verbose_name='Hours multiperiod'), | ||
| ), | ||
| ] |
This file contains hidden or 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 hidden or 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,17 @@ | ||
| # Generated by Django 3.1.6 on 2021-02-15 14:04 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('news', '0017_use_datetime_instead_of_date_and_time'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AlterModelOptions( | ||
| name='timeplace', | ||
| options={'ordering': ('start_time',), 'permissions': (('can_send_email', 'Can send email'),)}, | ||
| ), | ||
| ] |
This file contains hidden or 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,14 @@ | ||
| # Generated by Django 3.1.6 on 2021-04-19 11:01 | ||
|
|
||
| from django.db import migrations | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('news', '0019_add_related_names'), | ||
| ('news', '0018_send_email_permission'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| ] |
This file contains hidden or 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,27 @@ | ||
| # Generated by Django 3.1.6 on 2021-04-20 12:10 | ||
|
|
||
| from django.db import migrations, models | ||
| import web.modelfields | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('news', '0020_added_hyphen_to_fieldname_multiperiod'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='EmailBase', | ||
| fields=[ | ||
| ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('subject', models.CharField(max_length=60, verbose_name='Subject')), | ||
| ('body', models.TextField(verbose_name='Body')), | ||
| ('recipients', web.modelfields.UnlimitedCharField(verbose_name='Recipients')), | ||
| ], | ||
| ), | ||
| migrations.AlterModelOptions( | ||
| name='timeplace', | ||
| options={'ordering': ('start_time',)}, | ||
| ), | ||
| ] |
This file contains hidden or 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 hidden or 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,47 @@ | ||
| {% load static %} | ||
| {% load i18n %} | ||
|
|
||
| {# CSS styles should be inline, as most email clients don't support external stylesheets, and many don't support <style> tags. #} | ||
| {# <Se></Se>e https://css-tricks.com/using-css-in-html-emails-the-real-story/ for more details on what is and isn't supported. #} | ||
|
|
||
|
|
||
| <!DOCTYPE html> | ||
| {% get_current_language as LANGUAGE_CODE %} | ||
| <html lang="{{ LANGUAGE_CODE }}" style="width: 100%; padding: 0; margin: 0;"> | ||
| <body style="width: 100%; padding: 0; margin: 0;"> | ||
|
|
||
| <table style="width: 100%; padding: 0; margin: 0; border-width: 0; border-collapse: collapse;"> | ||
| <thead style="width: 100%; background-color: rgb(34, 43, 52); margin: 0; padding: 0;"> | ||
| <tr style="padding: 0; margin: 0; width: 100%;"> | ||
| <th style="padding: 20px;"> | ||
| <img src="{{ site }}{% static 'web/img/logo_white.svg' %}" | ||
| style="width: 500px; max-width: 100%;" alt="MAKE NTNU logo" | ||
| /> | ||
| </th> | ||
| </tr> | ||
| </thead> | ||
| <tbody style="width: 100%;"> | ||
| <tr style="width: 100%"> | ||
| <td style="align-items: center; padding: 0; margin: 0;"> | ||
| <img src="{{ event_or_time_place.event.image.url }}" | ||
| style="width: 100%;" alt="Event image" | ||
| /> | ||
| </td> | ||
| </tr> | ||
| <tr style="width: 100%"> | ||
| <td style="padding: 30px 30px 0 30px; font-size: 30px; font-weight: bold;"> | ||
| {% trans "You've received an update for the event" %} "{{ event_or_time_place.event.title|default:"Event name" }}": | ||
| </td> | ||
| </tr> | ||
| <tr style="width: 100%"> | ||
| <td style="padding: 15px 30px 0 30px;"> | ||
| {% autoescape off %} | ||
| {{ body }} | ||
| {% endautoescape %} | ||
| </td> | ||
| </tr> | ||
| </tbody> | ||
| </table> | ||
|
|
||
| </body> | ||
| </html> |
This file contains hidden or 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,6 @@ | ||
| {% load i18n %} | ||
|
|
||
|
|
||
| {% trans "You've received an update for the event" %} ""{{ event_or_time_place.event.title }}"": | ||
|
|
||
| "{{ body }} " | ||
|
mahoyen marked this conversation as resolved.
|
||
This file contains hidden or 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 hidden or 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,40 @@ | ||||||
| {% extends 'web/base.html' %} | ||||||
| {% load static %} | ||||||
| {% load i18n %} | ||||||
|
|
||||||
| {% block title %}{% trans "Create email" %}{% endblock title %} | ||||||
|
|
||||||
| {% block head %} | ||||||
| <script type="text/javascript" src="{% static "ckeditor/ckeditor-init.js" %}"></script> | ||||||
| <script type="text/javascript" src="{% static "ckeditor/ckeditor/ckeditor.js" %}"></script> | ||||||
| <script type="text/javascript" src="{% static "news/js/event_type.js" %}"></script> | ||||||
| {% endblock head %} | ||||||
|
|
||||||
| {% block body %} | ||||||
| <h1 class="ui centered header"> | ||||||
| {% block form_header %}{% trans "Create email" %}{% endblock form_header %} | ||||||
| </h1> | ||||||
| <form class="ui form text container" method="post" enctype="multipart/form-data"> | ||||||
| {% csrf_token %} | ||||||
| <div class="field"> | ||||||
| <label>{{ form.title.label }}</label> | ||||||
| {{ form.title }} | ||||||
| </div> | ||||||
| <div class="field"> | ||||||
| <label>{{ form.content.label }} | ||||||
| <span data-content="{% trans "The main content of the email." %}"> | ||||||
| <i class="ui yellow question circle icon"></i> | ||||||
| </span> | ||||||
| </label> | ||||||
| {{ form.content }} | ||||||
| </div> | ||||||
| <input class="ui yellow right floated submit button" type="submit" value="{% trans "Send" %}"> | ||||||
| <a href="{% block cancel-url %}{% url "admin-event" form.instance.id %}{% endblock %}" class="ui red right floated button"> | ||||||
|
Member
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. Please add the name to the
Suggested change
|
||||||
| {% trans "Cancel" context "abort action" %} | ||||||
| </a> | ||||||
| </form> | ||||||
|
|
||||||
| <script> | ||||||
| $("span[data-content]").popup(); | ||||||
| </script> | ||||||
| {% endblock body %} | ||||||
This file contains hidden or 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,39 @@ | ||
| {% extends 'web/base.html' %} | ||
| {% load static %} | ||
| {% load i18n %} | ||
|
|
||
|
|
||
| {% block title %}{% trans "Edit email" %}{% endblock title %} | ||
|
|
||
| {% block head %} | ||
| {{ form.media }} | ||
| {% endblock head %} | ||
|
|
||
| {% block body %} | ||
| <h1 class="ui centered header">{% block form_header %}{% trans "Edit email" %}{% endblock form_header %}</h1> | ||
| <form class="ui form text container" action="" method="POST" enctype="multipart/form-data"> | ||
| {% for error in form.non_field_errors %} | ||
| <div class="ui negative message"> | ||
| {{ error }} | ||
| </div> | ||
| {% endfor %} | ||
| {% csrf_token %} | ||
|
|
||
| <div class="field"> | ||
| <label>{{ "Subject" }}</label> | ||
| {{ form.subject }} | ||
| </div> | ||
| <div class="field"> | ||
| <label>{% trans "Body" %}</label> | ||
| {{ form.body }} | ||
| </div> | ||
|
|
||
| <input class="ui right floated make-bg-yellow submit button" type="submit" value="{% trans "Send" %}"/> | ||
| <a class="ui right floated red button" href="{% url "admin-event" event.pk %}"> | ||
| {% trans "Cancel" context "abort action" %} | ||
| </a> | ||
| </form> | ||
| <script> | ||
| $("span[data-content]").popup(); | ||
| </script> | ||
| {% endblock body %} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It is nice if you have add tests that verify that the validation works as intended. I can help in a worksession if you'd like.