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
61ee4718
Commit
61ee4718
authored
7 years ago
by
Todd Dembrey
Browse files
Options
Downloads
Patches
Plain Diff
Provide a seperate admin table so that applicants dont see lead
parent
84570b31
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
opentech/apply/funds/tables.py
+10
-2
10 additions, 2 deletions
opentech/apply/funds/tables.py
opentech/apply/funds/views.py
+3
-3
3 additions, 3 deletions
opentech/apply/funds/views.py
with
13 additions
and
5 deletions
opentech/apply/funds/tables.py
+
10
−
2
View file @
61ee4718
...
...
@@ -14,17 +14,17 @@ from .widgets import Select2MultiCheckboxesWidget
class
SubmissionsTable
(
tables
.
Table
):
"""
Base table for listing submissions, do not include admin data to this table
"""
title
=
tables
.
LinkColumn
(
'
funds:submission
'
,
args
=
[
A
(
'
pk
'
)],
orderable
=
True
)
submit_time
=
tables
.
DateColumn
(
verbose_name
=
"
Submitted
"
)
status_name
=
tables
.
Column
(
verbose_name
=
"
Status
"
)
stage
=
tables
.
Column
(
verbose_name
=
"
Type
"
)
page
=
tables
.
Column
(
verbose_name
=
"
Fund
"
)
lead
=
tables
.
Column
(
accessor
=
'
round.specific.lead
'
,
verbose_name
=
'
Lead
'
)
class
Meta
:
model
=
ApplicationSubmission
fields
=
(
'
title
'
,
'
status_name
'
,
'
stage
'
,
'
page
'
,
'
round
'
,
'
submit_time
'
)
sequence
=
(
'
title
'
,
'
status_name
'
,
'
stage
'
,
'
page
'
,
'
round
'
,
'
lead
'
,
'
submit_time
'
)
sequence
=
(
'
title
'
,
'
status_name
'
,
'
stage
'
,
'
page
'
,
'
round
'
,
'
submit_time
'
)
template
=
'
funds/tables/table.html
'
row_attrs
=
{
'
class
'
:
lambda
record
:
''
if
record
.
active
else
'
is-inactive
'
...
...
@@ -37,6 +37,14 @@ class SubmissionsTable(tables.Table):
return
mark_safe
(
f
'
<span>
{
value
}
</span>
'
)
class
AdminSubmissionsTable
(
SubmissionsTable
):
"""
Adds admin only columns to the submissions table
"""
lead
=
tables
.
Column
(
accessor
=
'
round.specific.lead
'
,
verbose_name
=
'
Lead
'
)
class
Meta
:
sequence
=
(
'
title
'
,
'
status_name
'
,
'
stage
'
,
'
page
'
,
'
round
'
,
'
lead
'
,
'
submit_time
'
)
def
get_used_rounds
(
request
):
return
Round
.
objects
.
filter
(
submissions__isnull
=
False
).
distinct
()
...
...
This diff is collapsed.
Click to expand it.
opentech/apply/funds/views.py
+
3
−
3
View file @
61ee4718
...
...
@@ -15,13 +15,13 @@ from opentech.apply.activity.models import Activity
from
.forms
import
ProgressSubmissionForm
,
UpdateSubmissionLeadForm
from
.models
import
ApplicationSubmission
from
.tables
import
SubmissionsTable
,
SubmissionFilter
,
SubmissionFilterAndSearch
from
.tables
import
Admin
SubmissionsTable
,
SubmissionFilter
,
SubmissionFilterAndSearch
from
.workflow
import
SingleStage
,
DoubleStage
class
SubmissionListView
(
AllActivityContextMixin
,
SingleTableMixin
,
FilterView
):
template_name
=
'
funds/submissions.html
'
table_class
=
SubmissionsTable
table_class
=
Admin
SubmissionsTable
filterset_class
=
SubmissionFilter
...
...
@@ -32,7 +32,7 @@ class SubmissionListView(AllActivityContextMixin, SingleTableMixin, FilterView):
class
SubmissionSearchView
(
SingleTableMixin
,
FilterView
):
template_name
=
'
funds/submissions_search.html
'
table_class
=
SubmissionsTable
table_class
=
Admin
SubmissionsTable
filterset_class
=
SubmissionFilterAndSearch
...
...
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