Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Site Interludes
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 Interludes
Commits
c3e84e85
Commit
c3e84e85
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Fix planning links for multiple activities
parent
5fb78447
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/admin.py
+2
-1
2 additions, 1 deletion
home/admin.py
home/models.py
+16
-0
16 additions, 0 deletions
home/models.py
home/templates/activites.html
+2
-2
2 additions, 2 deletions
home/templates/activites.html
with
20 additions
and
3 deletions
home/admin.py
+
2
−
1
View file @
c3e84e85
...
...
@@ -28,7 +28,8 @@ class InterludesActivityAdmin(ExportCsvMixin, admin.ModelAdmin):
"
display
"
,
"
room
"
,
"
start
"
,
"
on_planning
"
,
"
notes
"
"
notes
"
,
"
canonical
"
,
)
list_per_page
=
100
save_as
=
True
# Allow to duplicate models
...
...
This diff is collapsed.
Click to expand it.
home/models.py
+
16
−
0
View file @
c3e84e85
...
...
@@ -69,6 +69,14 @@ class InterludesActivity(models.Model):
start
=
models
.
DateTimeField
(
"
début
"
,
null
=
True
,
blank
=
True
)
room
=
models
.
CharField
(
"
salle
"
,
max_length
=
100
,
null
=
True
,
blank
=
True
)
canonical
=
models
.
ForeignKey
(
"
self
"
,
on_delete
=
models
.
SET_NULL
,
null
=
True
,
blank
=
True
,
verbose_name
=
"
Représentant canonique
"
,
help_text
=
"
Si plusieurs copie d
'
une activité existe (pour plusieurs crénaux),
"
"
et une seule est affichée, sélectionner là dans les copie pour réparer les liens
"
"
du planning vers la description
"
)
notes
=
models
.
TextField
(
"
Notes privées
"
,
max_length
=
2000
,
blank
=
True
)
@property
...
...
@@ -106,6 +114,14 @@ class InterludesActivity(models.Model):
status_repr
=
"
présentiel
"
return
"
{} ({})
"
.
format
(
type
,
status_repr
)
@property
def
slug
(
self
)
->
str
:
"""
Returns the planning/display slug for this activity
"""
id
=
self
.
id
if
self
.
canonical
:
id
=
self
.
canonical
.
id
return
"
act-{}
"
.
format
(
id
)
def
conflicts
(
self
,
other
:
"
InterludesActivity
"
)
->
bool
:
"""
Check whether these activites overlap
"""
if
self
.
end
is
None
or
other
.
end
is
None
:
...
...
This diff is collapsed.
Click to expand it.
home/templates/activites.html
+
2
−
2
View file @
c3e84e85
...
...
@@ -28,7 +28,7 @@
{
%
for
act
in
planning
%
}
{
id
:
{{
act
.
id
}},
content
:
'
<a class="hidden" href="#
act-
{{act.
id
}}"><div><strong>{{ act.title }}</strong><br>{{ act.room }}</div></a>
'
,
content
:
'
<a class="hidden" href="#{{
act.
slug
}}"><div><strong>{{ act.title }}</strong><br>{{ act.room }}</div></a>
'
,
title
:
'
<strong>{{ act.title }}</strong><br>{{ act.room }}
'
,
start
:
'
{{ settings.date_start|date:"Y-m-d"}} {{ act.start|date:"H:i:s" }}
'
,
align
:
'
left
'
,
...
...
@@ -97,7 +97,7 @@
{% endif %}
{% for activity in activities %}
<h3
id=
"
act-
{{ activity.
id
}}"
>
{{ activity.title }}
</h3>
<h3
id=
"{{ activity.
slug
}}"
>
{{ activity.title }}
</h3>
<dl>
<dt>
Durée :
</dt><dd>
{{ activity.pretty_duration }}
</dd>
...
...
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