Skip to content

Commit

Permalink
Remove applicationsubmission_simplified_detail.
Browse files Browse the repository at this point in the history
  • Loading branch information
frjo authored and theskumar committed Nov 6, 2024
1 parent 42b70ba commit bffc195
Show file tree
Hide file tree
Showing 25 changed files with 164 additions and 442 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

{% trans "Title" %}: {{ source.title }}
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:approval' pk=source.pk %}
{% trans "Original Submission" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:submissions:simplified' pk=source.submission.pk %}

{% blocktrans with lead=source.lead email=source.lead.email %}Please contact {{ lead }} - {{ email }} if you have any questions.{% endblocktrans %}
{% endblock %}{# fmt:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

{% trans "Title" %}: {{ source.title }}
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:approval' pk=source.pk %}
{% trans "Original Submission" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:submissions:simplified' pk=source.submission.pk %}

{% blocktrans with lead=source.lead email=source.lead.email %}Please contact {{ lead }} - {{ email }} if you have any questions.{% endblocktrans %}
{% endblock %}{# fmt:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

{% trans "Title" %}: {{ source.title }}
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:approval' pk=source.pk %}
{% trans "Original Submission" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:submissions:simplified' pk=source.submission.pk %}

{% blocktrans with lead=source.lead email=source.lead.email %}Please contact {{ lead }} - {{ email }} if you have any questions.{% endblocktrans %}
{% endblock %}{# fmt:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
{% trans "Title" %}: {{ source.title }}
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:detail' pk=source.pk %}
{% trans "Project Form" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:approval' pk=source.pk %}
{% trans "Original Submission" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:submissions:simplified' pk=source.submission.pk %}

{% blocktrans with lead=source.lead email=source.lead.email %}Please contact {{ lead }} - {{ email }} if you have any questions.{% endblocktrans %}
{% endblock %}{# fmt:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

{% trans "Title" %}: {{ source.title }}
{% trans "Link" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:projects:approval' pk=source.pk %}
{% trans "Original Submission" %}: {{ request.scheme }}://{{ request.get_host }}{% url 'apply:submissions:simplified' pk=source.submission.pk %}

{% blocktrans with lead=source.lead email=source.lead.email %}Please contact {{ lead }} - {{ email }} if you have any questions.{% endblocktrans %}
{% endblock %}{# fmt:on #}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% block content %}
{% adminbar %}
{% slot back_link %}
<a class="simplified__submissions-link" href="{{ determination.submission.get_absolute_url }}">
<a class="link link--back" href="{{ determination.submission.get_absolute_url }}">
{% trans "View submission" %}
</a>
{% endslot %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="admin-bar">
<div class="admin-bar__inner">
{% if request.GET.ref == 'all-alt' %}
<a class="simplified__submissions-link"
<a class="link link--back"
hx-boost="true"
href="{% url "funds:submissions:list" %}"
>
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion hypha/apply/funds/templates/funds/revisions_compare.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

{% adminbar %}
{% slot back_link %}
<a class="simplified__submissions-link" href="{% url "funds:submissions:revisions:list" object.id %}">
<a class="link link--back" href="{% url "funds:submissions:revisions:list" object.id %}">
{% trans "View revisions" %}
</a>
{% endslot %}
Expand Down
34 changes: 1 addition & 33 deletions hypha/apply/funds/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from bs4 import BeautifulSoup
from django.conf import settings
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.test import RequestFactory, TestCase, override_settings
from django.urls import reverse
Expand Down Expand Up @@ -48,7 +47,7 @@
ReviewerSettings,
ScreeningStatus,
)
from ..views import SubmissionDetailSimplifiedView, SubmissionDetailView
from ..views import SubmissionDetailView
from .factories import CustomFormFieldsFactory


Expand Down Expand Up @@ -1715,37 +1714,6 @@ def test_can_screen_applications_in_final_status(self):
self.assertEqual(activity.visibility, TEAM)


class TestSubmissionDetailSimplifiedView(TestCase):
def test_staff_only(self):
factory = RequestFactory()
submission = ApplicationSubmissionFactory()
ProjectFactory(submission=submission)

request = factory.get(f"/submission/{submission.pk}")
request.user = StaffFactory()

response = SubmissionDetailSimplifiedView.as_view()(request, pk=submission.pk)
self.assertEqual(response.status_code, 200)

request.user = ApplicantFactory()
with self.assertRaises(PermissionDenied):
SubmissionDetailSimplifiedView.as_view()(request, pk=submission.pk)

def test_project_required(self):
factory = RequestFactory()
submission = ApplicationSubmissionFactory()

request = factory.get(f"/submission/{submission.pk}")
request.user = StaffFactory()

with self.assertRaises(Http404):
SubmissionDetailSimplifiedView.as_view()(request, pk=submission.pk)

ProjectFactory(submission=submission)
response = SubmissionDetailSimplifiedView.as_view()(request, pk=submission.pk)
self.assertEqual(response.status_code, 200)


class BaseSubmissionFileViewTestCase(BaseViewTestCase):
url_name = "funds:submissions:{}"
base_view_name = "serve_private_media"
Expand Down
6 changes: 0 additions & 6 deletions hypha/apply/funds/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
StaffAssignments,
SubmissionDeleteView,
SubmissionDetailPDFView,
SubmissionDetailSimplifiedView,
SubmissionDetailView,
SubmissionEditView,
SubmissionListView,
Expand Down Expand Up @@ -255,11 +254,6 @@
),
path("edit/", SubmissionEditView.as_view(), name="edit"),
path("sealed/", SubmissionSealedView.as_view(), name="sealed"),
path(
"simplified/",
SubmissionDetailSimplifiedView.as_view(),
name="simplified",
),
path(
"download/", SubmissionDetailPDFView.as_view(), name="download"
),
Expand Down
14 changes: 0 additions & 14 deletions hypha/apply/funds/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,20 +1792,6 @@ def test_func(self):
return permission


@method_decorator(staff_or_finance_required, name="dispatch")
class SubmissionDetailSimplifiedView(DetailView):
model = ApplicationSubmission
template_name_suffix = "_simplified_detail"

def get_object(self, queryset=None):
obj = super().get_object(queryset)

if not hasattr(obj, "project"):
raise Http404

return obj


@method_decorator(staff_or_finance_required, name="dispatch")
class SubmissionDetailPDFView(SingleObjectMixin, View):
model = ApplicationSubmission
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% adminbar %}
{% slot back_link %}
<a class="simplified__projects-link" href="{{ object.project.get_absolute_url }}">
<a class="link link--back" href="{{ object.project.get_absolute_url }}">
{% trans "View project page" %}
</a>
{% endslot %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{% adminbar %}
{% slot back_link %}
<a class="simplified__projects-link" href="{% url 'apply:projects:detail' object.project.id %}">
<a class="link link--back" href="{% url 'apply:projects:detail' object.project.id %}">
{% trans "View project page" %}
</a>
{% endslot %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{% adminbar %}
{% slot back_link %}
<a class="simplified__projects-link" href="{{ project.get_absolute_url }}">
<a class="link link--back" href="{{ project.get_absolute_url }}">
{% trans "View project page" %}
</a>
{% endslot %}
Expand Down
Loading

0 comments on commit bffc195

Please sign in to comment.