]> git.parisson.com Git - teleforma.git/commitdiff
allow teacher / admins / correctors to set custom recipient
authorYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 11 May 2020 16:21:42 +0000 (18:21 +0200)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Mon, 11 May 2020 16:21:42 +0000 (18:21 +0200)
teleforma/templates/postman/base_write.html

index 41395ddde1f2566a68798c77a5f89438fc8d8fc9..f6961c8e2cc80b1c8d83fb0b01436eca1119f026 100644 (file)
                 <input type="radio" id="recipient_category-corrector" name="recipient_category" value="corrector" {% if request.POST.recipient_category == 'corrector' %}checked="checked"{% endif %}/><label
                     for="recipient_category-corrector">A un correcteur</label>
 
+                {% if not user.student.all %}
+                    <input type="radio" id="recipient_category-other" name="recipient_category" value="other" {% if request.POST.recipient_category == 'other' %}checked="checked"{% endif %}/><label
+                        for="recipient_category-other">A un étudiant</label>
+                {% endif %}
+
 
                 <div id="category-admin">
                     <select id="_adminSelect" name="admins">
             $('#category-admin').hide();
             $('#category-prof').hide();
             $('#category-corrector').hide();
+            $("#id_recipients").parent().parent().hide();
             if (recipientCategory == 'admin')
                 $('#category-admin').show();
             else if (recipientCategory == 'prof')
                 $('#category-prof').show();
             else if (recipientCategory == 'corrector')
                 $('#category-corrector').show();
+            else if (recipientCategory == 'other')
+                $("#id_recipients").parent().parent().show();
 
             var course = parseInt($('[name="course"]').val(), 10);
             if(!course)
                 $('#_professorSelect').show();
 
             var correctorCourse = parseInt($('[name="corrector_course"]').val(), 10);
-            console.log(correctorCourse)
             if(!correctorCourse)
                 $('#_correctorSelect').hide();
             else
         // hide recipients fields
 
         {#$('#id_course').parent().parent().hide();#}
-        $("#id_recipients").parent().parent().hide();
 
         $('[name="recipient_category"]').bind('change', update_desk_messages);
         $('[name="course"], [name="corrector_course"]').bind('change', update_desk_messages);