Améliore édition groupe: message si pas partition non éditable

This commit is contained in:
Emmanuel Viennet 2022-12-15 09:28:09 -03:00
parent 362148e0bf
commit 41a4d25d6f
3 changed files with 61 additions and 58 deletions

View File

@ -1,4 +1,4 @@
// Affichage bulletin de notes
// Affichage anciens (non BUT) bulletin de notes
// (uses jQuery)
@ -10,41 +10,41 @@
//
// On change la visi de tous les <tr> jusqu'au notes_bulletin_row_ue suivant.
//
function toggle_vis_ue(e, new_state) {
// e is the span containg the clicked +/- icon
var tr = e.parentNode.parentNode;
if (new_state == undefined) {
// current state: use alt attribute of current image
if (e.childNodes[0].alt == '+') {
new_state=false;
} else {
new_state=true;
function toggle_vis_ue(e, new_state) {
// e is the span containg the clicked +/- icon
var tr = e.parentNode.parentNode;
if (new_state == undefined) {
// current state: use alt attribute of current image
if (e.childNodes[0].alt == '+') {
new_state = false;
} else {
new_state = true;
}
}
// find next tr in siblings
var tr = tr.nextSibling;
//while ((tr != null) && sibl.tagName == 'TR') {
var current = true;
while ((tr != null) && current) {
if ((tr.nodeType == 1) && (tr.tagName == 'TR')) {
for (var i = 0; i < tr.classList.length; i++) {
if ((tr.classList[i] == 'notes_bulletin_row_ue') || (tr.classList[i] == 'notes_bulletin_row_sum_ects'))
current = false;
}
if (current) {
if (new_state) {
tr.style.display = 'none';
} else {
tr.style.display = 'table-row';
}
}
}
tr = tr.nextSibling;
}
if (new_state) {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
} else {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
}
}
// find next tr in siblings
var tr = tr.nextSibling;
//while ((tr != null) && sibl.tagName == 'TR') {
var current = true;
while ((tr != null) && current) {
if ((tr.nodeType==1) && (tr.tagName == 'TR')) {
for (var i=0; i < tr.classList.length; i++) {
if ((tr.classList[i] == 'notes_bulletin_row_ue') || (tr.classList[i] == 'notes_bulletin_row_sum_ects'))
current = false;
}
if (current) {
if (new_state) {
tr.style.display = 'none';
} else {
tr.style.display = 'table-row';
}
}
}
tr = tr.nextSibling;
}
if (new_state) {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
} else {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
}
}

View File

@ -17,6 +17,7 @@ var groups = new Object(); // Liste des groupes
function loadGroupes() {
$("#gmsg")[0].innerHTML = 'Chargement des groupes en cours...';
$("#gmsg")[0].style.display = "block";
var partition_id = document.formGroup.partition_id.value;
$.get(SCO_URL + '/XMLgetGroupsInPartition', { partition_id: partition_id })
@ -36,6 +37,7 @@ function loadGroupes() {
}
}
$("#gmsg")[0].innerHTML = '';
$("#gmsg")[0].style.display = "none";
updateginfo();
}
)

View File

@ -1,39 +1,40 @@
{# -*- mode: jinja-html -*- #}
{# -*- mode: jinja-html -*- #}
{{ sco_header|safe }}
<h2 class="formsemestre">Affectation aux groupes de {{ partition.partition_name }}</h2>
<p>Faites glisser les étudiants d'un groupe à l'autre. Les modifications ne
sont enregistrées que lorsque vous cliquez sur le bouton "<em>Enregistrer ces groupes</em>".
Vous pouvez créer de nouveaux groupes. Pour <em>supprimer</em> ou <em>renommer</em>
un groupe, utiliser le menu en haut à droite de sa boite.
Vous pouvez aussi <a class="stdlink"
href="{{ url_for('scolar.groups_auto_repartition', scodoc_dept=g.scodoc_dept, partition_id=partition.id) }}"
>répartir automatiquement les groupes</a>.
<p>Faites glisser les étudiants d'un groupe à l'autre. Les modifications ne
sont enregistrées que lorsque vous cliquez sur le bouton "<em>Enregistrer ces groupes</em>".
Vous pouvez créer de nouveaux groupes. Pour <em>supprimer</em> ou <em>renommer</em>
un groupe, utiliser le menu en haut à droite de sa boite.
Vous pouvez aussi <a class="stdlink"
href="{{ url_for('scolar.groups_auto_repartition', scodoc_dept=g.scodoc_dept, partition_id=partition.id) }}">répartir
automatiquement les groupes</a>.
</p>
<div id="gmsg" class="head_message"></div>
{% if not partition.groups_editable %}
<div class="head_message">Les groupes de cette partition sont gérés automatiquement en fonction des parcours</div>
{% endif %}
<div id="ginfo"></div>
<div id="savedinfo"></div>
<form name="formGroup" id="formGroup" onSubmit="return false;">
<input type="hidden" name="partition_id" value="{{ partition.id }}"/>
<input type="hidden" name="partition_id" value="{{ partition.id }}" />
{% if partition.groups_editable %}
<input name="groupName" size="6"/>
<input type="button" onClick="createGroup();" value="Créer groupe"/>
<input name="groupName" size="6" />
<input type="button" onClick="createGroup();" value="Créer groupe" />
{% endif %}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" onClick="submitGroups( target='gmsg' );" value="Enregistrer ces groupes" />
<input type="button" onClick="submitGroups();" value="Enregistrer ces groupes" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button"
onClick="document.location = '{{ url_for( 'notes.formsemestre_status', scodoc_dept=g.scodoc_dept, formsemestre_id=formsemestre_id) }}'"
<input type="button"
onClick="document.location = '{{ url_for( 'notes.formsemestre_status', scodoc_dept=g.scodoc_dept, formsemestre_id=formsemestre_id) }}'"
value="Annuler" />&nbsp;&nbsp;&nbsp;&nbsp;Éditer groupes de
<select name="other_partition_id" onchange="GotoAnother();">
{% for p in partitions_list %}
<option value="{{ p.id }}" {{
"selected" if p.id == partition.id
}}>{{
p.partition_name
}}</option>
{% endfor %}
{% for p in partitions_list %}
<option value="{{ p.id }}" {{ "selected" if p.id==partition.id }}>{{
p.partition_name
}}</option>
{% endfor %}
</select>
</form>
@ -46,4 +47,4 @@ href="{{ url_for('scolar.groups_auto_repartition', scodoc_dept=g.scodoc_dept, pa
</div>
{{ sco_footer|safe }}
{{ sco_footer|safe }}