Add option to save a form in draft state for further continuation

This commit is contained in:
Joshua Rubingh 2020-06-08 12:01:53 +02:00
parent ac39be54cc
commit 1a581420fa
21 changed files with 332 additions and 195 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -42,7 +42,7 @@ msgstr ""
msgid "Welcome at RUG" msgid "Welcome at RUG"
msgstr "" msgstr ""
#: apps/RUG_template/templates/base.html:85 #: apps/RUG_template/templates/base.html:83
msgid "Language selection" msgid "Language selection"
msgstr "" msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-19 12:05+0200\n" "PO-Revision-Date: 2020-05-19 12:05+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -42,7 +42,7 @@ msgstr "Logouit"
msgid "Welcome at RUG" msgid "Welcome at RUG"
msgstr "Welkom bij de RUG" msgstr "Welkom bij de RUG"
#: apps/RUG_template/templates/base.html:85 #: apps/RUG_template/templates/base.html:83
msgid "Language selection" msgid "Language selection"
msgstr "Taal keuze" msgstr "Taal keuze"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-15 12:46+0200\n" "PO-Revision-Date: 2020-05-15 12:46+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-15 12:43+0200\n" "PO-Revision-Date: 2020-05-15 12:43+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-15 12:47+0200\n" "PO-Revision-Date: 2020-05-15 12:47+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"

View File

@ -4,6 +4,7 @@ from django.utils.translation import gettext_lazy as _
from .models import Schedule from .models import Schedule
class ScheduleForm(forms.Form): class ScheduleForm(forms.Form):
name = forms.CharField(label=_('Department name'), help_text=_('Enter a descriptive name for this schedule'), max_length=100) name = forms.CharField(label=_('Department name'), help_text=_('Enter a descriptive name for this schedule'), max_length=100)
email = forms.CharField(label=_('Email address for results'), help_text=_('When the job is done, the results will be sent to this email address'), max_length=100) email = forms.CharField(label=_('Email address for results'), help_text=_('When the job is done, the results will be sent to this email address'), max_length=100)
json = forms.CharField(label=_('Email address for results'), help_text=_('When the job is done, the results will be sent to this email address'), widget=forms.HiddenInput(), strip=True) json = forms.CharField(label=_('JSON form data'), help_text=_('The RAW JSON data of the saved form'), widget=forms.HiddenInput(), strip=True)
status = forms.CharField(label=_('Status'), help_text=_('The status of this schedule.'), max_length=10, widget=forms.HiddenInput() )

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/schedule/admin.py:18 apps/schedule/models.py:68 #: apps/schedule/admin.py:18 apps/schedule/models.py:75
msgid "Done" msgid "Done"
msgstr "" msgstr ""
@ -38,113 +38,125 @@ msgstr ""
msgid "Enter a descriptive name for this schedule" msgid "Enter a descriptive name for this schedule"
msgstr "" msgstr ""
#: apps/schedule/forms.py:8 apps/schedule/forms.py:9 #: apps/schedule/forms.py:8
msgid "Email address for results" msgid "Email address for results"
msgstr "" msgstr ""
#: apps/schedule/forms.py:8 apps/schedule/forms.py:9 #: apps/schedule/forms.py:8
msgid "When the job is done, the results will be sent to this email address" msgid "When the job is done, the results will be sent to this email address"
msgstr "" msgstr ""
#: apps/schedule/models.py:29 #: apps/schedule/forms.py:9
msgid "schedule" msgid "JSON form data"
msgstr "" msgstr ""
#: apps/schedule/models.py:30 #: apps/schedule/forms.py:9
msgid "schedules" msgid "The RAW JSON data of the saved form"
msgstr "" msgstr ""
#: apps/schedule/models.py:64 #: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "New"
msgstr ""
#: apps/schedule/models.py:65
msgid "Accepted"
msgstr ""
#: apps/schedule/models.py:66
msgid "Processing"
msgstr ""
#: apps/schedule/models.py:67
msgid "Processed"
msgstr ""
#: apps/schedule/models.py:69
msgid "Invalid"
msgstr ""
#: apps/schedule/models.py:70
msgid "Failure"
msgstr ""
#: apps/schedule/models.py:72
msgid "Select the employee that is responsible for this schedule request"
msgstr ""
#: apps/schedule/models.py:74
#: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name"
msgstr ""
#: apps/schedule/models.py:74
msgid "Name of the schedule"
msgstr ""
#: apps/schedule/models.py:75
msgid "Email address"
msgstr ""
#: apps/schedule/models.py:75
msgid "Email address where the results will be sent to."
msgstr ""
#: apps/schedule/models.py:77
#: apps/schedule/templates/schedule/schedule_list.html:16 #: apps/schedule/templates/schedule/schedule_list.html:16
msgid "Status" msgid "Status"
msgstr "" msgstr ""
#: apps/schedule/models.py:77 #: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "The status of this schedule." msgid "The status of this schedule."
msgstr "" msgstr ""
#: apps/schedule/models.py:31
msgid "schedule"
msgstr ""
#: apps/schedule/models.py:32
msgid "schedules"
msgstr ""
#: apps/schedule/models.py:70
msgid "Draft"
msgstr ""
#: apps/schedule/models.py:71
msgid "New"
msgstr ""
#: apps/schedule/models.py:72
msgid "Accepted"
msgstr ""
#: apps/schedule/models.py:73
msgid "Processing"
msgstr ""
#: apps/schedule/models.py:74
msgid "Processed"
msgstr ""
#: apps/schedule/models.py:76
msgid "Invalid"
msgstr ""
#: apps/schedule/models.py:77
msgid "Failure"
msgstr ""
#: apps/schedule/models.py:79 #: apps/schedule/models.py:79
msgid "Select the employee that is responsible for this schedule request"
msgstr ""
#: apps/schedule/models.py:81
#: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name"
msgstr ""
#: apps/schedule/models.py:81
msgid "Name of the schedule"
msgstr ""
#: apps/schedule/models.py:82
msgid "Email address"
msgstr ""
#: apps/schedule/models.py:82
msgid "Email address where the results will be sent to."
msgstr ""
#: apps/schedule/models.py:86
msgid "Schedule input" msgid "Schedule input"
msgstr "" msgstr ""
#: apps/schedule/models.py:79 #: apps/schedule/models.py:86
msgid "The schedule input in JSON format based on the form data" msgid "The schedule input in JSON format based on the form data"
msgstr "" msgstr ""
#: apps/schedule/models.py:81 #: apps/schedule/models.py:88
msgid "Peregrine JSON output" msgid "Peregrine JSON output"
msgstr "" msgstr ""
#: apps/schedule/models.py:81 #: apps/schedule/models.py:88
msgid "The results from the Peregrine job in JSON" msgid "The results from the Peregrine job in JSON"
msgstr "" msgstr ""
#: apps/schedule/models.py:83 #: apps/schedule/models.py:90
msgid "Peregrine binary output" msgid "Peregrine binary output"
msgstr "" msgstr ""
#: apps/schedule/models.py:83 #: apps/schedule/models.py:90
msgid "This is the output in binary format from the Peregrine cluster" msgid "This is the output in binary format from the Peregrine cluster"
msgstr "" msgstr ""
#: apps/schedule/models.py:85 #: apps/schedule/models.py:92
msgid "Report is send to user" msgid "Report is send to user"
msgstr "" msgstr ""
#: apps/schedule/models.py:85 #: apps/schedule/models.py:92
msgid "The date and time when the report has sended to the user." msgid "The date and time when the report has sended to the user."
msgstr "" msgstr ""
#: apps/schedule/models.py:87 #: apps/schedule/models.py:94
msgid "Peregrine logging" msgid "Peregrine logging"
msgstr "" msgstr ""
#: apps/schedule/models.py:87 #: apps/schedule/models.py:94
msgid "Here you can see the logging of the Peregrine job." msgid "Here you can see the logging of the Peregrine job."
msgstr "" msgstr ""
@ -170,16 +182,33 @@ msgstr ""
msgid "Actions" msgid "Actions"
msgstr "" msgstr ""
#: apps/schedule/templates/schedule/schedule_list.html:35 #: apps/schedule/templates/schedule/schedule_list.html:41
msgid "No schedules available" msgid "No schedules available"
msgstr "" msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:5 #: apps/schedule/templates/schedule/schedule_new.html:7
#: apps/schedule/templates/schedule/schedule_new.html:6 #: apps/schedule/templates/schedule/schedule_new.html:16
msgid "Resume schedule"
msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:9
#: apps/schedule/templates/schedule/schedule_new.html:18
msgid "Clone schedule" msgid "Clone schedule"
msgstr "" msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:5 #: apps/schedule/templates/schedule/schedule_new.html:11
#: apps/schedule/templates/schedule/schedule_new.html:6 #: apps/schedule/templates/schedule/schedule_new.html:20
msgid "New schedule" msgid "New schedule"
msgstr "" msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:432
msgid "Save as draft"
msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:434
msgid "Submit"
msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:821
msgid "and"
msgstr ""

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-19 12:07+0200\n" "PO-Revision-Date: 2020-06-08 12:00+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
@ -18,7 +18,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n" "X-Generator: Poedit 2.0.6\n"
#: apps/schedule/admin.py:18 apps/schedule/models.py:68 #: apps/schedule/admin.py:18 apps/schedule/models.py:75
msgid "Done" msgid "Done"
msgstr "Klaar" msgstr "Klaar"
@ -38,115 +38,125 @@ msgstr "Afdelingsnaam"
msgid "Enter a descriptive name for this schedule" msgid "Enter a descriptive name for this schedule"
msgstr "Voer een beschrijvende naam in voor dit schema" msgstr "Voer een beschrijvende naam in voor dit schema"
#: apps/schedule/forms.py:8 apps/schedule/forms.py:9 #: apps/schedule/forms.py:8
msgid "Email address for results" msgid "Email address for results"
msgstr "E-mailadres voor resultaten" msgstr "E-mailadres voor resultaten"
#: apps/schedule/forms.py:8 apps/schedule/forms.py:9 #: apps/schedule/forms.py:8
msgid "When the job is done, the results will be sent to this email address" msgid "When the job is done, the results will be sent to this email address"
msgstr "" msgstr "Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd"
"Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd"
#: apps/schedule/models.py:29 #: apps/schedule/forms.py:9
msgid "schedule" msgid "JSON form data"
msgstr "rooster" msgstr "JSON formulier data"
#: apps/schedule/models.py:30 #: apps/schedule/forms.py:9
msgid "schedules" msgid "The RAW JSON data of the saved form"
msgstr "roosters" msgstr "De rauwe JSON data van het opgeslagen formulier"
#: apps/schedule/models.py:64 #: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "New"
msgstr "Nieuw"
#: apps/schedule/models.py:65
msgid "Accepted"
msgstr "Geaccepteerd"
#: apps/schedule/models.py:66
msgid "Processing"
msgstr "Verwerken"
#: apps/schedule/models.py:67
msgid "Processed"
msgstr "Verwerkt"
#: apps/schedule/models.py:69
msgid "Invalid"
msgstr "Ongeldig"
#: apps/schedule/models.py:70
msgid "Failure"
msgstr "Error"
#: apps/schedule/models.py:72
msgid "Select the employee that is responsible for this schedule request"
msgstr ""
"Selecteer de medewerker die verantwoordelijk is voor dit roosterverzoek"
#: apps/schedule/models.py:74
#: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name"
msgstr "Naam"
#: apps/schedule/models.py:74
msgid "Name of the schedule"
msgstr "Naam van de rooster"
#: apps/schedule/models.py:75
msgid "Email address"
msgstr "E-mailadres"
#: apps/schedule/models.py:75
msgid "Email address where the results will be sent to."
msgstr "E-mailadres waar de resultaten naartoe worden gestuurd."
#: apps/schedule/models.py:77
#: apps/schedule/templates/schedule/schedule_list.html:16 #: apps/schedule/templates/schedule/schedule_list.html:16
msgid "Status" msgid "Status"
msgstr "Status" msgstr "Status"
#: apps/schedule/models.py:77 #: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "The status of this schedule." msgid "The status of this schedule."
msgstr "De status van dit rooster." msgstr "De status van dit rooster."
#: apps/schedule/models.py:31
msgid "schedule"
msgstr "rooster"
#: apps/schedule/models.py:32
msgid "schedules"
msgstr "roosters"
#: apps/schedule/models.py:70
msgid "Draft"
msgstr "Concept"
#: apps/schedule/models.py:71
msgid "New"
msgstr "Nieuw"
#: apps/schedule/models.py:72
msgid "Accepted"
msgstr "Geaccepteerd"
#: apps/schedule/models.py:73
msgid "Processing"
msgstr "Verwerken"
#: apps/schedule/models.py:74
msgid "Processed"
msgstr "Verwerkt"
#: apps/schedule/models.py:76
msgid "Invalid"
msgstr "Ongeldig"
#: apps/schedule/models.py:77
msgid "Failure"
msgstr "Error"
#: apps/schedule/models.py:79 #: apps/schedule/models.py:79
msgid "Select the employee that is responsible for this schedule request"
msgstr "Selecteer de medewerker die verantwoordelijk is voor dit roosterverzoek"
#: apps/schedule/models.py:81
#: apps/schedule/templates/schedule/schedule_list.html:13
msgid "Name"
msgstr "Naam"
#: apps/schedule/models.py:81
msgid "Name of the schedule"
msgstr "Naam van de rooster"
#: apps/schedule/models.py:82
msgid "Email address"
msgstr "E-mailadres"
#: apps/schedule/models.py:82
msgid "Email address where the results will be sent to."
msgstr "E-mailadres waar de resultaten naartoe worden gestuurd."
#: apps/schedule/models.py:86
msgid "Schedule input" msgid "Schedule input"
msgstr "Rooster invoer" msgstr "Rooster invoer"
#: apps/schedule/models.py:79 #: apps/schedule/models.py:86
msgid "The schedule input in JSON format based on the form data" msgid "The schedule input in JSON format based on the form data"
msgstr "De rooster invoer in JSON-indeling op basis van de formuliergegevens" msgstr "De rooster invoer in JSON-indeling op basis van de formuliergegevens"
#: apps/schedule/models.py:81 #: apps/schedule/models.py:88
msgid "Peregrine JSON output" msgid "Peregrine JSON output"
msgstr "Peregrine JSON uitvoer" msgstr "Peregrine JSON uitvoer"
#: apps/schedule/models.py:81 #: apps/schedule/models.py:88
msgid "The results from the Peregrine job in JSON" msgid "The results from the Peregrine job in JSON"
msgstr "De resultaten van de Peregrine-taak in JSON" msgstr "De resultaten van de Peregrine-taak in JSON"
#: apps/schedule/models.py:83 #: apps/schedule/models.py:90
msgid "Peregrine binary output" msgid "Peregrine binary output"
msgstr "Peregrine binaire uitvoer" msgstr "Peregrine binaire uitvoer"
#: apps/schedule/models.py:83 #: apps/schedule/models.py:90
msgid "This is the output in binary format from the Peregrine cluster" msgid "This is the output in binary format from the Peregrine cluster"
msgstr "Dit is de uitvoer in binair formaat van het Peregrine-cluster" msgstr "Dit is de uitvoer in binair formaat van het Peregrine-cluster"
#: apps/schedule/models.py:85 #: apps/schedule/models.py:92
msgid "Report is send to user" msgid "Report is send to user"
msgstr "Rapport is naar gebruiker gestuurd" msgstr "Rapport is naar gebruiker gestuurd"
#: apps/schedule/models.py:85 #: apps/schedule/models.py:92
msgid "The date and time when the report has sended to the user." msgid "The date and time when the report has sended to the user."
msgstr "De datum en tijd waarop het rapport naar de gebruiker is verzonden." msgstr "De datum en tijd waarop het rapport naar de gebruiker is verzonden."
#: apps/schedule/models.py:87 #: apps/schedule/models.py:94
msgid "Peregrine logging" msgid "Peregrine logging"
msgstr "Peregrine log" msgstr "Peregrine log"
#: apps/schedule/models.py:87 #: apps/schedule/models.py:94
msgid "Here you can see the logging of the Peregrine job." msgid "Here you can see the logging of the Peregrine job."
msgstr "Hier kunt u de logfile van de Peregrine opdracht zien." msgstr "Hier kunt u de logfile van de Peregrine opdracht zien."
@ -172,31 +182,45 @@ msgstr "Rapport"
msgid "Actions" msgid "Actions"
msgstr "Acties" msgstr "Acties"
#: apps/schedule/templates/schedule/schedule_list.html:35 #: apps/schedule/templates/schedule/schedule_list.html:41
msgid "No schedules available" msgid "No schedules available"
msgstr "Geen roosters beschikbaar" msgstr "Geen roosters beschikbaar"
#: apps/schedule/templates/schedule/schedule_new.html:5 #: apps/schedule/templates/schedule/schedule_new.html:7
#: apps/schedule/templates/schedule/schedule_new.html:6 #: apps/schedule/templates/schedule/schedule_new.html:16
msgid "Resume schedule"
msgstr "Hervat rooster"
#: apps/schedule/templates/schedule/schedule_new.html:9
#: apps/schedule/templates/schedule/schedule_new.html:18
msgid "Clone schedule" msgid "Clone schedule"
msgstr "Dupliceer rooster" msgstr "Dupliceer rooster"
#: apps/schedule/templates/schedule/schedule_new.html:5 #: apps/schedule/templates/schedule/schedule_new.html:11
#: apps/schedule/templates/schedule/schedule_new.html:6 #: apps/schedule/templates/schedule/schedule_new.html:20
msgid "New schedule" msgid "New schedule"
msgstr "Nieuwe rooster" msgstr "Nieuwe rooster"
#: apps/schedule/templates/schedule/schedule_new.html:432
msgid "Save as draft"
msgstr "Sla op als concept"
#: apps/schedule/templates/schedule/schedule_new.html:434
msgid "Submit"
msgstr "Verstuur"
#: apps/schedule/templates/schedule/schedule_new.html:821
msgid "and"
msgstr "en"
#~ msgid "Running" #~ msgid "Running"
#~ msgstr "Bezig" #~ msgstr "Bezig"
#~ msgid "Peregrine input" #~ msgid "Peregrine input"
#~ msgstr "Peregrine invoer" #~ msgstr "Peregrine invoer"
#~ msgid "" #~ msgid "This is the translated content from the source for use with Peregrine cluster"
#~ "This is the translated content from the source for use with Peregrine " #~ msgstr "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#~ "cluster"
#~ msgstr ""
#~ "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#~ msgid "Peregrine accepted" #~ msgid "Peregrine accepted"
#~ msgstr "Peregrine geaccepteerd" #~ msgstr "Peregrine geaccepteerd"

View File

@ -0,0 +1,18 @@
# Generated by Django 3.0.6 on 2020-06-08 08:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('schedule', '0006_auto_20200519_1351'),
]
operations = [
migrations.AlterField(
model_name='schedule',
name='status',
field=models.CharField(choices=[('draft', 'Draft'), ('new', 'New'), ('accepted', 'Accepted'), ('processing', 'Processing'), ('processed', 'Processed'), ('done', 'Done'), ('invalid', 'Invalid'), ('failure', 'Failure')], db_index=True, default='new', help_text='The status of this schedule.', max_length=10, verbose_name='Status'),
),
]

View File

@ -34,6 +34,10 @@ class Schedule(MetaDataModel):
class ScheduleStatus(models.TextChoices): class ScheduleStatus(models.TextChoices):
"""This is a sub class of Schedule which holds all the possible schedule statuses """This is a sub class of Schedule which holds all the possible schedule statuses
.. data:: DRAFT
The schedule is just created but not finished. Schedules in this state can be updated later on.
.. data:: NEW .. data:: NEW
The schedule is just created and waiting to be picked up by the Peregrine scripts. The schedule is just created and waiting to be picked up by the Peregrine scripts.
@ -63,6 +67,7 @@ class Schedule(MetaDataModel):
Something when wrong on Peregrine. Look at the logging output of the Peregrine job Something when wrong on Peregrine. Look at the logging output of the Peregrine job
""" """
DRAFT = 'draft', _('Draft')
NEW = 'new', _('New') NEW = 'new', _('New')
ACCEPTED = 'accepted', _('Accepted') ACCEPTED = 'accepted', _('Accepted')
PROCESSING = 'processing', _('Processing') PROCESSING = 'processing', _('Processing')

View File

@ -24,7 +24,13 @@
<td>{{ schedule.updated_at|date:"SHORT_DATETIME_FORMAT" }}</td> <td>{{ schedule.updated_at|date:"SHORT_DATETIME_FORMAT" }}</td>
<td>{{ schedule.get_status_display }}</td> <td>{{ schedule.get_status_display }}</td>
<td>None</td> <td>None</td>
<td><a href="{% url 'schedule:clone' schedule_id=schedule.id %}">Clone</a></td> <td>
{% if schedule.status == 'draft' %}
<a href="{% url 'schedule:edit' schedule_id=schedule.id %}">Resume</a>
{% else %}
<a href="{% url 'schedule:clone' schedule_id=schedule.id %}">Clone</a>
{% endif %}
</td>
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>

View File

@ -2,12 +2,36 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% block title %}{% if form.json.value %}{% trans "Clone schedule" %}{% else %}{% trans "New schedule" %}{% endif %}{% endblock %} {% block title %}
{% block pagetitle %}{% if form.json.value %}{% trans "Clone schedule" %}{% else %}{% trans "New schedule" %}{% endif %}{% endblock %} {% if form.status.value == 'draft' %}
{% trans "Resume schedule" %}
{% elif form.json.value %}
{% trans "Clone schedule" %}
{% else %}
{% trans "New schedule" %}
{% endif %}
{% endblock %}
{% block pagetitle %}
{% if form.status.value == 'draft' %}
{% trans "Resume schedule" %}
{% elif form.json.value %}
{% trans "Clone schedule" %}
{% else %}
{% trans "New schedule" %}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<form method="POST" action="{% url 'schedule:new' %}" id="new_schedule_form">
{% if form.status.value == 'draft' %}
<form method="POST" action="" id="new_schedule_form">
{% else %}
<form method="POST" action="{% url 'schedule:new' %}" id="new_schedule_form">
{% endif %}
{% csrf_token %} {% csrf_token %}
{{ form.json }} {{ form.json }}
{{ form.status }}
<h1>Algemene informatie</h1> <h1>Algemene informatie</h1>
<p>Als een afdeling meerdere wachtkamers heeft, vul dan dit formulier meerdere keren in; een keer voor elke groep van behandelkamers die een wachtkamer delen.</p> <p>Als een afdeling meerdere wachtkamers heeft, vul dan dit formulier meerdere keren in; een keer voor elke groep van behandelkamers die een wachtkamer delen.</p>
<table> <table>
@ -405,7 +429,9 @@
<br /> <br />
<hr> <hr>
<br /> <br />
<button type="submit" class="btn btn-primary">Submit</button> <button type="submit" id="save_draft" class="btn btn-primary">{% trans "Save as draft" %}</button>
-
<button type="submit" id="save_new" class="btn btn-primary">{% trans "Submit" %}</button>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
function addSpecialisatie() { function addSpecialisatie() {
@ -1042,6 +1068,14 @@
calculateBehandelingen(); calculateBehandelingen();
}); });
jQuery('#save_draft').on('click',function(event){
jQuery('input#id_status').val('draft');
});
jQuery('#save_new').on('click',function(event){
jQuery('input#id_status').val('new');
});
jQuery('form#new_schedule_form').on('submit',function(event){ jQuery('form#new_schedule_form').on('submit',function(event){
if (validate_working_hours() && if (validate_working_hours() &&
calculateBehandelingen() && calculateBehandelingen() &&
@ -1050,6 +1084,7 @@
let formdata = new FormData(this); let formdata = new FormData(this);
formdata.delete('csrfmiddlewaretoken'); formdata.delete('csrfmiddlewaretoken');
formdata.delete('json'); formdata.delete('json');
formdata.delete('status');
// Display the key/value pairs. This is needed to support stupid IE. Mici$oft is still having hardtime playing nice :( // Display the key/value pairs. This is needed to support stupid IE. Mici$oft is still having hardtime playing nice :(
let json_data = {}; let json_data = {};

View File

@ -7,4 +7,5 @@ urlpatterns = [
path('', views.ScheduleListView.as_view(), name='list'), path('', views.ScheduleListView.as_view(), name='list'),
path('new', views.new_or_update_schedule, name='new'), path('new', views.new_or_update_schedule, name='new'),
path('<int:schedule_id>/clone', views.new_or_update_schedule, name='clone'), path('<int:schedule_id>/clone', views.new_or_update_schedule, name='clone'),
path('<int:schedule_id>/edit', views.new_or_update_schedule, name='edit'),
] ]

View File

@ -50,36 +50,59 @@ def new_or_update_schedule(request, schedule_id = None):
schedule = None schedule = None
if schedule_id is not None: if schedule_id is not None:
try: try:
schedule = Schedule.objects.get(pk=schedule_id,employee=request.user.employee) # Try loading an existing schedule. Make sure you only load a schedule that is owned by the logged in user!
schedule = Schedule.objects.get(pk = schedule_id, employee = request.user.employee)
except Schedule.DoesNotExist: except Schedule.DoesNotExist:
# Schedule does not exist, or you do not own the schedule you try to load. Stop playing around on the url bar ;)
pass pass
if request.method == 'POST': if request.method == 'POST':
# Load the form data
schedule_form = ScheduleForm(request.POST) schedule_form = ScheduleForm(request.POST)
# Check if minimal input fields are correct
if schedule_form.is_valid(): if schedule_form.is_valid():
new_schedule = Schedule() # First time saving. Create a new, empty schedule
# Or when the existing schedule has NOT 'draft' status, which means we are cloning an existing schedule
if schedule is None or schedule.status != Schedule.ScheduleStatus.DRAFT:
schedule = Schedule()
# Set the schedule status based on the form pressed button. Either new or draft status
schedule.status = Schedule.ScheduleStatus.DRAFT if schedule_form.cleaned_data['status'] == 'draft' else Schedule.ScheduleStatus.NEW
try: try:
new_schedule.planning_source = json.loads(schedule_form.cleaned_data['json']) # Try loading the JSON data from the form
schedule.planning_source = json.loads(schedule_form.cleaned_data['json'])
except json.JSONDecodeError as ex: except json.JSONDecodeError as ex:
new_schedule.planning_source = json.loads(json.dumps({'error': str(ex)})) # Something when wrong. The error is saved instead, and can be read out in the admin area
new_schedule.status = Schedule.ScheduleStatus.INVALID schedule.planning_source = json.loads(json.dumps({'error': str(ex)}))
schedule.status = Schedule.ScheduleStatus.INVALID
new_schedule.employee = request.user.employee # Make sure that the logged in user that is creating the schedule does become the owner
new_schedule.name = schedule_form.cleaned_data['name'] schedule.employee = request.user.employee
new_schedule.email = schedule_form.cleaned_data['email'] # Store name of the schedule
schedule.name = schedule_form.cleaned_data['name']
new_schedule.save() # Store email address for the results
schedule.email = schedule_form.cleaned_data['email']
# Save the schedule to the database
schedule.save()
# Return to overview
return redirect('schedule:list') return redirect('schedule:list')
else: else:
# We start with a new form. Either new of clone/edit
status = 'new'
json_form = ''
if schedule is not None: if schedule is not None:
schedule = json.dumps(schedule.planning_source) # The schedule is an existing one. So we are in clone/edit mode. So load the current status and JSON data
status = schedule.status
json_form = json.dumps(schedule.planning_source)
schedule_form = ScheduleForm(initial={'json' : schedule}) # Create the from logic
schedule_form = ScheduleForm(initial={'json' : json_form, 'status' : status})
# Show the form in the browser
return render(request, template_name, { return render(request, template_name, {
'form' : schedule_form, 'form' : schedule_form,
}) })

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-18 11:10+0200\n" "PO-Revision-Date: 2020-06-08 11:57+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: nl\n" "Language: nl\n"
@ -36,7 +36,7 @@ msgstr "De datum en tijd waarop dit model is bijgewerkt"
#: templates/menu.html:4 #: templates/menu.html:4
msgid "Het 1,5 meter ziekenhuis" msgid "Het 1,5 meter ziekenhuis"
msgstr "" msgstr "Het 1,5 meter ziekenhuis"
#: templates/menu.html:8 templates/registration/login.html:4 #: templates/menu.html:8 templates/registration/login.html:4
#: templates/registration/login.html:5 templates/registration/login.html:8 #: templates/registration/login.html:5 templates/registration/login.html:8

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,12 +18,8 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: polyclinic_scheduling/settings.py:129
msgid "Dutch"
msgstr ""
#: polyclinic_scheduling/settings.py:130 #: polyclinic_scheduling/settings.py:130
msgid "English" msgid "Dutch"
msgstr "" msgstr ""
#: polyclinic_scheduling/urls.py:22 polyclinic_scheduling/urls.py:23 #: polyclinic_scheduling/urls.py:22 polyclinic_scheduling/urls.py:23

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n" "POT-Creation-Date: 2020-06-08 11:58+0200\n"
"PO-Revision-Date: 2020-05-15 12:49+0200\n" "PO-Revision-Date: 2020-05-15 12:49+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n" "Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n" "Language-Team: \n"
@ -18,14 +18,10 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n" "X-Generator: Poedit 2.0.6\n"
#: polyclinic_scheduling/settings.py:129 #: polyclinic_scheduling/settings.py:130
msgid "Dutch" msgid "Dutch"
msgstr "Nederlands" msgstr "Nederlands"
#: polyclinic_scheduling/settings.py:130
msgid "English"
msgstr "Engels"
#: polyclinic_scheduling/urls.py:22 polyclinic_scheduling/urls.py:23 #: polyclinic_scheduling/urls.py:22 polyclinic_scheduling/urls.py:23
msgid "University of Groningen Polyclinic planning tool" msgid "University of Groningen Polyclinic planning tool"
msgstr "RUG Poliklinieken planning tool" msgstr "RUG Poliklinieken planning tool"
@ -33,3 +29,6 @@ msgstr "RUG Poliklinieken planning tool"
#: polyclinic_scheduling/urls.py:24 #: polyclinic_scheduling/urls.py:24
msgid "Polyclinic planning tool" msgid "Polyclinic planning tool"
msgstr "Poliklinieken planning tool" msgstr "Poliklinieken planning tool"
#~ msgid "English"
#~ msgstr "Engels"