From b728ad62d6b2e5213c80c729ab142fc45421b977 Mon Sep 17 00:00:00 2001
From: Todd Dembrey <todd.dembrey@torchbox.com>
Date: Thu, 24 Jan 2019 10:14:55 +0000
Subject: [PATCH] Separate templating for two table types

---
 .../funds/templates/funds/submissions.html    | 12 +-----
 .../templates/funds/submissions_overview.html | 42 +++++++++++++++++++
 opentech/apply/funds/urls.py                  |  6 +--
 opentech/apply/funds/views.py                 |  6 +--
 4 files changed, 49 insertions(+), 17 deletions(-)
 create mode 100644 opentech/apply/funds/templates/funds/submissions_overview.html

diff --git a/opentech/apply/funds/templates/funds/submissions.html b/opentech/apply/funds/templates/funds/submissions.html
index 22a8f77e7..353450fa7 100644
--- a/opentech/apply/funds/templates/funds/submissions.html
+++ b/opentech/apply/funds/templates/funds/submissions.html
@@ -7,25 +7,15 @@
     <div class="admin-bar__inner wrapper--search">
         {% block page_header %}
             <div>
-                <h1 class="gamma heading heading--no-margin heading--bold">Received Submissions</h1>
-                <h5>Track and explore recent submissions</h5>
+                <h1 class="gamma heading heading--no-margin heading--bold">All Submissions</h1>
             </div>
         {% endblock %}
     </div>
 </div>
 
 <div class="wrapper wrapper--large wrapper--inner-space-medium">
-
-    {% if closed_rounds or open_rounds %}
-        {% include "funds/includes/round-block.html" with closed_rounds=closed_rounds open_rounds=open_rounds %}
-    {% endif %}
-
     {% block table %}
-        <h4 class="heading heading--normal heading--no-margin">All Submissions</h4>
         {{ block.super }}
-        <div class="all-submissions-table__more">
-            <a href="{% url 'apply:submissions:list' %}">Show all</a>
-        </div>
     {% endblock %}
 </div>
 
diff --git a/opentech/apply/funds/templates/funds/submissions_overview.html b/opentech/apply/funds/templates/funds/submissions_overview.html
new file mode 100644
index 000000000..3963db804
--- /dev/null
+++ b/opentech/apply/funds/templates/funds/submissions_overview.html
@@ -0,0 +1,42 @@
+{% extends "funds/base_submissions_table.html" %}
+{% load static %}
+{% block title %}Submissions{% endblock %}
+
+{% block content %}
+<div class="admin-bar">
+    <div class="admin-bar__inner wrapper--search">
+        {% block page_header %}
+            <div>
+                <h1 class="gamma heading heading--no-margin heading--bold">Submissions</h1>
+                <h5>Track and explore recent submissions</h5>
+            </div>
+        {% endblock %}
+    </div>
+</div>
+
+<div class="wrapper wrapper--large wrapper--inner-space-medium">
+
+    {% if closed_rounds or open_rounds %}
+        {% include "funds/includes/round-block.html" with closed_rounds=closed_rounds open_rounds=open_rounds %}
+    {% endif %}
+
+    {% block table %}
+        <h4 class="heading heading--normal heading--no-margin">All Submissions</h4>
+        {{ block.super }}
+        <div class="all-submissions-table__more">
+            <a href="{% url 'apply:submissions:list' %}">Show all</a>
+        </div>
+    {% endblock %}
+</div>
+
+<a href="#" class="js-open-feed link link--open-feed">
+    <h4 class="heading heading--no-margin heading--activity-feed">Activity Feed</h4>
+</a>
+{% include "funds/includes/activity-feed.html" %}
+
+{% endblock %}
+
+{% block extra_js %}
+    {{ block.super }}
+    <script src="{% static 'js/apply/activity-feed.js' %}"></script>
+{% endblock %}
diff --git a/opentech/apply/funds/urls.py b/opentech/apply/funds/urls.py
index 4d00c251f..7897ce287 100644
--- a/opentech/apply/funds/urls.py
+++ b/opentech/apply/funds/urls.py
@@ -8,7 +8,7 @@ from .views import (
     SubmissionDetailView,
     SubmissionEditView,
     SubmissionListView,
-    SubmissionListAllView,
+    SubmissionOverviewView,
     SubmissionSealedView,
 )
 from .api_views import SubmissionList, SubmissionDetail
@@ -23,8 +23,8 @@ revision_urls = ([
 app_name = 'funds'
 
 submission_urls = ([
-    path('', SubmissionListView.as_view(), name="overview"),
-    path('all/', SubmissionListAllView.as_view(), name="list"),
+    path('', SubmissionOverviewView.as_view(), name="overview"),
+    path('all/', SubmissionListView.as_view(), name="list"),
     path('<int:pk>/', include([
         path('', SubmissionDetailView.as_view(), name="detail"),
         path('edit/', SubmissionEditView.as_view(), name="edit"),
diff --git a/opentech/apply/funds/views.py b/opentech/apply/funds/views.py
index 84ca43380..eb19a7e4a 100644
--- a/opentech/apply/funds/views.py
+++ b/opentech/apply/funds/views.py
@@ -79,8 +79,8 @@ class BaseAdminSubmissionsTable(SingleTableMixin, FilterView):
         return super().get_context_data(**kwargs)
 
 
-class SubmissionListView(AllActivityContextMixin, BaseAdminSubmissionsTable):
-    template_name = 'funds/submissions.html'
+class SubmissionOverviewView(AllActivityContextMixin, BaseAdminSubmissionsTable):
+    template_name = 'funds/submissions_overview.html'
     table_class = SummarySubmissionsTable
     table_pagination = False
     filter_action = reverse_lazy('funds:submissions:list')
@@ -104,7 +104,7 @@ class SubmissionListView(AllActivityContextMixin, BaseAdminSubmissionsTable):
         )
 
 
-class SubmissionListAllView(AllActivityContextMixin, BaseAdminSubmissionsTable):
+class SubmissionListView(AllActivityContextMixin, BaseAdminSubmissionsTable):
     template_name = 'funds/submissions.html'
 
 
-- 
GitLab