Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AKPlanning
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
KIF
AKPlanning
Commits
25aee6f6
Commit
25aee6f6
authored
4 years ago
by
Benjamin Hättasch
Browse files
Options
Downloads
Plain Diff
Merge branch 'voidptr/akplanning-readable-ak-times'
parents
e9a72c21
23d81356
No related branches found
No related tags found
1 merge request
!76
Readable AK times on details page
Pipeline
#13140
passed
4 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKModel/models.py
+21
-0
21 additions, 0 deletions
AKModel/models.py
AKSubmission/templates/AKSubmission/ak_detail.html
+14
-6
14 additions, 6 deletions
AKSubmission/templates/AKSubmission/ak_detail.html
with
35 additions
and
6 deletions
AKModel/models.py
+
21
−
0
View file @
25aee6f6
...
@@ -336,6 +336,14 @@ class AKSlot(models.Model):
...
@@ -336,6 +336,14 @@ class AKSlot(models.Model):
return
f
"
{
self
.
ak
}
@
{
self
.
start_simplified
}
in
{
self
.
room
}
"
return
f
"
{
self
.
ak
}
@
{
self
.
start_simplified
}
in
{
self
.
room
}
"
return
f
"
{
self
.
ak
}
@
{
self
.
start_simplified
}
"
return
f
"
{
self
.
ak
}
@
{
self
.
start_simplified
}
"
@property
def
duration_simplified
(
self
):
"""
Display duration of slot in format hours:minutes, e.g. 1.5 ->
"
1:30
"
"""
hours
,
minutes
=
divmod
(
self
.
duration
*
60
,
60
)
return
f
"
{
hours
}
:
{
minutes
:
2.0
f
}
"
@property
@property
def
start_simplified
(
self
):
def
start_simplified
(
self
):
"""
"""
...
@@ -345,6 +353,19 @@ class AKSlot(models.Model):
...
@@ -345,6 +353,19 @@ class AKSlot(models.Model):
return
_
(
"
Not scheduled yet
"
)
return
_
(
"
Not scheduled yet
"
)
return
self
.
start
.
astimezone
(
self
.
event
.
timezone
).
strftime
(
'
%a %H:%M
'
)
return
self
.
start
.
astimezone
(
self
.
event
.
timezone
).
strftime
(
'
%a %H:%M
'
)
@property
def
time_simplified
(
self
):
"""
Display start and end time of slot in format weekday + time, e.g.
"
Fri 14:00 - 15:30
"
or
"
Fri 22:00 - Sat 02:00
"
"""
if
self
.
start
is
None
:
return
_
(
"
Not scheduled yet
"
)
start
=
self
.
start
.
astimezone
(
self
.
event
.
timezone
)
end
=
self
.
end
.
astimezone
(
self
.
event
.
timezone
)
return
f
"
{
start
.
strftime
(
'
%a %H
:
%
M
'
)
}
-
{
end
.
strftime
(
'
%H
:
%
M
'
) if start.day == end.day else end.strftime(
'
%
a
%
H
:
%
M
'
)
}
"
@property
@property
def
end
(
self
):
def
end
(
self
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
AKSubmission/templates/AKSubmission/ak_detail.html
+
14
−
6
View file @
25aee6f6
...
@@ -174,9 +174,11 @@
...
@@ -174,9 +174,11 @@
<table
class=
"table"
>
<table
class=
"table"
>
<thead>
<thead>
<tr>
<tr>
<th>
{% trans "Duration" %}
</th>
{% if not ak.event.plan_hidden or user.is_staff %}
{% if not ak.event.plan_hidden or user.is_staff %}
<th>
{% trans "When?" %}
</th>
<th>
{% trans "When?" %}
</th>
{% endif %}
<th>
{% trans "Duration" %}
</th>
{% if not ak.event.plan_hidden or user.is_staff %}
<th>
{% trans "Room" %}
</th>
<th>
{% trans "Room" %}
</th>
{% endif %}
{% endif %}
<th></th>
<th></th>
...
@@ -185,14 +187,20 @@
...
@@ -185,14 +187,20 @@
<tbody>
<tbody>
{% for slot in ak.akslot_set.all %}
{% for slot in ak.akslot_set.all %}
<tr>
<tr>
<td>
{{ slot.duration }}
</td>
{% if not ak.event.plan_hidden or user.is_staff %}
{% if not ak.event.plan_hidden or user.is_staff %}
<td>
{{ slot.start_simplified }}
</td>
<td>
{{ slot.time_simplified }}
</td>
{% endif %}
<td>
{{ slot.duration_simplified }}
</td>
{% if not ak.event.plan_hidden or user.is_staff %}
<td>
<td>
{% if "AKPlan"|check_app_installed and slot.room %}
{% if slot.room %}
<a
href=
"{% url 'plan:plan_room' event_slug=ak.event.slug pk=slot.room.pk %}"
>
{{ slot.room }}
</a>
{% if "AKPlan"|check_app_installed %}
<a
href=
"{% url 'plan:plan_room' event_slug=ak.event.slug pk=slot.room.pk %}"
>
{{ slot.room }}
</a>
{% else %}
{{ slot.room }}
{% endif %}
{% else %}
{% else %}
{{ slot.room }}
-
{% endif %}
{% endif %}
</td>
</td>
{% endif %}
{% endif %}
...
...
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