Skip to content
Snippets Groups Projects
Commit 56c64da5 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Link the fund/lab on a submission detail viewto the public fund/lab page.

parent 9fd79c71
No related branches found
No related tags found
No related merge requests found
{% extends "base-apply.html" %}
{% load static workflow_tags %}
{% load static workflow_tags wagtailcore_tags %}
{% block title %}{{ object.title }}{% endblock %}
{% block body_class %}{% endblock %}
{% block content %}
......@@ -13,7 +13,7 @@
<h1 class="beta heading heading--no-margin heading--bold">{{ object.title }}</h1>
<h5 class="heading heading--meta">
<span>{{ object.stage }}</span>
<span>{{ object.page }}</span>
<span>{% if public_page %}<a class="link--transparent link--underlined" href="{% pageurl public_page %}" >{{ object.page }}</a>{% else %}{{ object.page }}{% endif %}</span>
<span>{{ object.round }}</span>
<span>Lead: {{ object.lead }}</span>
</h5>
......
......@@ -25,6 +25,7 @@ from opentech.apply.determinations.views import DeterminationCreateOrUpdateView
from opentech.apply.review.views import ReviewContextMixin
from opentech.apply.users.decorators import staff_required
from opentech.apply.utils.views import DelegateableView, ViewDispatcher
from opentech.public.funds.models import BaseApplicationPage, LabPage
from .differ import compare
from .forms import ProgressSubmissionForm, UpdateReviewersForm, UpdateSubmissionLeadForm
......@@ -148,13 +149,27 @@ class AdminSubmissionDetailView(ReviewContextMixin, ActivityContextMixin, Delega
redirect = SubmissionSealedView.should_redirect(request, submission)
return redirect or super().dispatch(request, *args, **kwargs)
def get_public_page(self, page_id):
try:
return BaseApplicationPage.objects.get(application_type_id=page_id)
except BaseApplicationPage.DoesNotExist:
pass
try:
return LabPage.objects.get(lab_type_id=page_id)
except LabPage.DoesNotExist:
pass
return False
def get_context_data(self, **kwargs):
other_submissions = self.model.objects.filter(user=self.object.user).current().exclude(id=self.object.id)
if self.object.next:
other_submissions = other_submissions.exclude(id=self.object.next.id)
public_page = self.get_public_page(self.object.page.id)
return super().get_context_data(
other_submissions=other_submissions,
public_page=public_page,
**kwargs,
)
......
......@@ -12,6 +12,10 @@
text-decoration: underline;
}
&--transparent {
color: $color--white;
}
&--bold {
font-weight: $weight--bold;
}
......
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