Skip to content
Snippets Groups Projects
Unverified Commit 47c90ea4 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #484 from OpenTechFund/bugfix/tidy-up-listings

Bugfix/tidy up listings
parents 98a1d644 37aee6fc
No related branches found
No related tags found
No related merge requests found
......@@ -61,6 +61,8 @@ class BaseApplicationPage(BasePage):
# Make sure all children use the shared template
return 'public_funds/fund_page.html'
can_open = True
@property
def is_open(self):
return self.application_type and bool(self.application_type.specific.open_round)
......@@ -174,9 +176,14 @@ class LabPage(BasePage):
context['rfps'] = self.get_children().live().public()
return context
can_open = True
@property
def is_open(self):
return bool(self.lab_type.specific.open_round)
try:
return bool(self.lab_type.specific.open_round)
except AttributeError:
return bool(self.lab_link)
def clean(self):
if self.lab_type and self.lab_link:
......
......@@ -21,6 +21,7 @@
</div>
{% endif %}
{% if subpage.can_open %}
<p class="listing__deadline">
{% if subpage.is_open %}
{% if subpage.deadline %}
......@@ -29,10 +30,11 @@
{% else %}
Open
{% endif %}
{% else %}
{% else %}
Closed
{% endif %}
</p>
{% endif %}
<h4 class="listing__title">{{ subpage.listing_title|default:subpage.title }}</h4>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment