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
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
Felix Blanke
AKPlanning
Commits
58301524
Commit
58301524
authored
3 years ago
by
Benjamin Hättasch
Browse files
Options
Downloads
Patches
Plain Diff
Display list of next AKs on slides
parent
8fa36c56
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKModel/templates/admin/AKModel/export/slides.tex
+21
-5
21 additions, 5 deletions
AKModel/templates/admin/AKModel/export/slides.tex
AKModel/views.py
+22
-2
22 additions, 2 deletions
AKModel/views.py
with
43 additions
and
7 deletions
AKModel/templates/admin/AKModel/export/slides.tex
+
21
−
5
View file @
58301524
...
...
@@ -28,11 +28,11 @@
\end{frame}
{
%for category in categories %}
{
%for category
, ak_list
in categories
_with_aks
%}
\section
{
{{
- category.name | latex
_
escape
_
utf8 -
}}
}
{
% for ak
in category.ak_set.all()
%}
{
% for ak
, next_aks in ak_list
%}
{
% if not ak.wish %}
...
...
@@ -51,7 +51,15 @@
\faScroll
{
% endif %}
{{
ak.description | truncatechars(500) | latex
_
escape
_
utf8
}}
{{
ak.description | truncatechars(400) | latex
_
escape
_
utf8
}}
\vspace
{
2em
}
\begin{scriptsize}
{
% for n_ak in next_aks %}
{
% if n_ak %}\hfill \faAngleDoubleRight~ {{- n_ak.name | latex_escape_utf8 -}}{% endif %}
{
% endfor %}
\end{scriptsize}
\end{frame}
...
...
@@ -64,7 +72,7 @@
\section
{
{{
- translations.wishes -
}}
}
{
% for ak in wishes %}
{
% for ak
, next_aks
in wishes %}
%\setbeamertemplate{frame footer}{}
...
...
@@ -79,7 +87,15 @@
\faClock
~
{{
ak.description | truncatechars(500) | latex
_
escape
_
utf8
}}
{{
ak.description | truncatechars(400) | latex
_
escape
_
utf8
}}
\vspace
{
2em
}
\begin{scriptsize}
{
% for n_ak in next_aks %}
{
% if n_ak %}\hfill \faAngleDoubleRight~ {{- n_ak.name | latex_escape_utf8 -}}{% endif %}
{
% endfor %}
\end{scriptsize}
\end{frame}
...
...
This diff is collapsed.
Click to expand it.
AKModel/views.py
+
22
−
2
View file @
58301524
from
itertools
import
zip_longest
from
django.contrib
import
admin
,
messages
from
django.contrib.admin.views.decorators
import
staff_member_required
from
django.http
import
HttpResponseRedirect
...
...
@@ -296,6 +298,8 @@ def export_slides(request, event_slug):
event
=
get_object_or_404
(
Event
,
slug
=
event_slug
)
NEXT_AK_LIST_LENGTH
=
4
translations
=
{
'
symbols
'
:
_
(
"
Symbols
"
),
'
who
'
:
_
(
"
Who?
"
),
...
...
@@ -305,11 +309,27 @@ def export_slides(request, event_slug):
'
wishes
'
:
_
(
"
Wishes
"
),
}
def
build_ak_list_with_next_aks
(
ak_list
):
next_aks_list
=
zip_longest
(
*
[
ak_list
[
i
+
1
:]
for
i
in
range
(
NEXT_AK_LIST_LENGTH
)],
fillvalue
=
None
)
return
[(
ak
,
next_aks
)
for
ak
,
next_aks
in
zip_longest
(
ak_list
,
next_aks_list
,
fillvalue
=
list
())]
categories
=
event
.
akcategory_set
.
all
()
categories_with_aks
=
[]
ak_wishes
=
[]
for
category
in
categories
:
ak_list
=
[]
for
ak
in
category
.
ak_set
.
all
():
# order_by("owners").distinct():
if
ak
.
wish
:
ak_wishes
.
append
(
ak
)
else
:
ak_list
.
append
(
ak
)
categories_with_aks
.
append
((
category
,
build_ak_list_with_next_aks
(
ak_list
)))
context
=
{
'
title
'
:
event
.
name
,
'
categories
'
:
event
.
akcategory_set
.
all
()
,
'
categories
_with_aks
'
:
categories_with_aks
,
'
subtitle
'
:
_
(
"
AKs
"
),
"
wishes
"
:
[
ak
for
ak
in
event
.
ak_set
.
order_by
(
'
category
'
)
if
ak
.
wish
]
,
"
wishes
"
:
build_ak_list_with_next_aks
(
ak
_
wish
es
)
,
"
translations
"
:
translations
,
}
...
...
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