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
2345ce8b
Commit
2345ce8b
authored
3 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
Fixed multiday activites in planning
parent
1261be50
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
home/templates/activites.html
+34
-11
34 additions, 11 deletions
home/templates/activites.html
with
34 additions
and
11 deletions
home/templates/activites.html
+
34
−
11
View file @
2345ce8b
...
...
@@ -11,7 +11,10 @@
{% if settings.display_planning %}
<h2>
Planning
</h2>
<div
id=
"planning"
></div>
<!--
In order to limit the planning's width, we cheat using the timeline's groups
I.E we set all dates to the first day (Friday) and set groups allowing vertical display:
-->
<script
type=
"text/javascript"
>
// https://visjs.org/
// DOM element where the Timeline will be attached
...
...
@@ -26,16 +29,36 @@
// Items in the timeline
const
items
=
new
vis
.
DataSet
([
{
%
for
act
in
planning
%
}
{
id
:
{{
act
.
id
}},
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
'
,
group
:
{{
act
.
start
|
date
:
"
d
"
}},
subgroup
:
'
{{ act.room }}
'
,
end
:
'
{{ settings.date_start|date:"Y-m-d"}} {{ act.end|date:"H:i:s" }}
'
},
{
%
if
act
.
start
|
date
:
"
d
"
==
act
.
end
|
date
:
"
d
"
%
}
{
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
'
,
group
:
{{
act
.
start
|
date
:
"
d
"
}},
subgroup
:
'
{{ act.room }}
'
,
end
:
'
{{ settings.date_start|date:"Y-m-d"}} {{ act.end|date:"H:i:s" }}
'
},
{
%
else
%
}
// activity spans multiple days
{
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
'
,
group
:
{{
act
.
start
|
date
:
"
d
"
}},
subgroup
:
'
{{ act.room }}
'
,
end
:
'
{{ settings.date_start|date:"Y-m-d"}} 23:59:59
'
},
{
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"}} 00:00:00
'
,
align
:
'
left
'
,
group
:
{{
act
.
start
|
date
:
"
d
"
|
add
:
"
1
"
}},
subgroup
:
'
{{ act.room }}
'
,
end
:
'
{{ settings.date_start|date:"Y-m-d"}} {{ act.end|date:"H:i:s" }}
'
},
{
%
endif
%
}
{
%
endfor
%
}
]);
...
...
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