return reverse("organization-project-detail", kwargs={"slug": self.slug})
def project_status(self):
- if datetime.date.today() >= self.date_from and datetime.date.today() <= self.date_to:
- return _('in progress')
- elif datetime.date.today() < self.date_from and datetime.date.today() < self.date_to:
+ if self.date_from and self.date_to:
+ if datetime.date.today() >= self.date_from and datetime.date.today() <= self.date_to:
+ return _('in progress')
+ elif datetime.date.today() < self.date_from and datetime.date.today() < self.date_to:
+ return _('pending')
+ elif datetime.date.today() > self.date_to and datetime.date.today() > self.date_to:
+ return _('completed')
+ else:
return _('pending')
- elif datetime.date.today() > self.date_to and datetime.date.today() > self.date_to:
- return _('completed')
class ProjectTopic(Named):
{{ sub_topic }}<br>
{% trans "European and national projects" %}<br>
{% for project in sub_topic.projects.all|get_type:"external project" %}
- {{ project }}<br>
+ <a href="{% url 'organization-project-detail' project.slug %}">{{ project }}</a><br>
{% endfor %}
{% trans "Internal projects" %}<br>
{% for project in sub_topic.projects.all|get_type:"internal project" %}
- {{ project }}<br>
+ <a href="{% url 'organization-project-detail' project.slug %}">{{ project }}</a><br>
{% endfor %}
{% endfor %}
{% endwith %}