Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
site-kwei
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
mediatek
site-kwei
Commits
c4ed7708
Commit
c4ed7708
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Affichage du status distanciel/présentiel
parent
c75b5a51
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
home/models.py
+8
-1
8 additions, 1 deletion
home/models.py
home/templates/admin.html
+12
-0
12 additions, 0 deletions
home/templates/admin.html
home/views.py
+4
-0
4 additions, 0 deletions
home/views.py
with
24 additions
and
1 deletion
home/models.py
+
8
−
1
View file @
c4ed7708
...
...
@@ -84,7 +84,14 @@ class InterludesActivity(models.Model):
@property
def
pretty_type
(
self
)
->
str
:
return
self
.
Types
(
self
.
act_type
).
label
type
=
self
.
Types
(
self
.
act_type
).
label
status
=
self
.
Status
(
self
.
status
)
status_repr
=
"
présentiel ou distanciel
"
if
status
==
self
.
Status
.
DISTANT
:
status_repr
=
"
distanciel
"
elif
status
==
self
.
Status
.
PRESENT
:
status_repr
=
"
présentiel
"
return
"
{} ({})
"
.
format
(
type
,
status_repr
)
def
conflicts
(
self
,
other
:
"
InterludesActivity
"
)
->
bool
:
"""
Check whether these activites overlap
"""
...
...
This diff is collapsed.
Click to expand it.
home/templates/admin.html
+
12
−
0
View file @
c4ed7708
...
...
@@ -112,6 +112,18 @@
<div
class=
"qty"
>
Obtenus
</div>
<div
class=
"nb_small"
>
{{ metrics.granted }}
</div>
</div>
<div
class=
"stat"
>
<div
class=
"qty"
>
Présentiel
</div>
<div
class=
"nb_small"
>
{{ metrics.st_present }}
</div>
</div>
<div
class=
"stat"
>
<div
class=
"qty"
>
Distanciel
</div>
<div
class=
"nb_small"
>
{{ metrics.st_distant }}
</div>
</div>
<div
class=
"stat"
>
<div
class=
"qty"
>
Les deux
</div>
<div
class=
"nb_small"
>
{{ metrics.st_both }}
</div>
</div>
</div>
<h2>
Répartition des activités
</h2>
...
...
This diff is collapsed.
Click to expand it.
home/views.py
+
4
−
0
View file @
c4ed7708
...
...
@@ -167,6 +167,10 @@ class AdminView(SuperuserRequiredMixin, TemplateView):
wish
=
wishes
.
count
()
granted
=
wishes
.
filter
(
accepted
=
True
).
count
()
st_present
=
acts
.
filter
(
status
=
InterludesActivity
.
Status
.
PRESENT
).
count
()
st_distant
=
acts
.
filter
(
status
=
InterludesActivity
.
Status
.
DISTANT
).
count
()
st_both
=
acts
.
filter
(
status
=
InterludesActivity
.
Status
.
BOTH
).
count
()
# validation de la repartition des activités
accepted
=
wishes
.
filter
(
accepted
=
True
)
# order_by is useless but required
...
...
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