Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SCODOC_R6A06
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jean-Marie Place
SCODOC_R6A06
Commits
55e7527e
Commit
55e7527e
authored
3 months ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Plain Diff
Merge branch 'jmplace-t1054'
parents
094edc62
9895bfec
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/scodoc/sco_saisie_notes.py
+1
-1
1 addition, 1 deletion
app/scodoc/sco_saisie_notes.py
app/static/js/saisie_notes.js
+27
-5
27 additions, 5 deletions
app/static/js/saisie_notes.js
with
28 additions
and
6 deletions
app/scodoc/sco_saisie_notes.py
+
1
−
1
View file @
55e7527e
...
...
@@ -1009,7 +1009,7 @@ def _form_saisie_notes(
H
.
append
(
f
"""
<a href=
"
{
url_for
(
"
notes.moduleimpl_status
"
,
scodoc_dept
=
g
.
scodoc_dept
,
moduleimpl_id
=
modimpl
.
id
)
}
"
class=
"
btn btn-primary
"
>Terminer</a>
}
"
class=
"
btn btn-primary
link-terminer
"
>Terminer</a>
"""
)
if
tf
.
canceled
():
...
...
This diff is collapsed.
Click to expand it.
app/static/js/saisie_notes.js
+
27
−
5
View file @
55e7527e
// Formulaire saisie des notes
let
nbSaving
=
0
;
// nombre de requêtes en cours
function
incSaving
()
{
nbSaving
++
;
// disable button 'Terminer'
let
anchor
=
document
.
querySelector
(
"
.link-terminer
"
)
anchor
.
style
.
pointerEvents
=
"
none
"
;
anchor
.
style
.
color
=
"
gray
"
;
anchor
.
style
.
textDecoration
=
"
none
"
;
anchor
.
style
.
cursor
=
"
not-allowed
"
;
}
function
decSaving
()
{
nbSaving
--
;
if
(
nbSaving
<=
0
)
{
// re-enable bouton 'Terminer'
let
anchor
=
document
.
querySelector
(
"
.link-terminer
"
);
anchor
.
style
.
pointerEvents
=
"
unset
"
;
anchor
.
style
.
color
=
"
unset
"
;
anchor
.
style
.
textDecoration
=
"
unset
"
;
anchor
.
style
.
cursor
=
"
unset
"
;
}
}
document
.
addEventListener
(
"
DOMContentLoaded
"
,
function
()
{
let
noteInputs
=
document
.
querySelectorAll
(
"
#formnotes .note
"
);
noteInputs
.
forEach
(
function
(
input
)
{
...
...
@@ -54,15 +78,13 @@ function valid_note(e) {
}
}
let
isSaving
=
false
;
// true si requête en cours
async
function
save_note
(
elem
,
v
,
etudid
)
{
let
evaluation_id
=
document
.
querySelector
(
"
#formnotes_evaluation_id
"
).
getAttribute
(
"
value
"
);
let
formsemestre_id
=
document
.
querySelector
(
"
#formnotes_formsemestre_id
"
).
getAttribute
(
"
value
"
);
var
scoMsg
=
document
.
getElementById
(
"
sco_msg
"
);
scoMsg
.
innerHTML
=
"
en cours...
"
;
scoMsg
.
style
.
display
=
"
block
"
;
i
s
Saving
=
true
;
// Set the flag to true when the request start
s
i
nc
Saving
();
// update counter to show one more saving in progres
s
try
{
const
response
=
await
fetch
(
SCO_URL
+
"
../api/evaluation/
"
+
evaluation_id
+
"
/notes/set
"
,
...
...
@@ -109,7 +131,7 @@ async function save_note(elem, v, etudid) {
console
.
error
(
"
Fetch error:
"
,
error
);
sco_message
(
"
Erreur réseau: valeur non enregistrée
"
);
}
finally
{
is
Saving
=
false
;
// Reset the flag when the request is complete
dec
Saving
();
// update counter to show one saving in progress less. May re-enable 'Terminer' button
}
}
...
...
@@ -121,7 +143,7 @@ window.addEventListener('beforeunload', function (e) {
valid_note
.
call
(
input
);
}
});
if
(
is
Saving
)
{
if
(
nb
Saving
>
0
)
{
// Display a confirmation dialog
const
confirmationMessage
=
'
Des modifications sont en cours de sauvegarde. Êtes-vous sûr de vouloir quitter cette page ?
'
;
e
.
preventDefault
();
// Standard for most modern browsers
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment