Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hypha
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
ots
hypha
Commits
371ec4da
Commit
371ec4da
authored
6 years ago
by
Erin Mullaney
Browse files
Options
Downloads
Patches
Plain Diff
#806 add screening status column and filter to submission dashboard for admin/staff
parent
3afe7fac
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
opentech/apply/funds/tables.py
+8
-2
8 additions, 2 deletions
opentech/apply/funds/tables.py
with
8 additions
and
2 deletions
opentech/apply/funds/tables.py
+
8
−
2
View file @
371ec4da
...
...
@@ -12,7 +12,7 @@ from django_tables2.utils import A
from
wagtail.core.models
import
Page
from
opentech.apply.funds.models
import
ApplicationSubmission
,
Round
from
opentech.apply.funds.models
import
ApplicationSubmission
,
Round
,
ScreeningStatus
from
opentech.apply.funds.workflow
import
STATUSES
from
opentech.apply.users.groups
import
STAFF_GROUP_NAME
from
.widgets
import
Select2MultiCheckboxesWidget
...
...
@@ -67,9 +67,10 @@ class AdminSubmissionsTable(SubmissionsTable):
"""
Adds admin only columns to the submissions table
"""
lead
=
tables
.
Column
(
order_by
=
(
'
lead.full_name
'
,))
reviews_stats
=
tables
.
TemplateColumn
(
template_name
=
'
funds/tables/column_reviews.html
'
,
verbose_name
=
mark_safe
(
"
Reviews
\n
<span>Assgn.
\t
Comp.</span>
"
),
orderable
=
False
)
screening_status
=
tables
.
Column
(
verbose_name
=
"
Screening
"
)
class
Meta
(
SubmissionsTable
.
Meta
):
fields
=
(
'
title
'
,
'
phase
'
,
'
stage
'
,
'
fund
'
,
'
round
'
,
'
lead
'
,
'
submit_time
'
,
'
last_update
'
,
'
reviews_stats
'
)
# type: ignore
fields
=
(
'
title
'
,
'
phase
'
,
'
stage
'
,
'
fund
'
,
'
round
'
,
'
lead
'
,
'
submit_time
'
,
'
last_update
'
,
'
screening_status
'
,
'
reviews_stats
'
)
# type: ignore
sequence
=
fields
+
(
'
comments
'
,)
def
render_lead
(
self
,
value
):
...
...
@@ -95,6 +96,10 @@ def get_reviewers(request):
User
=
get_user_model
()
return
User
.
objects
.
filter
(
Q
(
submissions_reviewer__isnull
=
False
)
|
Q
(
groups__name
=
STAFF_GROUP_NAME
)
|
Q
(
is_superuser
=
True
)).
distinct
()
def
get_screening_statuses
(
request
):
return
ScreeningStatus
.
objects
.
filter
(
id__in
=
ApplicationSubmission
.
objects
.
all
().
values
(
'
screening_status__id
'
).
distinct
(
'
screening_status__id
'
))
class
Select2CheckboxWidgetMixin
(
filters
.
Filter
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
...
@@ -133,6 +138,7 @@ class SubmissionFilter(filters.FilterSet):
status
=
StatusMultipleChoiceFilter
()
lead
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_round_leads
,
label
=
'
Leads
'
)
reviewers
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_reviewers
,
label
=
'
Reviewers
'
)
screening_status
=
Select2ModelMultipleChoiceFilter
(
queryset
=
get_screening_statuses
,
label
=
'
Screening
'
)
class
Meta
:
model
=
ApplicationSubmission
...
...
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