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
7de7e8b0
Commit
7de7e8b0
authored
4 years ago
by
Nadja Geisler
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-show-categories' into 'master'
Fix categories for submission overview Closes
#67
See merge request
!21
parents
6b123649
185debcb
No related branches found
Branches containing commit
No related tags found
1 merge request
!21
Fix categories for submission overview
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKSubmission/templates/AKSubmission/submission_overview.html
+2
-2
2 additions, 2 deletions
AKSubmission/templates/AKSubmission/submission_overview.html
AKSubmission/views.py
+14
-17
14 additions, 17 deletions
AKSubmission/views.py
with
16 additions
and
19 deletions
AKSubmission/templates/AKSubmission/submission_overview.html
+
2
−
2
View file @
7de7e8b0
...
...
@@ -70,7 +70,7 @@
</noscript>
<ul
class=
"nav nav-tabs"
style=
"margin-bottom:15px"
>
{% for category, _ in categories %}
{% for category, _ in categories
_with_aks
%}
<li
class=
"nav-item"
>
<a
class=
"nav-link {% if forloop.first %}active{% endif %}"
data-toggle=
"tab"
href=
"#category_{{ category.pk }}"
>
{{ category.name }}
</a>
...
...
@@ -79,7 +79,7 @@
</ul>
<div
id=
"akListTabbed"
class=
"tab-content"
>
{% for category, AKs in categories %}
{% for category, AKs in categories
_with_aks
%}
<div
class=
"tab-pane fade {% if forloop.first %}show active{% endif %}"
id=
"category_{{ category.pk }}"
>
<p><b>
{{ category.name }}:
</b>
{{ category.description }}
</p>
{% include "AKSubmission/ak_list_table.html" %}
...
...
This diff is collapsed.
Click to expand it.
AKSubmission/views.py
+
14
−
17
View file @
7de7e8b0
...
...
@@ -14,33 +14,30 @@ from AKSubmission.forms import AKWishForm, AKOwnerForm, AKEditForm, AKSubmission
class
SubmissionOverviewView
(
FilterByEventSlugMixin
,
ListView
):
model
=
AK
context_object_name
=
"
AK
s
"
model
=
AK
Category
context_object_name
=
"
categorie
s
"
template_name
=
"
AKSubmission/submission_overview.html
"
ordering
=
[
'
category
'
]
def
get_context_data
(
self
,
*
,
object_list
=
None
,
**
kwargs
):
context
=
super
().
get_context_data
(
object_list
=
object_list
,
**
kwargs
)
# Sort AKs into different lists (by their category)
categories
=
[]
aks_for_category
=
[]
ak_wishes
=
[]
c
urrent_category
=
None
for
ak
in
context
[
"
AKs
"
]:
if
ak
.
category
!=
current_
categor
y
:
current
_category
=
ak
.
category
aks_for_category
=
[]
categories
.
append
((
current_category
,
aks_for_category
))
if
settings
.
WISHES_AS_CATEGORY
a
nd
ak
.
wish
:
ak_wishes
.
append
(
ak
)
else
:
aks_for_category
.
append
(
ak
)
c
ategories_with_aks
=
[]
for
category
in
context
[
"
categor
ies
"
]
:
aks_for
_category
=
[]
for
ak
in
category
.
ak_set
.
all
():
if
settings
.
WISHES_AS_CATEGORY
and
ak
.
wish
:
ak_wishes
.
appe
nd
(
ak
)
else
:
aks_for_category
.
append
(
ak
)
categories_with_aks
.
append
((
category
,
aks_for_category
)
)
if
settings
.
WISHES_AS_CATEGORY
:
categories
.
append
(
categories
_with_aks
.
append
(
({
"
name
"
:
_
(
"
Wishes
"
),
"
pk
"
:
"
wish
"
,
"
description
"
:
_
(
"
AKs one would like to have
"
)},
ak_wishes
))
context
[
"
categories
"
]
=
categories
context
[
"
categories
_with_aks
"
]
=
categories
_with_aks
# Get list of existing owners for event (for AK submission start)
context
[
"
existingOwners
"
]
=
AKOwner
.
objects
.
filter
(
event
=
self
.
event
)
...
...
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