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
35f54089
Commit
35f54089
authored
2 years ago
by
Nadja Geisler
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-interest-view' into 'main'
Improve interest entering view See merge request
!131
parents
e9c5be55
903ce570
No related branches found
No related tags found
1 merge request
!131
Improve interest entering view
Pipeline
#103135
passed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AKModel/admin.py
+1
-1
1 addition, 1 deletion
AKModel/admin.py
AKScheduling/views.py
+10
-3
10 additions, 3 deletions
AKScheduling/views.py
with
11 additions
and
4 deletions
AKModel/admin.py
+
1
−
1
View file @
35f54089
...
...
@@ -171,7 +171,7 @@ class AKAdmin(SimpleHistoryAdmin):
model
=
AK
list_display
=
[
'
name
'
,
'
short_name
'
,
'
category
'
,
'
track
'
,
'
is_wish
'
,
'
interest
'
,
'
interest_counter
'
,
'
event
'
]
list_filter
=
[
'
event
'
,
WishFilter
,
(
'
category
'
,
EventRelatedFieldListFilter
),
(
'
requirements
'
,
EventRelatedFieldListFilter
)]
list_editable
=
[
'
short_name
'
,
'
track
'
,
'
interest
'
,
'
interest_counter
'
]
list_editable
=
[
'
short_name
'
,
'
track
'
,
'
interest_counter
'
]
ordering
=
[
'
pk
'
]
actions
=
[
'
wiki_export
'
]
form
=
AKAdminForm
...
...
This diff is collapsed.
Click to expand it.
AKScheduling/views.py
+
10
−
3
View file @
35f54089
...
...
@@ -120,9 +120,15 @@ class InterestEnteringAdminView(SuccessMessageMixin, AdminViewMixin, EventSlugMi
context
[
"
next_ak
"
]
=
None
last_ak
=
None
next_is_next
=
False
for
other_ak
in
context
[
'
ak
'
].
category
.
ak_set
.
all
():
if
other_ak
.
wish
:
continue
# Find other AK wishes (regardless of the category)...
if
context
[
'
ak
'
].
wish
:
other_aks
=
[
ak
for
ak
in
context
[
'
event
'
].
ak_set
.
all
()
if
ak
.
wish
]
# or other AKs of this category
else
:
other_aks
=
[
ak
for
ak
in
context
[
'
ak
'
].
category
.
ak_set
.
all
()
if
not
ak
.
wish
]
for
other_ak
in
other_aks
:
if
next_is_next
:
context
[
'
next_ak
'
]
=
other_ak
next_is_next
=
False
...
...
@@ -140,6 +146,7 @@ class InterestEnteringAdminView(SuccessMessageMixin, AdminViewMixin, EventSlugMi
aks_for_category
.
append
(
ak
)
categories_with_aks
.
append
((
category
,
aks_for_category
))
ak_wishes
.
sort
(
key
=
lambda
x
:
x
.
pk
)
categories_with_aks
.
append
(
(
AKCategory
(
name
=
_
(
"
Wishes
"
),
pk
=
0
,
description
=
"
-
"
),
ak_wishes
))
...
...
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