Compare commits

...

16 Commits

27 changed files with 459 additions and 263 deletions

Binary file not shown.

View File

@ -15,6 +15,7 @@ Here you can read more information about the Poliklinieken Planning Tool.
install
models
views
Indices and tables
==================

6
doc/views.rst Normal file
View File

@ -0,0 +1,6 @@
======
Vieuws
======
.. automodule:: apps.schedule.views
:members:

View File

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

View File

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

View File

@ -0,0 +1,18 @@
;(function(){var k;function m(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var p="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},q="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:this;function r(){r=function(){};q.Symbol||(q.Symbol=u)}function v(a,b){this.s=a;p(this,"description",{configurable:!0,writable:!0,value:b})}
v.prototype.toString=function(){return this.s};var u=function(){function a(c){if(this instanceof a)throw new TypeError("Symbol is not a constructor");return new v("jscomp_symbol_"+(c||"")+"_"+b++,c)}var b=0;return a}();function w(){r();var a=q.Symbol.iterator;a||(a=q.Symbol.iterator=q.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[a]&&p(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return x(m(this))}});w=function(){}}
function x(a){w();a={next:a};a[q.Symbol.iterator]=function(){return this};return a}function y(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:m(a)}}var z;if("function"==typeof Object.setPrototypeOf)z=Object.setPrototypeOf;else{var A;a:{var B={v:!0},C={};try{C.__proto__=B;A=C.v;break a}catch(a){}A=!1}z=A?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var D=z;
function E(){this.h=!1;this.c=null;this.o=void 0;this.b=1;this.m=this.w=0;this.g=null}function F(a){if(a.h)throw new TypeError("Generator is already running");a.h=!0}E.prototype.i=function(a){this.o=a};E.prototype.j=function(a){this.g={A:a,B:!0};this.b=this.w||this.m};E.prototype["return"]=function(a){this.g={"return":a};this.b=this.m};function G(a,b,c){a.b=c;return{value:b}}function H(a){this.C=a;this.l=[];for(var b in a)this.l.push(b);this.l.reverse()}function I(a){this.a=new E;this.D=a}
I.prototype.i=function(a){F(this.a);if(this.a.c)return J(this,this.a.c.next,a,this.a.i);this.a.i(a);return K(this)};function L(a,b){F(a.a);var c=a.a.c;if(c)return J(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.a["return"]);a.a["return"](b);return K(a)}I.prototype.j=function(a){F(this.a);if(this.a.c)return J(this,this.a.c["throw"],a,this.a.i);this.a.j(a);return K(this)};
function J(a,b,c,d){try{var e=b.call(a.a.c,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.a.h=!1,e;var f=e.value}catch(g){return a.a.c=null,a.a.j(g),K(a)}a.a.c=null;d.call(a.a,f);return K(a)}function K(a){for(;a.a.b;)try{var b=a.D(a.a);if(b)return a.a.h=!1,{value:b.value,done:!1}}catch(c){a.a.o=void 0,a.a.j(c)}a.a.h=!1;if(a.a.g){b=a.a.g;a.a.g=null;if(b.B)throw b.A;return{value:b["return"],done:!0}}return{value:void 0,done:!0}}
function M(a){this.next=function(b){return a.i(b)};this["throw"]=function(b){return a.j(b)};this["return"]=function(b){return L(a,b)};w();this[Symbol.iterator]=function(){return this}}function N(a,b){var c=new M(new I(b));D&&D(c,a.prototype);return c}
if("undefined"!==typeof Blob&&("undefined"===typeof FormData||!FormData.prototype.keys)){var O=function(a,b){for(var c=0;c<a.length;c++)b(a[c])},P=function(a,b,c){return b instanceof Blob?[String(a),b,void 0!==c?c+"":"string"===typeof b.name?b.name:"blob"]:[String(a),String(b)]},Q=function(a,b){if(a.length<b)throw new TypeError(b+" argument required, but only "+a.length+" present.");},S=function(a){var b=y(a);a=b.next().value;b=b.next().value;a instanceof Blob&&(a=new File([a],b,{type:a.type,lastModified:a.lastModified}));
return a},T="object"===typeof window?window:"object"===typeof self?self:this,U=T.FormData,V=T.XMLHttpRequest&&T.XMLHttpRequest.prototype.send,W=T.Request&&T.fetch,X=T.navigator&&T.navigator.sendBeacon;r();var Y=T.Symbol&&Symbol.toStringTag;Y&&(Blob.prototype[Y]||(Blob.prototype[Y]="Blob"),"File"in T&&!File.prototype[Y]&&(File.prototype[Y]="File"));try{new File([],"")}catch(a){T.File=function(b,c,d){b=new Blob(b,d);d=d&&void 0!==d.lastModified?new Date(d.lastModified):new Date;Object.defineProperties(b,
{name:{value:c},lastModifiedDate:{value:d},lastModified:{value:+d},toString:{value:function(){return"[object File]"}}});Y&&Object.defineProperty(b,Y,{value:"File"});return b}}r();w();var Z=function(a){this.f=Object.create(null);if(!a)return this;var b=this;O(a.elements,function(c){if(c.name&&!c.disabled&&"submit"!==c.type&&"button"!==c.type)if("file"===c.type){var d=c.files&&c.files.length?c.files:[new File([],"",{type:"application/octet-stream"})];O(d,function(e){b.append(c.name,e)})}else"select-multiple"===
c.type||"select-one"===c.type?O(c.options,function(e){!e.disabled&&e.selected&&b.append(c.name,e.value)}):"checkbox"===c.type||"radio"===c.type?c.checked&&b.append(c.name,c.value):(d="textarea"===c.type?c.value.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"):c.value,b.append(c.name,d))})};k=Z.prototype;k.append=function(a,b,c){Q(arguments,2);var d=y(P.apply(null,arguments));a=d.next().value;b=d.next().value;c=d.next().value;d=this.f;d[a]||(d[a]=[]);d[a].push([b,c])};k["delete"]=function(a){Q(arguments,
1);delete this.f[String(a)]};k.entries=function b(){var c=this,d,e,f,g,h,t;return N(b,function(l){switch(l.b){case 1:d=c.f,f=new H(d);case 2:var n;a:{for(n=f;0<n.l.length;){var R=n.l.pop();if(R in n.C){n=R;break a}}n=null}if(null==(e=n)){l.b=0;break}g=y(d[e]);h=g.next();case 5:if(h.done){l.b=2;break}t=h.value;return G(l,[e,S(t)],6);case 6:h=g.next(),l.b=5}})};k.forEach=function(b,c){Q(arguments,1);for(var d=y(this),e=d.next();!e.done;e=d.next()){var f=y(e.value);e=f.next().value;f=f.next().value;
b.call(c,f,e,this)}};k.get=function(b){Q(arguments,1);var c=this.f;b=String(b);return c[b]?S(c[b][0]):null};k.getAll=function(b){Q(arguments,1);return(this.f[String(b)]||[]).map(S)};k.has=function(b){Q(arguments,1);return String(b)in this.f};k.keys=function c(){var d=this,e,f,g,h,t;return N(c,function(l){1==l.b&&(e=y(d),f=e.next());if(3!=l.b){if(f.done){l.b=0;return}g=f.value;h=y(g);t=h.next().value;return G(l,t,3)}f=e.next();l.b=2})};k.set=function(c,d,e){Q(arguments,2);var f=P.apply(null,arguments);
this.f[f[0]]=[[f[1],f[2]]]};k.values=function d(){var e=this,f,g,h,t,l;return N(d,function(n){1==n.b&&(f=y(e),g=f.next());if(3!=n.b){if(g.done){n.b=0;return}h=g.value;t=y(h);t.next();l=t.next().value;return G(n,l,3)}g=f.next();n.b=2})};Z.prototype._asNative=function(){for(var d=new U,e=y(this),f=e.next();!f.done;f=e.next()){var g=y(f.value);f=g.next().value;g=g.next().value;d.append(f,g)}return d};Z.prototype._blob=function(){for(var d="----formdata-polyfill-"+Math.random(),e=[],f=y(this),g=f.next();!g.done;g=
f.next()){var h=y(g.value);g=h.next().value;h=h.next().value;e.push("--"+d+"\r\n");h instanceof Blob?e.push('Content-Disposition: form-data; name="'+g+'"; filename="'+h.name+'"\r\n',"Content-Type: "+(h.type||"application/octet-stream")+"\r\n\r\n",h,"\r\n"):e.push('Content-Disposition: form-data; name="'+g+'"\r\n\r\n'+h+"\r\n")}e.push("--"+d+"--");return new Blob(e,{type:"multipart/form-data; boundary="+d})};Z.prototype[Symbol.iterator]=function(){return this.entries()};Z.prototype.toString=function(){return"[object FormData]"};
Y&&(Z.prototype[Y]="FormData");if(V){var aa=T.XMLHttpRequest.prototype.setRequestHeader;T.XMLHttpRequest.prototype.setRequestHeader=function(d,e){aa.call(this,d,e);"content-type"===d.toLowerCase()&&(this.u=!0)};T.XMLHttpRequest.prototype.send=function(d){d instanceof Z?(d=d._blob(),this.u||this.setRequestHeader("Content-Type",d.type),V.call(this,d)):V.call(this,d)}}if(W){var ba=T.fetch;T.fetch=function(d,e){e&&e.body&&e.body instanceof Z&&(e.body=e.body._blob());return ba.call(this,d,e)}}X&&(T.navigator.sendBeacon=
function(d,e){e instanceof Z&&(e=e._asNative());return X.call(this,d,e)});T.FormData=Z};
})();

View File

@ -48,6 +48,7 @@
<link href="{% static 'RUG_template/css/base.css' %}" rel="stylesheet"/>
<script type="text/javascript" src="{% static 'RUG_template/javascript/moment-with-locales.min.js' %}"></script>
<script type="text/javascript" src="{% static 'RUG_template/javascript/humanize-duration.js' %}"></script>
<script type="text/javascript" src="{% static 'RUG_template/javascript/formdata.min.js' %}"></script>
</head>
<body itemtype="http://schema.org/WebPage" itemscope="itemscope" id="top" class="page--topicpage"><!--googleoff: all-->

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,4 +6,5 @@ from .models import Schedule
class ScheduleForm(forms.Form):
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)
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 ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n"
"POT-Creation-Date: 2020-06-08 13:43+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\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"
msgstr ""
@ -38,113 +38,125 @@ msgstr ""
msgid "Enter a descriptive name for this schedule"
msgstr ""
#: apps/schedule/forms.py:8 apps/schedule/forms.py:9
#: apps/schedule/forms.py:8
msgid "Email address for results"
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"
msgstr ""
#: apps/schedule/models.py:29
msgid "schedule"
#: apps/schedule/forms.py:9
msgid "JSON form data"
msgstr ""
#: apps/schedule/models.py:30
msgid "schedules"
#: apps/schedule/forms.py:9
msgid "The RAW JSON data of the saved form"
msgstr ""
#: apps/schedule/models.py:64
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/forms.py:10 apps/schedule/models.py:84
#: apps/schedule/templates/schedule/schedule_list.html:16
msgid "Status"
msgstr ""
#: apps/schedule/models.py:77
#: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "The status of this schedule."
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
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"
msgstr ""
#: apps/schedule/models.py:79
#: apps/schedule/models.py:86
msgid "The schedule input in JSON format based on the form data"
msgstr ""
#: apps/schedule/models.py:81
#: apps/schedule/models.py:88
msgid "Peregrine JSON output"
msgstr ""
#: apps/schedule/models.py:81
#: apps/schedule/models.py:88
msgid "The results from the Peregrine job in JSON"
msgstr ""
#: apps/schedule/models.py:83
#: apps/schedule/models.py:90
msgid "Peregrine binary output"
msgstr ""
#: apps/schedule/models.py:83
#: apps/schedule/models.py:90
msgid "This is the output in binary format from the Peregrine cluster"
msgstr ""
#: apps/schedule/models.py:85
#: apps/schedule/models.py:92
msgid "Report is send to user"
msgstr ""
#: apps/schedule/models.py:85
#: apps/schedule/models.py:92
msgid "The date and time when the report has sended to the user."
msgstr ""
#: apps/schedule/models.py:87
#: apps/schedule/models.py:94
msgid "Peregrine logging"
msgstr ""
#: apps/schedule/models.py:87
#: apps/schedule/models.py:94
msgid "Here you can see the logging of the Peregrine job."
msgstr ""
@ -170,16 +182,41 @@ msgstr ""
msgid "Actions"
msgstr ""
#: apps/schedule/templates/schedule/schedule_list.html:33
msgid "Resume"
msgstr ""
#: apps/schedule/templates/schedule/schedule_list.html:35
msgid "Clone"
msgstr ""
#: apps/schedule/templates/schedule/schedule_list.html:41
msgid "No schedules available"
msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:5
#: apps/schedule/templates/schedule/schedule_new.html:6
#: apps/schedule/templates/schedule/schedule_new.html:7
#: 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"
msgstr ""
#: apps/schedule/templates/schedule/schedule_new.html:5
#: apps/schedule/templates/schedule/schedule_new.html:6
#: apps/schedule/templates/schedule/schedule_new.html:11
#: apps/schedule/templates/schedule/schedule_new.html:20
msgid "New schedule"
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 ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-19 14:11+0000\n"
"PO-Revision-Date: 2020-05-19 12:07+0200\n"
"POT-Creation-Date: 2020-06-08 13:43+0200\n"
"PO-Revision-Date: 2020-06-08 13:44+0200\n"
"Last-Translator: Joshua Rubingh <j.g.rubingh@rug.nl>\n"
"Language-Team: \n"
"Language: nl\n"
@ -18,7 +18,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\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"
msgstr "Klaar"
@ -38,115 +38,125 @@ msgstr "Afdelingsnaam"
msgid "Enter a descriptive name for this schedule"
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"
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"
msgstr ""
"Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd"
msgstr "Als de klus geklaard is, worden de resultaten naar dit e-mailadres gestuurd"
#: apps/schedule/models.py:29
msgid "schedule"
msgstr "rooster"
#: apps/schedule/forms.py:9
msgid "JSON form data"
msgstr "JSON formulier data"
#: apps/schedule/models.py:30
msgid "schedules"
msgstr "roosters"
#: apps/schedule/forms.py:9
msgid "The RAW JSON data of the saved form"
msgstr "De rauwe JSON data van het opgeslagen formulier"
#: apps/schedule/models.py:64
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/forms.py:10 apps/schedule/models.py:84
#: apps/schedule/templates/schedule/schedule_list.html:16
msgid "Status"
msgstr "Status"
#: apps/schedule/models.py:77
#: apps/schedule/forms.py:10 apps/schedule/models.py:84
msgid "The status of this schedule."
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
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"
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"
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"
msgstr "Peregrine JSON uitvoer"
#: apps/schedule/models.py:81
#: apps/schedule/models.py:88
msgid "The results from the Peregrine job 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"
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"
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"
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."
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"
msgstr "Peregrine log"
#: apps/schedule/models.py:87
#: apps/schedule/models.py:94
msgid "Here you can see the logging of the Peregrine job."
msgstr "Hier kunt u de logfile van de Peregrine opdracht zien."
@ -172,31 +182,53 @@ msgstr "Rapport"
msgid "Actions"
msgstr "Acties"
#: apps/schedule/templates/schedule/schedule_list.html:33
msgid "Resume"
msgstr "Hervat"
#: apps/schedule/templates/schedule/schedule_list.html:35
msgid "Clone"
msgstr "Dupliceer"
#: apps/schedule/templates/schedule/schedule_list.html:41
msgid "No schedules available"
msgstr "Geen roosters beschikbaar"
#: apps/schedule/templates/schedule/schedule_new.html:5
#: apps/schedule/templates/schedule/schedule_new.html:6
#: apps/schedule/templates/schedule/schedule_new.html:7
#: 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"
msgstr "Dupliceer rooster"
#: apps/schedule/templates/schedule/schedule_new.html:5
#: apps/schedule/templates/schedule/schedule_new.html:6
#: apps/schedule/templates/schedule/schedule_new.html:11
#: apps/schedule/templates/schedule/schedule_new.html:20
msgid "New schedule"
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"
#~ msgstr "Bezig"
#~ msgid "Peregrine input"
#~ msgstr "Peregrine invoer"
#~ msgid ""
#~ "This is the translated content from the source for use with Peregrine "
#~ "cluster"
#~ msgstr ""
#~ "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#~ msgid "This is the translated content from the source for use with Peregrine cluster"
#~ msgstr "Dit is de vertaalde inhoud van de bron voor gebruik met Peregrine-cluster"
#~ msgid "Peregrine accepted"
#~ 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

@ -23,6 +23,8 @@ class Schedule(MetaDataModel):
The email address where the results should be sent to. Max length is 100 characters.
status : ScheduleStatus
The status of the schedule.
planning_source : JSON
The complete schedule stored in JSON data object.
"""
class Meta:
@ -32,6 +34,10 @@ class Schedule(MetaDataModel):
class ScheduleStatus(models.TextChoices):
"""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
The schedule is just created and waiting to be picked up by the Peregrine scripts.
@ -61,6 +67,7 @@ class Schedule(MetaDataModel):
Something when wrong on Peregrine. Look at the logging output of the Peregrine job
"""
DRAFT = 'draft', _('Draft')
NEW = 'new', _('New')
ACCEPTED = 'accepted', _('Accepted')
PROCESSING = 'processing', _('Processing')

View File

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

View File

@ -2,12 +2,36 @@
{% load i18n %}
{% load static %}
{% block title %}{% if form.json.value %}{% trans "Clone schedule" %}{% else %}{% trans "New schedule" %}{% endif %}{% endblock %}
{% block pagetitle %}{% if form.json.value %}{% trans "Clone schedule" %}{% else %}{% trans "New schedule" %}{% endif %}{% endblock %}
{% block title %}
{% 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 %}
{% 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 %}
{{ form.json }}
{{ form.status }}
<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>
<table>
@ -23,7 +47,6 @@
<small id="afdelingnaamHelp" class="form-text text-muted">Geef de naam op van de afdeling</small>
</td>
</tr>
<tr>
<th>
<label for="id_email">Emailadres voor de resultaten</label>
@ -35,7 +58,6 @@
<small id="emailadresHelp" class="form-text text-muted">Geef het emailadres op om de uitkomsten te ontvangen</small>
</td>
</tr>
<tr>
<th>
<label for="patienten">Aantal patiënten dat kan wachten in wachtkamer</label>
@ -49,16 +71,13 @@
</tr>
</tbody>
</table>
<br />
<hr>
<br />
<h1>Specialisaties binnen de afdeling</h1>
<div class="poliekliniek_specialisatie">
<table>
<tbody>
<tr>
<th>
<label for="specialisatie_0" class="h4">Specialisatie 1</label>
@ -70,7 +89,6 @@
<small id="specialisatie_0Help" class="form-text text-muted" style="float:right;display:none"><a href="#">Verwijder</a></small>
</td>
</tr>
<tr>
<th>
<label for="specialisatie_afkorting_0">Specialisatie afkorting</label>
@ -82,19 +100,6 @@
<small id="specialisatie_0Help" class="form-text text-muted">Geef een afkorting op voor deze specialisatie. Deze gebruiken wij in de figuren van de rapportage.</small>
</td>
</tr>
<tr>
<th>
<label for="specialisatie_aantal_artsen_0">Aantal artsen</label>
</th>
</tr>
<tr>
<td>
<input type="number" class="form-control" min="1" max="100" id="specialisatie_aantal_artsen_0" name="specialisatie_aantal_artsen_0" aria-describedby="specialisatie_aantal_artsen_0Help" required>
<small id="specialisatie_aantal_artsen_0Help" class="form-text text-muted">Maximaal aantal artsen dat op enig moment tegelijk aan het werk zou kunnen zijn.</small>
</td>
</tr>
<tr>
<th>
<label for="specialisatie_aantal_kamers_0">Aantal behandelkamers</label>
@ -106,6 +111,18 @@
<small id="specialisatie_aantal_kamers_0Help" class="form-text text-muted">Aantal behandelkamers dat beschikbaar is per specialisatie</small>
</td>
</tr>
<tr>
<th>
<label for="specialisatie_aantal_artsen_0">Aantal artsen</label>
</th>
</tr>
<tr>
<td>
<input type="number" class="form-control" min="1" max="100" id="specialisatie_aantal_artsen_0" name="specialisatie_aantal_artsen_0" aria-describedby="specialisatie_aantal_artsen_0Help" required>
<small id="specialisatie_aantal_artsen_0Help" class="form-text text-muted">Maximaal aantal artsen dat op enig moment tegelijk aan het werk kan zijn (dit kan niet meer zijn dan het aantal behandelkamers).<br /><strong>Let op</strong>: dit gaat om fulltime artsen, twee 50% parttime artsen moet worden ingevuld als één arts.</small>
<br /><br />
</td>
</tr>
<tr>
<th>
<label>Werktijden <small class="text-danger" style="display:none"> Nog niet volledig</small></label>
@ -179,7 +196,6 @@
</select>
</td>
</tr>
<tr>
<th>ochtendpauze</th>
<td>
@ -214,7 +230,6 @@
</select>
</td>
</tr>
<tr>
<th>lunchpauze</th>
<td>
@ -252,7 +267,6 @@
</select>
</td>
</tr>
<tr>
<th>middagpauze</th>
<td>
@ -265,19 +279,15 @@
<option value="1515">15:15</option>
<option value="1530">15:30</option>
<option value="1545">15:45</option>
<option value="1600">16:00</option>
<option value="1615">16:15</option>
<option value="1630">16:30</option>
<option value="1645">16:45</option>
<option value="1700">17:00</option>
<option value="1715">17:15</option>
<option value="1730">17:30</option>
<option value="1745">17:45</option>
<option value="1800">18:00</option>
</select>
</td>
<td>
@ -289,51 +299,38 @@
<option value="1515">15:15</option>
<option value="1530">15:30</option>
<option value="1545">15:45</option>
<option value="1600">16:00</option>
<option value="1615">16:15</option>
<option value="1630">16:30</option>
<option value="1645">16:45</option>
<option value="1700">17:00</option>
<option value="1715">17:15</option>
<option value="1730">17:30</option>
<option value="1745">17:45</option>
<option value="1800">18:00</option>
<option value="1815">18:15</option>
<option value="1830">18:30</option>
<option value="1845">18:45</option>
<option value="1900">19:00</option>
</select>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div style="text-align: center; width: 100%; margin-top: 15px"><a href="#" class="add_specialisatie">klik hier om een extra specialisatie toe te voegen</a></div>
<br />
<hr>
<br />
<h1>Behandelingen</h1>
<p>In het model worden slots van 5 minuten gebruikt voor het bepalen van starttijden. etc. Afspraken starten daarmee om bijv. 10.00, 10.05, 10.10.<br />Afspraakduur wordt daarmee ook in veelvouden van 5 minuten gevraagd.</p>
<p>Zowel afspraketabel_behandelingenn waar de patiënt fysiek in het ziekenhuis is, als wel telefoongesprekken worden hier gevraagd. Beide type afspraken kunnen in het raster worden gepland.</p>
<p>Normaal aantal: Geef hier het aantal afspraken op dat van dit type <strong style="text-decoration: underline">per dag</strong> gebruikelijk was, voordat COVID-19 begon.<br />
Gewenst als op 30%: Geef hier het aantal afspraken <strong style="text-decoration: underline">per dag</strong> op dat u zou willen hebben als de afdeling maar op 30% van de normale capaciteit zou kunnen draaien.</p>
<p>Zowel afspraken waar de patiënt fysiek in het ziekenhuis is, als wel telefoongesprekken worden hier gevraagd. Beide type afspraken kunnen in het raster worden gepland.</p>
<p>Normaal aantal: Geef hier het aantal afspraken op dat van dit type <strong style="text-decoration: underline">per dag</strong> gebruikelijk was, voordat COVID-19 begon.<br />Gewenst als op 30%: Geef hier het aantal afspraken <strong style="text-decoration: underline">per dag</strong> op dat u zou willen hebben als de afdeling maar op 30% van de normale capaciteit zou kunnen draaien.</p>
<table id="tabel_behandelingen">
<thead>
<tr>
@ -368,6 +365,11 @@
<option value="80">80</option>
<option value="85">85</option>
<option value="90">90</option>
<option value="120">120</option>
<option value="150">150</option>
<option value="180">180</option>
<option value="210">210</option>
<option value="240">240</option>
</select>
</td>
<td>
@ -379,11 +381,9 @@
<option value="phone">telefonisch</option>
</select>
</td>
<td>
<input type="number" class="form-control behandeling_calc" id="behandeling_100p_0" name="behandeling_100p_0" min="0" max="100" required>
</td>
<td>
<input type="number" class="form-control behandeling_calc" id="behandeling_30p_0" name="behandeling_30p_0" min="0" max="100" required>
<small style="float:right;"><a href="#">Verwijder</a></small>
@ -391,9 +391,7 @@
</tr>
</tbody>
</table>
<div style="text-align: center; width: 100%; margin-top: 15px"><a href="#" class="add_behandeling">klik hier om een nieuwe behandeling toe te voegen</a></div>
<table>
<tbody>
<tr class="behandeling_calc_summary">
@ -401,51 +399,40 @@
<td style="text-align: center">0</td>
<td style="text-align: center">0</td>
</tr>
<tr>
<td colspan="3">
<div class="behandeling_calc_remarks"></div>
</td>
</tr>
<tr>
<td colspan="3" class="behandeling_calc_time">
</td>
<td colspan="3" class="behandeling_calc_time"></td>
</tr>
</tbody>
</table>
<br />
<hr>
<br />
<table>
<tr>
<td><input type="checkbox" value="1" name="privacy_verklaring" required > </td>
<td>Met het verzenden van dit formulier gaat u akkoord met de <a href="https://www.rug.nl/about-us/organization/rules-and-regulations/algemeen/20180423-algemeen-privacyverklaring-rug.pdf" target="_blank" title="RUG Privacyverklaring">privacyverklaring</a> van de Rijksuniversiteit Groningen.</td>
</tr>
<tr>
<td><input type="checkbox" value="1" name="rug_vrijwaring" required > </td>
<td>De Rijksuniversiteit Groningen (RUG) biedt geen garantie terzake van de juistheid of de bruikbaarheid van het door haar ontwikkelde model en aanverwante documenten. De afnemer/gebruiker vrijwaart de RUG voor aanspraken van derden die jegens RUG mochten worden gedaan naar aanleiding van schades, voortvloeiend uit het gebruik of de toepassing van het model en aanverwante documenten. Alle rechten, waaronder de intellectuele eigendomsrechten, op het model en bijbehorende documenten, blijven te allen tijde voorbehouden aan de RUG.</td>
</tr>
<tr>
<td><input type="checkbox" value="1" name="data_verwerking" required > </td>
<td>De gebruiker geeft de RUG toestemming om de ingevoerde data te verwerken in het kader van wetenschappelijk onderzoek en in het kader van het verbeteren van haar tools. De RUG zal over het onderzoek mogen publiceren, ook in andere vormen dan genoemde eindrapportage. De data kunnen in geanonimiseerde vorm in de publicaties worden opgenomen.</td>
</tr>
</table>
<br />
<hr>
<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>
<script type="text/javascript">
function addSpecialisatie() {
var clone = jQuery('div.poliekliniek_specialisatie:first').clone()
@ -496,6 +483,11 @@
jQuery('input[name^="specialisatie_aantal_artsen_"]').off('change keyup').on('change keyup',function(){
calculateBehandelingen();
validate_doctors_vs_rooms();
});
jQuery('input[name^="specialisatie_aantal_kamers_"]').off('change keyup').on('change keyup',function(){
validate_doctors_vs_rooms();
});
jQuery('div.werktijden select').off('change').on('change',function(event){
@ -566,6 +558,7 @@
}
function calculateBehandelingen() {
const max_limit = 0.4; // Max 40% van het maximum
let total = 0, percentage = 0;
let error = false;
let show_message = false;
@ -591,13 +584,13 @@
let calc_message = '';
let class_message = '';
if (percentage > (total * 0.3)) {
calc_message = 'U heeft ' + Math.ceil(percentage - (total * 0.3)) + ' teveel afspraken geselecteerd voor het 30% scenario';
if (percentage > (total * max_limit)) {
calc_message = 'U heeft ' + Math.ceil(percentage - (total * max_limit)) + ' afspraken teveel geselecteerd voor het 30% scenario';
class_message = 'alert-danger';
error = true;
} else if ((total * 0.3) - percentage >= 1) {
calc_message = 'U kunt nog '+ Math.floor((total * 0.3) - percentage) +' afspraken toevoegen voor het 30% scenario';
class_message = 'alert-warning';
} else if ((total * max_limit) - percentage >= 1) {
//calc_message = 'U kunt nog '+ Math.floor((total * max_limit - percentage) +' afspraken toevoegen voor het 30% scenario';
//class_message = 'alert-warning';
} else {
calc_message = 'Dit klopt precies';
class_message = 'alert-success';
@ -608,7 +601,6 @@
jQuery('div.behandeling_calc_remarks').addClass(class_message).text(calc_message);
}
validate_behandeling_hours();
return !error;
@ -686,6 +678,19 @@
updateBehandelingen();
}
function validate_doctors_vs_rooms() {
//let behandelingen = {};
jQuery('div.poliekliniek_specialisatie').each(function(index,element){
element = jQuery(element);
let amount_of_doctors = element.find('input[name^="specialisatie_aantal_artsen_"]').val() * 1;
let amount_of_rooms = element.find('input[name^="specialisatie_aantal_kamers_"]').val() * 1;
// Use HTML5 validators from the browser and chage the max value based on the amount of rooms available
element.find('input[name^="specialisatie_aantal_artsen_"]').prop('max',amount_of_rooms);
});
}
function validate_behandeling_hours() {
let behandelingen = {};
jQuery('div.poliekliniek_specialisatie').each(function(index,element){
@ -1052,12 +1057,25 @@
jQuery('input[name^="specialisatie_aantal_artsen_"]').off('change keyup').on('change keyup',function(){
calculateBehandelingen();
validate_doctors_vs_rooms();
});
jQuery('input[name^="specialisatie_aantal_kamers_"]').off('change keyup').on('change keyup',function(){
validate_doctors_vs_rooms();
});
jQuery('tr.behandeling :input').off('change keyup').on('change keyup',function(event){
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){
if (validate_working_hours() &&
calculateBehandelingen() &&
@ -1066,8 +1084,18 @@
let formdata = new FormData(this);
formdata.delete('csrfmiddlewaretoken');
formdata.delete('json');
formdata.delete('status');
jQuery('input#id_json').val(JSON.stringify(Object.fromEntries(formdata)));
// Display the key/value pairs. This is needed to support stupid IE. Mici$oft is still having hardtime playing nice :(
let json_data = {};
var formDataEntries = formdata.entries(), formDataEntry = formDataEntries.next(), pair;
while (!formDataEntry.done) {
pair = formDataEntry.value;
json_data[pair[0]] = pair[1];
formDataEntry = formDataEntries.next();
}
jQuery('input#id_json').val(JSON.stringify(json_data));
return true;
} else {
alert('Er zijn wat problemen met het formulier. Controleer de invoer velden');

View File

@ -6,7 +6,6 @@ app_name = 'schedule'
urlpatterns = [
path('', views.ScheduleListView.as_view(), name='list'),
path('new', views.new_or_update_schedule, name='new'),
#path('<int:pk>', views.ScheduleDetailView.as_view(), name='detail'),
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

@ -12,6 +12,13 @@ import json
# Create your views here.
class ScheduleListView(LoginRequiredMixin,ListView):
"""
This view will give a list of all entered schedules. The list is filtered on the logged in employee.
Only the schedules owned by the logged in user are shown.
The results are shown with 10 items per page. A pager will be shown when there are more then 10 schedules
"""
model = Schedule
paginate_by = 10
@ -21,41 +28,81 @@ class ScheduleListView(LoginRequiredMixin,ListView):
@login_required
def new_or_update_schedule(request, schedule_id = None):
"""
This view will create or update an existing schedule. At the moment there is not a real update, but a clone functionality.
So every schedule that is updated will be stored as a new schedule.
Only schedules owned by the logged in user can be loaded here and can be cloned.
The data of the form is stored as a JSON object in a single database field for more flexibility.
Arguments:
request HttpRequest -- This is the HTTP request from the Django framework. This will hold the current logged in user info.
Keyword Arguments:
schedule_id Schedule -- This is the schedule to be edited. When none, a new schedule will be created (default: {None})
Returns:
A view with an empty form to create a new schedule or a prefilled form for cloning.
"""
template_name = 'schedule/schedule_new.html'
schedule = None
if schedule_id is not None:
try:
schedule = Schedule.objects.get(pk=schedule_id)
# 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:
# Schedule does not exist, or you do not own the schedule you try to load. Stop playing around on the url bar ;)
pass
if request.method == 'POST':
# Load the form data
schedule_form = ScheduleForm(request.POST)
# Check if minimal input fields are correct
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:
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:
new_schedule.planning_source = json.loads(json.dumps({'error': str(ex)}))
new_schedule.status = Schedule.ScheduleStatus.INVALID
# Something when wrong. The error is saved instead, and can be read out in the admin area
schedule.planning_source = json.loads(json.dumps({'error': str(ex)}))
schedule.status = Schedule.ScheduleStatus.INVALID
new_schedule.employee = request.user.employee
new_schedule.name = schedule_form.cleaned_data['name']
new_schedule.email = schedule_form.cleaned_data['email']
new_schedule.save()
# Make sure that the logged in user that is creating the schedule does become the owner
schedule.employee = request.user.employee
# Store name of the schedule
schedule.name = schedule_form.cleaned_data['name']
# 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')
else:
# We start with a new form. Either new of clone/edit
status = 'new'
json_form = ''
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, {
'form' : schedule_form,
})

View File

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

View File

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

View File

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

View File

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

View File

@ -128,7 +128,7 @@ LANGUAGE_CODE = 'nl'
LANGUAGES = [
('nl', _('Dutch')),
('en', _('English')),
# ('en', _('English')),
]
TIME_ZONE = config('TIME_ZONE', default='UTC')