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
Paul Milleville
SCODOC_R6A06
Commits
1a5072a3
Commit
1a5072a3
authored
1 year ago
by
Emmanuel Viennet
Browse files
Options
Downloads
Patches
Plain Diff
user_board: accès depuis accueil général
parent
97eb1836
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/templates/base.j2
+11
-1
11 additions, 1 deletion
app/templates/base.j2
app/templates/user_board/user_board.j2
+5
-3
5 additions, 3 deletions
app/templates/user_board/user_board.j2
app/views/user_board.py
+8
-4
8 additions, 4 deletions
app/views/user_board.py
with
24 additions
and
8 deletions
app/templates/base.j2
+
11
−
1
View file @
1a5072a3
...
...
@@ -42,6 +42,15 @@
<li><a href="{{ url_for('entreprises.index') }}">Entreprises</a></li>
{% endif %}
</ul>
{% if not current_user.is_anonymous %}
<ul class="nav navbar-nav">
<li>
<a href="{{
url_for('scodoc.user_board', user_name=current_user.user_name)
}}">Tableau de bord</a>
</li>
</ul>
{% endif %}
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_anonymous %}
<li><a href="{{ url_for('auth.login') }}">connexion</a></li>
...
...
@@ -92,7 +101,8 @@
<script src="{{scu.STATIC_DIR}}/libjs/qtip/jquery.qtip-3.0.3.min.js"></script>
<script src="{{scu.STATIC_DIR}}/js/scodoc.js"></script>
<script>
const SCO_URL = "{{ url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)[:-11] }}";
const SCO_URL = "{% if g.scodoc_dept %}{{
url_for('scolar.index_html', scodoc_dept=g.scodoc_dept)[:-11] }}{% endif %}";
const SCO_TIMEZONE = "{{ scu.TIME_ZONE }}";
</script>
{% endblock %}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
app/templates/user_board/user_board.j2
+
5
−
3
View file @
1a5072a3
{# Tableau de bord utilisateur #}
{% extends "
sco_pag
e.j2" %}
{% extends "
bas
e.j2" %}
{% block app_content %}
<style>
...
...
@@ -63,10 +63,12 @@
</style>
<div class="tab-content">
<h2>
Votre tableau de bord,
{{user.get_nomcomplet()}}</h2>
<h2>{{user.get_nomcomplet()}}</h2>
{% for dept_id in formsemestres_by_dept %}
<h3>Modules dans le département {{ dept_names[dept_id] }}</h3>
<h3>Modules dans le <a class="stdlink" href="{{
url_for('scolar.index_html', scodoc_dept=depts[dept_id].acronym)}}"
>département {{ dept_names[dept_id] }}</a></h3>
<div class="ub-formsemestres">
{% for formsemestre in formsemestres_by_dept[dept_id] %}
<div class="ub-formsemestre">
...
...
This diff is collapsed.
Click to expand it.
app/views/user_board.py
+
8
−
4
View file @
1a5072a3
...
...
@@ -7,6 +7,7 @@ Emmanuel Viennet, 2023
from
flask
import
flash
,
redirect
,
render_template
,
url_for
from
flask
import
g
,
request
from
flask_login
import
login_required
from
app.auth.models
import
User
from
app.decorators
import
(
scodoc
,
...
...
@@ -15,14 +16,13 @@ from app.decorators import (
from
app.models
import
Departement
,
FormSemestre
from
app.scodoc.sco_permissions
import
Permission
from
app.scodoc
import
sco_preferences
from
app.scodoc
import
sco_utils
as
scu
from
app.views
import
scolar_bp
as
bp
from
app.views
import
scodoc_bp
as
bp
from
app.views
import
ScoData
@bp.route
(
"
/user_board/<string:user_name>
"
)
@bp.route
(
"
/
ScoDoc/
user_board/<string:user_name>
"
)
@scodoc
@
permissio
n_required
(
Permission
.
ScoView
)
@
logi
n_required
def
user_board
(
user_name
:
str
):
"""
Tableau de bord utilisateur: liens vers ses objets
"""
user
=
User
.
query
.
filter_by
(
user_name
=
user_name
).
first_or_404
()
...
...
@@ -30,6 +30,9 @@ def user_board(user_name: str):
formsemestres_by_dept
,
modimpls_by_formsemestre
,
)
=
FormSemestre
.
get_user_formsemestres_annee_by_dept
(
user
)
depts
=
{
dept_id
:
Departement
.
query
.
get
(
dept_id
)
for
dept_id
in
formsemestres_by_dept
}
dept_names
=
{
dept_id
:
sco_preferences
.
get_preference
(
"
DeptName
"
,
dept_id
=
dept_id
)
for
dept_id
in
formsemestres_by_dept
...
...
@@ -41,6 +44,7 @@ def user_board(user_name: str):
# TODO: le calendrier avec ses enseignements
return
render_template
(
"
user_board/user_board.j2
"
,
depts
=
depts
,
dept_names
=
dept_names_sorted
,
formsemestres_by_dept
=
formsemestres_by_dept
,
modimpls_by_formsemestre
=
modimpls_by_formsemestre
,
...
...
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