<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);