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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rayane Belguebli
SCODOC_R6A06
Commits
c9a47edb
Commit
c9a47edb
authored
2 months ago
by
Rayane Belguebli
Browse files
Options
Downloads
Patches
Plain Diff
ajout filtrage par semestre avec une colonne code, type, nom
parent
403cfd4b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/scodoc/sco_formsemestre_status.py
+27
-26
27 additions, 26 deletions
app/scodoc/sco_formsemestre_status.py
with
27 additions
and
26 deletions
app/scodoc/sco_formsemestre_status.py
+
27
−
26
View file @
c9a47edb
...
@@ -891,12 +891,6 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str:
...
@@ -891,12 +891,6 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str:
edit_partition
=
1
)
edit_partition
=
1
)
}
"
>Ajouter une partition</a>
"""
}
"
>Ajouter une partition</a>
"""
)
)
autres_liens
.
append
(
f
"""
<a class=
"
stdlink
"
title=
"
BLABLABLA.
"
href=
"
https://moodle.univ-lille.fr/
"
>Test ajout lien</a>
"""
)
# --- Formulaire importation Assiduité excel (si autorisé)
# --- Formulaire importation Assiduité excel (si autorisé)
...
@@ -1056,34 +1050,35 @@ def formsemestre_status_head(formsemestre_id: int = None, page_title: str = None
...
@@ -1056,34 +1050,35 @@ def formsemestre_status_head(formsemestre_id: int = None, page_title: str = None
return
""
.
join
(
H
)
return
""
.
join
(
H
)
queries
=
[
(
text
(
"
SELECT elt_sem_apo, titre FROM notes_formsemestre WHERE elt_sem_apo IS NOT NULL
"
),
"
SEMESTRE
"
),
(
text
(
"
SELECT elt_annee_apo, titre FROM notes_formsemestre WHERE elt_annee_apo IS NOT NULL
"
),
"
ANNEE
"
),
(
text
(
"
SELECT elt_passage_apo, titre FROM notes_formsemestre WHERE elt_passage_apo IS NOT NULL
"
),
"
PASSAGE
"
),
#(text("SELECT etape_apo FROM notes_formsemestre_etapes WHERE etape_apo IS NOT NULL"), "ETAPES"),
(
text
(
"
SELECT code_apogee, titre FROM notes_modules WHERE code_apogee IS NOT NULL
"
),
"
MODULE
"
),
#(text("SELECT code_apogee FROM notes_moduleimpl WHERE code_apogee IS NOT NULL"), "MODULE IMP"),
(
text
(
"
SELECT code_apogee, titre FROM notes_ue WHERE code_apogee IS NOT NULL
"
),
"
UE
"
),
(
text
(
"
SELECT code_apogee_rcue, titre FROM notes_ue WHERE code_apogee_rcue IS NOT NULL
"
),
"
UE
"
)
]
def
get_code_apo_results
():
def
get_code_apo_results
(
formsemestreID
):
queries
=
[
(
text
(
"
SELECT elt_sem_apo, titre FROM notes_formsemestre WHERE elt_sem_apo IS NOT NULL AND semestre_id = :semestre_id
"
),
"
SEMESTRE
"
),
(
text
(
"
SELECT elt_annee_apo, titre FROM notes_formsemestre WHERE elt_annee_apo IS NOT NULL AND semestre_id = :semestre_id
"
),
"
ANNEE
"
),
(
text
(
"
SELECT elt_passage_apo, titre FROM notes_formsemestre WHERE elt_passage_apo IS NOT NULL AND semestre_id = :semestre_id
"
),
"
PASSAGE
"
),
(
text
(
"
SELECT code_apogee, titre FROM notes_modules WHERE code_apogee IS NOT NULL AND semestre_id = :semestre_id
"
),
"
MODULE
"
),
(
text
(
"
SELECT code_apogee, titre FROM notes_ue WHERE code_apogee IS NOT NULL AND semestre_idx = :semestre_id
"
),
"
UE
"
),
]
results
=
[]
results
=
[]
for
query
,
table_name
in
queries
:
for
query
,
table_name
in
queries
:
result
=
db
.
session
.
execute
(
query
).
fetchall
()
result
=
db
.
session
.
execute
(
query
,
params
=
{
"
semestre_id
"
:
formsemestreID
}).
mappings
().
fetchall
()
results
.
append
((
table_name
,
result
))
results
.
append
((
table_name
,
[
dict
(
row
)
for
row
in
result
]))
return
results
return
results
def
generate_html_table
():
def
generate_html_table
(
formsemestre
):
results
=
get_code_apo_results
()
results
=
get_code_apo_results
(
formsemestre
.
semestre_id
)
html_content
=
"""
html_content
=
f
"""
<table>
<table>
<thead>
<thead>
<tr>
<tr>
<th>Code Apogée</th>
<th>Code Apogée</th>
<th>T
abl
e</th>
<th>T
yp
e</th>
<th>
Titre
</th>
<th>
Nom
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
...
@@ -1091,7 +1086,9 @@ def generate_html_table():
...
@@ -1091,7 +1086,9 @@ def generate_html_table():
for
table_name
,
rows
in
results
:
for
table_name
,
rows
in
results
:
for
row
in
rows
:
for
row
in
rows
:
code_apogee
,
titre
=
row
code_apogee
=
row
.
get
(
"
elt_sem_apo
"
)
or
row
.
get
(
"
elt_annee_apo
"
)
or
row
.
get
(
"
elt_passage_apo
"
)
or
row
.
get
(
"
code_apogee
"
)
titre
=
row
.
get
(
"
titre
"
)
html_content
+=
f
"""
html_content
+=
f
"""
<tr class=
"
formsemestre_status_ue
"
>
<tr class=
"
formsemestre_status_ue
"
>
<td>
{
code_apogee
}
</td>
<td>
{
code_apogee
}
</td>
...
@@ -1099,6 +1096,7 @@ def generate_html_table():
...
@@ -1099,6 +1096,7 @@ def generate_html_table():
<td>
{
titre
}
</td>
<td>
{
titre
}
</td>
</tr>
</tr>
"""
"""
html_content
+=
"""
html_content
+=
"""
</tbody>
</tbody>
</table>
</table>
...
@@ -1106,6 +1104,9 @@ def generate_html_table():
...
@@ -1106,6 +1104,9 @@ def generate_html_table():
return
html_content
return
html_content
def
formsemestre_status
(
formsemestre_id
=
None
,
check_parcours
=
True
):
def
formsemestre_status
(
formsemestre_id
=
None
,
check_parcours
=
True
):
"""
Tableau de bord semestre HTML
"""
"""
Tableau de bord semestre HTML
"""
...
@@ -1204,7 +1205,7 @@ def formsemestre_status(formsemestre_id=None, check_parcours=True):
...
@@ -1204,7 +1205,7 @@ def formsemestre_status(formsemestre_id=None, check_parcours=True):
</tr>
"""
,
</tr>
"""
,
formsemestre_tableau_modules
(
formsemestre_tableau_modules
(
saes
,
nt
,
formsemestre
,
can_edit
=
can_edit
,
show_ues
=
False
saes
,
nt
,
formsemestre
,
can_edit
=
can_edit
,
show_ues
=
False
),
generate_html_table
()
),
generate_html_table
(
formsemestre
)
]
]
if
autres
:
if
autres
:
H
+=
[
H
+=
[
...
...
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