Skip to content
Snippets Groups Projects
Commit 0430e762 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Finish AUB notification

parent 588c4e47
No related branches found
No related tags found
1 merge request!86Merge school-apps
......@@ -2,15 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3a000256-1023-4a19-a046-bde25cb853cc" name="Default" comment="">
<change beforePath="" afterPath="$PROJECT_DIR$/schoolapps/templates/mail/notification.html" />
<change beforePath="" afterPath="$PROJECT_DIR$/schoolapps/templates/mail/notification.txt" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
<change beforePath="$PROJECT_DIR$/schoolapps/aub/views.py" afterPath="$PROJECT_DIR$/schoolapps/aub/views.py" />
<change beforePath="$PROJECT_DIR$/schoolapps/dashboard/models.py" afterPath="$PROJECT_DIR$/schoolapps/dashboard/models.py" />
<change beforePath="$PROJECT_DIR$/schoolapps/dashboard/templates/dashboard/index.html" afterPath="$PROJECT_DIR$/schoolapps/dashboard/templates/dashboard/index.html" />
<change beforePath="$PROJECT_DIR$/schoolapps/dashboard/urls.py" afterPath="$PROJECT_DIR$/schoolapps/dashboard/urls.py" />
<change beforePath="$PROJECT_DIR$/schoolapps/dashboard/views.py" afterPath="$PROJECT_DIR$/schoolapps/dashboard/views.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -41,7 +34,7 @@
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="6" column="31" lean-forward="true" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<caret line="6" column="31" lean-forward="false" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<folding />
</state>
</provider>
......@@ -50,8 +43,8 @@
<file leaf-file-name="views.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/schoolapps/aub/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
<caret line="107" column="59" lean-forward="true" selection-start-line="107" selection-start-column="59" selection-end-line="107" selection-end-column="59" />
<state relative-caret-position="-494">
<caret line="81" column="20" lean-forward="true" selection-start-line="81" selection-start-column="20" selection-end-line="81" selection-end-column="20" />
<folding>
<element signature="e#0#78#0" expanded="true" />
</folding>
......@@ -72,7 +65,7 @@
<file leaf-file-name="models.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<state relative-caret-position="68">
<caret line="4" column="5" lean-forward="false" selection-start-line="4" selection-start-column="5" selection-end-line="4" selection-end-column="5" />
<folding />
</state>
......@@ -82,8 +75,8 @@
<file leaf-file-name="index.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/templates/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="44" column="32" lean-forward="true" selection-start-line="44" selection-start-column="32" selection-end-line="44" selection-end-column="32" />
<state relative-caret-position="748">
<caret line="44" column="32" lean-forward="false" selection-start-line="44" selection-start-column="32" selection-end-line="44" selection-end-column="32" />
<folding />
</state>
</provider>
......@@ -93,7 +86,7 @@
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/notification.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="40" lean-forward="true" selection-start-line="11" selection-start-column="40" selection-end-line="11" selection-end-column="40" />
<caret line="11" column="44" lean-forward="false" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="44" />
<folding />
</state>
</provider>
......@@ -102,7 +95,7 @@
<file leaf-file-name="header.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/schoolapps/templates/partials/header.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<state relative-caret-position="170">
<caret line="10" column="4" lean-forward="false" selection-start-line="10" selection-start-column="4" selection-end-line="16" selection-end-column="97" />
<folding />
</state>
......@@ -122,8 +115,8 @@
<file leaf-file-name="views.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="662">
<caret line="41" column="0" lean-forward="true" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
<state relative-caret-position="612">
<caret line="41" column="0" lean-forward="false" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
<folding>
<element signature="e#0#57#0" expanded="true" />
</folding>
......@@ -248,6 +241,7 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="ProjectPane">
<subPane>
<expand>
......@@ -304,7 +298,6 @@
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -640,7 +633,14 @@
<option name="project" value="LOCAL" />
<updated>1523524716459</updated>
</task>
<option name="localTasksCounter" value="34" />
<task id="LOCAL-00034" summary="First notification with email in AUB">
<created>1523710638115</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1523710638115</updated>
</task>
<option name="localTasksCounter" value="35" />
<servers />
</component>
<component name="ToolWindowManager">
......@@ -651,12 +651,11 @@
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.27083334" sideWeight="0.5" order="10" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294509" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.21963394" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.21963394" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24242425" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24621212" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="11" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294509" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
......@@ -666,6 +665,7 @@
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3294509" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Data View" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
</layout>
......@@ -680,7 +680,6 @@
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Include Materialize" />
<MESSAGE value="Finish first design" />
<MESSAGE value="Finish basic design (header, footer, etc.)" />
<MESSAGE value="Translate login/logout | Comment header" />
......@@ -705,7 +704,8 @@
<MESSAGE value="Tidy (comment out not used code) | Use timezone.datetime instead of datetime | Register activity in apply for aub" />
<MESSAGE value="One template for both check sites [AUB]" />
<MESSAGE value="Remove activity registering [DASHBOARD]" />
<option name="LAST_COMMIT_MESSAGE" value="Remove activity registering [DASHBOARD]" />
<MESSAGE value="First notification with email in AUB" />
<option name="LAST_COMMIT_MESSAGE" value="First notification with email in AUB" />
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
<option name="REARRANGE_BEFORE_PROJECT_COMMIT" value="true" />
</component>
......@@ -863,7 +863,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="383">
<caret line="147" column="19" lean-forward="false" selection-start-line="147" selection-start-column="19" selection-end-line="147" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
......@@ -899,7 +898,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
......@@ -924,7 +922,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
......@@ -949,25 +946,15 @@
<state split_layout="SPLIT">
<first_editor relative-caret-position="204">
<caret line="12" column="7" lean-forward="true" selection-start-line="12" selection-start-column="7" selection-end-line="12" selection-end-column="7" />
<folding />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/aub/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="7" column="61" lean-forward="false" selection-start-line="7" selection-start-column="61" selection-end-line="7" selection-end-column="61" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/email.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="27" lean-forward="false" selection-start-line="0" selection-start-column="27" selection-end-line="0" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
......@@ -975,14 +962,13 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="6" column="4" lean-forward="false" selection-start-line="6" selection-start-column="4" selection-end-line="6" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/templates/dashboard/index.html">
<entry file="file://$PROJECT_DIR$/schoolapps/aub/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="425">
<caret line="44" column="32" lean-forward="true" selection-start-line="44" selection-start-column="32" selection-end-line="44" selection-end-column="32" />
<state relative-caret-position="102">
<caret line="7" column="61" lean-forward="false" selection-start-line="7" selection-start-column="61" selection-end-line="7" selection-end-column="61" />
<folding />
</state>
</provider>
......@@ -990,7 +976,7 @@
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="85">
<caret line="6" column="31" lean-forward="true" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<caret line="6" column="31" lean-forward="false" selection-start-line="6" selection-start-column="31" selection-end-line="6" selection-end-column="31" />
<folding />
</state>
</provider>
......@@ -1005,50 +991,58 @@
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<state relative-caret-position="68">
<caret line="4" column="5" lean-forward="false" selection-start-line="4" selection-start-column="5" selection-end-line="4" selection-end-column="5" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/notification.txt">
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/templates/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="12" column="19" lean-forward="false" selection-start-line="12" selection-start-column="19" selection-end-line="12" selection-end-column="19" />
<state relative-caret-position="748">
<caret line="44" column="32" lean-forward="false" selection-start-line="44" selection-start-column="32" selection-end-line="44" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/views.py">
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/notification.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="662">
<caret line="41" column="0" lean-forward="true" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
<folding>
<element signature="e#0#57#0" expanded="true" />
</folding>
<state relative-caret-position="187">
<caret line="11" column="44" lean-forward="false" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="44" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/templates/partials/header.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<state relative-caret-position="170">
<caret line="10" column="4" lean-forward="false" selection-start-line="10" selection-start-column="4" selection-end-line="16" selection-end-column="97" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/notification.html">
<entry file="file://$PROJECT_DIR$/schoolapps/templates/mail/notification.txt">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="187">
<caret line="11" column="40" lean-forward="true" selection-start-line="11" selection-start-column="40" selection-end-line="11" selection-end-column="40" />
<state relative-caret-position="204">
<caret line="12" column="19" lean-forward="false" selection-start-line="12" selection-start-column="19" selection-end-line="12" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/dashboard/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="612">
<caret line="41" column="0" lean-forward="false" selection-start-line="41" selection-start-column="0" selection-end-line="41" selection-end-column="0" />
<folding>
<element signature="e#0#57#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/schoolapps/aub/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
<caret line="107" column="59" lean-forward="true" selection-start-line="107" selection-start-column="59" selection-end-line="107" selection-end-column="59" />
<state relative-caret-position="-494">
<caret line="81" column="20" lean-forward="true" selection-start-line="81" selection-start-column="20" selection-end-line="81" selection-end-column="20" />
<folding>
<element signature="e#0#78#0" expanded="true" />
</folding>
......
......@@ -104,7 +104,10 @@ def check2(request):
aub_id = request.POST['aub-id']
aub = Aub.objects.get(id=aub_id)
if 'allow' in request.POST:
# Update status
Aub.objects.filter(id=aub_id).update(status=ALLOWED_STATUS)
# Notify user
register_notification(title="Ihr Antrag auf Unterrichtsbefreiung wurde genehmigt",
description="Ihr Antrag auf Unterrichtsbefreiung vom {} bis {} wurde von der Schulleitung genehmigt.".format(
aub.from_dt,
......@@ -112,8 +115,17 @@ def check2(request):
app=AubConfig.verbose_name, user=aub.created_by,
link=reverse('aub_details', args=[aub.id]))
elif 'deny' in request.POST:
# Update status
Aub.objects.filter(id=aub_id).update(status=NOT_ALLOWED_STATUS)
# Notify user
register_notification(title="Ihr Antrag auf Unterrichtsbefreiung wurde abgelehnt",
description="Ihr Antrag auf Unterrichtsbefreiung vom {} bis {} wurde von der Schulleitung abgelehnt. Für weitere Informationen kontaktieren Sie bitte die Schulleitung.".format(
aub.from_dt,
aub.to_dt),
app=AubConfig.verbose_name, user=aub.created_by,
link=reverse('aub_details', args=[aub.id]))
aubs = Aub.objects.filter(status=SEMI_ALLOWED_STATUS)
context = {
'aubs': aubs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment