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
8ebebeec
Commit
8ebebeec
authored
6 years ago
by
Parbhat Puri
Committed by
Fredrik Jonsson
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Display first group answers in Open call index page for a submission
parent
bfcf5f25
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opentech/apply/funds/models/mixins.py
+26
-1
26 additions, 1 deletion
opentech/apply/funds/models/mixins.py
opentech/public/funds/templates/public_funds/open_call_index_page.html
+13
-0
13 additions, 0 deletions
...ic/funds/templates/public_funds/open_call_index_page.html
with
39 additions
and
1 deletion
opentech/apply/funds/models/mixins.py
+
26
−
1
View file @
8ebebeec
...
@@ -4,7 +4,7 @@ from django.core.files import File
...
@@ -4,7 +4,7 @@ from django.core.files import File
from
django.core.files.storage
import
get_storage_class
from
django.core.files.storage
import
get_storage_class
from
opentech.apply.stream_forms.blocks
import
(
from
opentech.apply.stream_forms.blocks
import
(
FileFieldBlock
,
FormFieldBlock
,
ImageFieldBlock
,
MultiFileFieldBlock
FileFieldBlock
,
FormFieldBlock
,
GroupToggleBlock
,
ImageFieldBlock
,
MultiFileFieldBlock
)
)
from
opentech.apply.utils.blocks
import
SingleIncludeMixin
from
opentech.apply.utils.blocks
import
SingleIncludeMixin
...
@@ -124,6 +124,14 @@ class AccessFormData:
...
@@ -124,6 +124,14 @@ class AccessFormData:
elif
isinstance
(
field
.
block
,
FormFieldBlock
):
elif
isinstance
(
field
.
block
,
FormFieldBlock
):
yield
field_id
yield
field_id
@property
def
first_group_question_field_ids
(
self
):
for
field_id
,
field
in
self
.
fields
.
items
():
if
isinstance
(
field
.
block
,
GroupToggleBlock
):
break
elif
isinstance
(
field
.
block
,
FormFieldBlock
):
yield
field_id
@property
@property
def
raw_fields
(
self
):
def
raw_fields
(
self
):
# Field ids to field class mapping - similar to raw_data
# Field ids to field class mapping - similar to raw_data
...
@@ -157,6 +165,14 @@ class AccessFormData:
...
@@ -157,6 +165,14 @@ class AccessFormData:
if
field_id
not
in
self
.
named_blocks
if
field_id
not
in
self
.
named_blocks
]
]
@property
def
first_group_normal_blocks
(
self
):
return
[
field_id
for
field_id
in
self
.
first_group_question_field_ids
if
field_id
not
in
self
.
named_blocks
]
def
serialize
(
self
,
field_id
):
def
serialize
(
self
,
field_id
):
field
=
self
.
field
(
field_id
)
field
=
self
.
field
(
field_id
)
data
=
self
.
data
(
field_id
)
data
=
self
.
data
(
field_id
)
...
@@ -180,6 +196,12 @@ class AccessFormData:
...
@@ -180,6 +196,12 @@ class AccessFormData:
for
field_id
in
self
.
normal_blocks
for
field_id
in
self
.
normal_blocks
]
]
def
render_first_group_answers
(
self
):
return
[
self
.
render_answer
(
field_id
,
include_question
=
True
)
for
field_id
in
self
.
first_group_normal_blocks
]
def
render_text_blocks_answers
(
self
):
def
render_text_blocks_answers
(
self
):
# Returns a list of the rendered answers of type text
# Returns a list of the rendered answers of type text
return
[
return
[
...
@@ -191,3 +213,6 @@ class AccessFormData:
...
@@ -191,3 +213,6 @@ class AccessFormData:
def
output_answers
(
self
):
def
output_answers
(
self
):
# Returns a safe string of the rendered answers
# Returns a safe string of the rendered answers
return
mark_safe
(
''
.
join
(
self
.
render_answers
()))
return
mark_safe
(
''
.
join
(
self
.
render_answers
()))
def
output_first_group_answers
(
self
):
return
mark_safe
(
''
.
join
(
self
.
render_first_group_answers
()))
This diff is collapsed.
Click to expand it.
opentech/public/funds/templates/public_funds/open_call_index_page.html
+
13
−
0
View file @
8ebebeec
...
@@ -15,6 +15,19 @@
...
@@ -15,6 +15,19 @@
<h4
class=
"listing__title"
>
{{ submission.title }}
</h4>
<h4
class=
"listing__title"
>
{{ submission.title }}
</h4>
<a
class=
"listing__button"
href=
"{% pageurl submission.page %}"
>
Build it
</a>
<a
class=
"listing__button"
href=
"{% pageurl submission.page %}"
>
Build it
</a>
</div>
</div>
<div>
<div>
<h5>
Project Duration
</h5>
{{ submission.get_duration_display }}
</div>
<div>
<h5>
Name
</h5>
{{ submission.get_full_name_display }}
</div>
<div
class=
"rich-text rich-text--answers"
>
{{ submission.output_first_group_answers }}
</div>
</div>
{% endfor %}
{% endfor %}
...
...
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