forked from ScoDoc/ScoDoc
WIP: Edition formations
This commit is contained in:
parent
e3219a6b0c
commit
b2c98af293
@ -1,8 +1,5 @@
|
||||
/* table_editor, par Sébastien L.
|
||||
*/
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
/***************************/
|
||||
/* Le tableau */
|
||||
|
@ -29,7 +29,7 @@
|
||||
{% if editable %}
|
||||
<div><a href="{{
|
||||
url_for('notes.formation_edit', scodoc_dept=g.scodoc_dept,
|
||||
formation_id=formation_id)
|
||||
formation_id=formation.id)
|
||||
}}" class="stdlink">modifier ces informations</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@ -1,9 +1,10 @@
|
||||
<form onchange="change_semestre()">Semestre:
|
||||
<select name="semestre_idx" id="semestre_idx">
|
||||
<form>Semestre:
|
||||
<select onchange="this.form.submit()"" name="semestre_idx" id="semestre_idx">
|
||||
{% for i in semestre_ids %}
|
||||
<option value="{{i}}" {%if semestre_idx==i%}selected{%endif%}>{{i}}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="hidden" name="formation_id" value="{{formation.id}}"></input>
|
||||
<span><a class="stdlink" href="{{
|
||||
url_for('notes.ue_table', scodoc_dept=g.scodoc_dept,
|
||||
formation_id=formation.id, semestre_idx=semestre_idx)
|
||||
@ -19,16 +20,9 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function change_semestre() {
|
||||
let semestre_idx = $("#semestre_idx")[0].value;
|
||||
let url = window.location.href.replace(/\/[\-0-9]*$/, "/" + semestre_idx);
|
||||
window.location.href = url;
|
||||
};
|
||||
|
||||
|
||||
$(function () {
|
||||
let semestre_idx = $("#semestre_idx")[0].value;
|
||||
if (semestre_idx > -10) {
|
||||
if (semestre_idx >= 0) {
|
||||
let base_url = "{{data_source}}";
|
||||
let data_url = base_url.replace(/\/[\-0-9]*$/, "/" + semestre_idx);
|
||||
console.log("data_url=", data_url);
|
||||
|
@ -151,12 +151,13 @@ def set_module_ue_coef():
|
||||
return scu.json_error("ok", success=True, status=201)
|
||||
|
||||
|
||||
@bp.route("/edit_modules_ue_coefs/<formation_id>", defaults={"semestre_idx": -100})
|
||||
@bp.route("/edit_modules_ue_coefs/<formation_id>/<semestre_idx>")
|
||||
@bp.route("/edit_modules_ue_coefs")
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoChangeFormation)
|
||||
def edit_modules_ue_coefs(formation_id, semestre_idx=None):
|
||||
def edit_modules_ue_coefs(semestre_idx=None):
|
||||
"""Formulaire édition grille coefs EU/modules"""
|
||||
formation_id = int(request.args["formation_id"])
|
||||
semestre_idx = int(request.args.get("semestre_idx", -1))
|
||||
formation = models.Formation.query.filter_by(
|
||||
formation_id=formation_id
|
||||
).first_or_404()
|
||||
@ -185,13 +186,13 @@ def edit_modules_ue_coefs(formation_id, semestre_idx=None):
|
||||
"notes.table_modules_ue_coefs",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
formation_id=formation_id,
|
||||
semestre_idx=semestre_idx or "",
|
||||
semestre_idx=semestre_idx,
|
||||
),
|
||||
data_save=url_for(
|
||||
"notes.set_module_ue_coef",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
),
|
||||
semestre_idx=int(semestre_idx),
|
||||
semestre_idx=semestre_idx,
|
||||
semestre_ids=range(1, formation.get_parcours().NB_SEM + 1),
|
||||
),
|
||||
html_sco_header.sco_footer(),
|
||||
|
Loading…
Reference in New Issue
Block a user