From 1f9aa290b5bad33532f62b450d3e84306b9b891f Mon Sep 17 00:00:00 2001
From: Saurabh Kumar <theskumar@users.noreply.github.com>
Date: Mon, 29 Jan 2024 17:42:11 +0530
Subject: [PATCH] Remove public "partners" app (#3716)

- Keep the app installed so the delete table migrations could run
- Update sandbox-db with removed tables

Depends on #3715
---
 docs/references/wagtail-admin.md              |   1 -
 hypha/public/partner/admin.py                 |  22 --
 hypha/public/partner/admin_view.py            |  48 ----
 ...add_investments_table_and_partners_page.py |   7 +-
 ..._investmentcategory_investment_and_more.py |  67 ++++++
 hypha/public/partner/models.py                | 215 ------------------
 hypha/public/partner/tables.py                | 147 ------------
 .../partner/base_investments_table.html       |  28 ---
 .../includes/table_filter_and_search.html     |  41 ----
 .../templates/partner/investments.html        |  11 -
 .../templates/partner/partner_page.html       |  30 ---
 .../partner/templates/partner/table.html      |  62 -----
 hypha/public/partner/views.py                 |  35 ---
 hypha/public/urls.py                          |  11 -
 hypha/urls.py                                 |   2 -
 public/sandbox_db.dump                        | Bin 881406 -> 881406 bytes
 16 files changed, 68 insertions(+), 659 deletions(-)
 delete mode 100644 hypha/public/partner/admin.py
 delete mode 100644 hypha/public/partner/admin_view.py
 create mode 100644 hypha/public/partner/migrations/0004_remove_investmentcategory_investment_and_more.py
 delete mode 100644 hypha/public/partner/tables.py
 delete mode 100644 hypha/public/partner/templates/partner/base_investments_table.html
 delete mode 100644 hypha/public/partner/templates/partner/includes/table_filter_and_search.html
 delete mode 100644 hypha/public/partner/templates/partner/investments.html
 delete mode 100644 hypha/public/partner/templates/partner/partner_page.html
 delete mode 100644 hypha/public/partner/templates/partner/table.html
 delete mode 100644 hypha/public/partner/views.py
 delete mode 100644 hypha/public/urls.py

diff --git a/docs/references/wagtail-admin.md b/docs/references/wagtail-admin.md
index d0ff3b801..44ad9510d 100644
--- a/docs/references/wagtail-admin.md
+++ b/docs/references/wagtail-admin.md
@@ -35,7 +35,6 @@ The WagTail Admin is your "back office" for setting up form applications and pub
 - Site history: Generates a report of user action logs.
 - Aging page
 - Public Site
-- Investments
 - Images
 - Documents: Store documents like reports for blog posts 
 - Snippets: Snippets allow you to create elements on a website once and reuse them in multiple places. Then, if you want to change something on the snippet, you only need to change it once, and it will change across all the occurrences of the snippet. How snippets are used can vary widely between websites. 
diff --git a/hypha/public/partner/admin.py b/hypha/public/partner/admin.py
deleted file mode 100644
index 75e520bfb..000000000
--- a/hypha/public/partner/admin.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
-
-from .admin_view import CreateInvestmentView, EditInvestmentView
-from .models import Investment
-
-
-class InvestmentAdmin(ModelAdmin):
-    model = Investment
-    create_view_class = CreateInvestmentView
-    edit_view_class = EditInvestmentView
-    form_fields_exclude = ("application",)
-    menu_label = "Investments"
-    menu_icon = "placeholder"
-    menu_order = 290
-    add_to_settings_menu = False
-    exclude_from_explorer = False
-    list_display = ("partner", "name", "amount_committed", "year")
-    list_filter = ("partner__title", "year", "amount_committed")
-    search_fields = ("name", "year")
-
-
-modeladmin_register(InvestmentAdmin)
diff --git a/hypha/public/partner/admin_view.py b/hypha/public/partner/admin_view.py
deleted file mode 100644
index 38391b709..000000000
--- a/hypha/public/partner/admin_view.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from wagtail.admin.panels import FieldPanel
-from wagtail.contrib.modeladmin.views import CreateView, EditView
-
-from .models import InvestmentCategorySettings
-
-
-class CreateInvestmentView(CreateView):
-    def get_form_kwargs(self):
-        kwargs = super(CreateInvestmentView, self).get_form_kwargs()
-        kwargs["request"] = self.request
-        return kwargs
-
-    def get_context_data(self):
-        context = super(CreateInvestmentView, self).get_context_data()
-        ics = InvestmentCategorySettings.for_request(self.request)
-        categories = ics.categories.all()
-        for category in categories:
-            field_name = category.name.lower().replace(" ", "_")
-            field_panel = FieldPanel(field_name).bind_to(
-                model=self.model,
-                instance=context["edit_handler"].instance,
-                request=context["edit_handler"].request,
-                form=context["form"],
-            )
-            context["edit_handler"].children.append(field_panel)
-        return context
-
-
-class EditInvestmentView(EditView):
-    def get_form_kwargs(self):
-        kwargs = super(EditInvestmentView, self).get_form_kwargs()
-        kwargs["request"] = self.request
-        return kwargs
-
-    def get_context_data(self):
-        context = super(EditInvestmentView, self).get_context_data()
-        ics = InvestmentCategorySettings.for_request(self.request)
-        categories = ics.categories.all()
-        for category in categories:
-            field_name = category.name.lower().replace(" ", "_")
-            field_panel = FieldPanel(field_name).bind_to(
-                model=self.model,
-                instance=context["edit_handler"].instance,
-                request=context["edit_handler"].request,
-                form=context["form"],
-            )
-            context["edit_handler"].children.append(field_panel)
-        return context
diff --git a/hypha/public/partner/migrations/0001_add_investments_table_and_partners_page.py b/hypha/public/partner/migrations/0001_add_investments_table_and_partners_page.py
index 662b016c6..2dc0dd5a2 100644
--- a/hypha/public/partner/migrations/0001_add_investments_table_and_partners_page.py
+++ b/hypha/public/partner/migrations/0001_add_investments_table_and_partners_page.py
@@ -3,7 +3,6 @@
 import django.core.validators
 from django.db import migrations, models
 import django.db.models.deletion
-import hypha.public.partner.models
 import wagtail.fields
 import wagtailcache.cache
 
@@ -35,12 +34,8 @@ class Migration(migrations.Migration):
                 (
                     "year",
                     models.IntegerField(
-                        default=hypha.public.partner.models.current_year,
+                        default=0,
                         help_text="Use format: <YYYY>",
-                        validators=[
-                            django.core.validators.MinValueValidator(1984),
-                            hypha.public.partner.models.max_value_current_year,
-                        ],
                     ),
                 ),
                 (
diff --git a/hypha/public/partner/migrations/0004_remove_investmentcategory_investment_and_more.py b/hypha/public/partner/migrations/0004_remove_investmentcategory_investment_and_more.py
new file mode 100644
index 000000000..74e873dc0
--- /dev/null
+++ b/hypha/public/partner/migrations/0004_remove_investmentcategory_investment_and_more.py
@@ -0,0 +1,67 @@
+# Generated by Django 4.2.9 on 2024-01-10 08:08
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+    dependencies = [
+        ("partner", "0003_remove_partnerindexpage_social_image_and_more"),
+    ]
+
+    operations = [
+        migrations.RemoveField(
+            model_name="investmentcategory",
+            name="investment",
+        ),
+        migrations.RemoveField(
+            model_name="investmentcategorysettings",
+            name="categories",
+        ),
+        migrations.RemoveField(
+            model_name="investmentcategorysettings",
+            name="site",
+        ),
+        migrations.RemoveField(
+            model_name="partnerindexpage",
+            name="header_image",
+        ),
+        migrations.RemoveField(
+            model_name="partnerindexpage",
+            name="listing_image",
+        ),
+        migrations.RemoveField(
+            model_name="partnerindexpage",
+            name="page_ptr",
+        ),
+        migrations.RemoveField(
+            model_name="partnerpage",
+            name="header_image",
+        ),
+        migrations.RemoveField(
+            model_name="partnerpage",
+            name="listing_image",
+        ),
+        migrations.RemoveField(
+            model_name="partnerpage",
+            name="logo",
+        ),
+        migrations.RemoveField(
+            model_name="partnerpage",
+            name="page_ptr",
+        ),
+        migrations.DeleteModel(
+            name="Investment",
+        ),
+        migrations.DeleteModel(
+            name="InvestmentCategory",
+        ),
+        migrations.DeleteModel(
+            name="InvestmentCategorySettings",
+        ),
+        migrations.DeleteModel(
+            name="PartnerIndexPage",
+        ),
+        migrations.DeleteModel(
+            name="PartnerPage",
+        ),
+    ]
diff --git a/hypha/public/partner/models.py b/hypha/public/partner/models.py
index 49f319cad..e69de29bb 100644
--- a/hypha/public/partner/models.py
+++ b/hypha/public/partner/models.py
@@ -1,215 +0,0 @@
-import datetime
-
-import babel.numbers
-from django import forms
-from django.conf import settings
-from django.core.validators import MaxValueValidator, MinValueValidator
-from django.db import models
-from django.http import Http404
-from django.shortcuts import redirect
-from django.utils.translation import gettext_lazy as _
-from pagedown.widgets import PagedownWidget
-from wagtail.admin.forms import WagtailAdminModelForm
-from wagtail.admin.panels import FieldPanel
-from wagtail.contrib.settings.models import BaseSiteSetting
-from wagtail.fields import RichTextField
-from wagtail.models import Page
-from wagtail.search import index
-
-from hypha.apply.categories.models import Category, Option
-from hypha.apply.funds.models import ApplicationSubmission
-from hypha.core.wagtail.admin import register_public_site_setting
-from hypha.public.utils.models import BasePage
-
-
-class PartnerIndexPage(BasePage):
-    parent_page_types = ["standardpages.IndexPage"]
-    subpage_types = ["partner.PartnerPage"]
-
-    introduction = models.TextField(blank=True)
-
-    content_panels = BasePage.content_panels + [
-        FieldPanel("introduction", widget=PagedownWidget()),
-    ]
-
-    search_fields = BasePage.search_fields + [
-        index.SearchField("introduction"),
-    ]
-
-    def serve(self, request, *args, **kwargs):
-        return redirect("investments")
-
-
-class PartnerPage(BasePage):
-    STATUS = [("active", "Active"), ("inactive", "Inactive")]
-
-    class Meta:
-        verbose_name = _("Partner Page")
-
-    parent_page_types = ["partner.PartnerIndexPage"]
-    subpage_types = []
-
-    status = models.CharField(choices=STATUS, default="current_partner", max_length=20)
-    public = models.BooleanField(default=True)
-    description = RichTextField(blank=True)
-    web_url = models.URLField(blank=True)
-    logo = models.OneToOneField(
-        "images.CustomImage",
-        null=True,
-        blank=True,
-        related_name="+",
-        on_delete=models.SET_NULL,
-    )
-
-    content_panels = Page.content_panels + [
-        FieldPanel("status"),
-        FieldPanel("public"),
-        FieldPanel("description"),
-        FieldPanel("web_url"),
-        FieldPanel("logo"),
-    ]
-
-    def __str__(self):
-        return self.title
-
-    def get_context(self, request):
-        context = super(PartnerPage, self).get_context(request)
-        context["total_investments"] = sum(
-            investment.amount_committed for investment in self.investments.all()
-        )
-        return context
-
-    def get_absolute_url(self):
-        return self.url
-
-    @property
-    def category_questions(self):
-        category_questions = {}
-        if not self.investments.exists():
-            return
-        for investment in self.investments.all():
-            for category in investment.categories.all():
-                if category.name in category_questions.keys():
-                    if category.value not in category_questions[category.name]:
-                        category_questions[category.name].append(category.value)
-                else:
-                    category_questions[category.name] = [category.value]
-        return category_questions
-
-    def serve(self, request, *args, **kwargs):
-        if not self.public:
-            raise Http404
-        return super(PartnerPage, self).serve(request, *args, **kwargs)
-
-
-def current_year():
-    return datetime.date.today().year
-
-
-def max_value_current_year(value):
-    return MaxValueValidator(current_year())(value)
-
-
-@register_public_site_setting
-class InvestmentCategorySettings(BaseSiteSetting):
-    class Meta:
-        verbose_name = _("Investment Category Settings")
-
-    categories = models.ManyToManyField(
-        Category,
-        help_text=_("Select the categories that should be used in investments."),
-    )
-
-    panels = [
-        FieldPanel("categories"),
-    ]
-
-
-class InvestmentCategory(models.Model):
-    investment = models.ForeignKey(
-        "Investment", on_delete=models.CASCADE, related_name="categories"
-    )
-    name = models.CharField(max_length=255, null=True, blank=True)
-    value = models.CharField(max_length=255, null=True, blank=True)
-
-    def __str__(self):
-        return f"{self.investment}: {self.name}: {self.value}"
-
-
-class InvestmentAdminForm(WagtailAdminModelForm):
-    def __init__(self, *args, **kwargs):
-        self.request = kwargs.pop("request", None)
-        super().__init__(*args, **kwargs)
-        ics = InvestmentCategorySettings.for_request(self.request)
-        self.categories = ics.categories.all()
-        for category in self.categories:
-            field_name = category.name.lower().replace(" ", "_")
-            self.fields[field_name] = forms.ModelChoiceField(
-                required=False,
-                queryset=category.options.all(),
-            )
-            if self.instance.name:
-                try:
-                    ic = InvestmentCategory.objects.get(
-                        investment=self.instance, name=category.name
-                    )
-                except InvestmentCategory.DoesNotExist:
-                    pass
-                else:
-                    self.initial[field_name] = Option.objects.get(value=ic.value)
-
-    def clean(self):
-        cleaned_data = super().clean()
-        return cleaned_data
-
-    def save(self, commit=True):
-        investment = super().save(commit)
-        for category in self.categories:
-            field_name = category.name.lower().replace(" ", "_")
-            value = self.cleaned_data[field_name].value
-            ic, _ = InvestmentCategory.objects.get_or_create(
-                investment=investment, name=category.name
-            )
-            ic.value = value
-            ic.save()
-        return investment
-
-
-class Investment(models.Model):
-    partner = models.ForeignKey(
-        PartnerPage, on_delete=models.CASCADE, related_name="investments"
-    )
-    name = models.CharField(max_length=50)
-    year = models.IntegerField(
-        default=current_year,
-        validators=[MinValueValidator(1984), max_value_current_year],
-        help_text=_("Use format: <YYYY>"),
-    )
-    amount_committed = models.DecimalField(
-        decimal_places=2,
-        default=0,
-        max_digits=11,
-        verbose_name=_("Amount Committed ({currency})").format(
-            currency=babel.numbers.get_currency_symbol(
-                settings.CURRENCY_CODE, locale=settings.CURRENCY_LOCALE
-            ).strip()
-        ),
-    )
-    description = models.TextField()
-    application = models.OneToOneField(
-        ApplicationSubmission, on_delete=models.SET_NULL, blank=True, null=True
-    )
-
-    created_at = models.DateTimeField(auto_now_add=True)
-    updated_at = models.DateTimeField(auto_now=True)
-
-    base_form_class = InvestmentAdminForm
-
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-        for category in self.categories.all():
-            field_name = category.name.lower().replace(" ", "_")
-            setattr(self, field_name, category.value)
-
-    def __str__(self):
-        return self.name
diff --git a/hypha/public/partner/tables.py b/hypha/public/partner/tables.py
deleted file mode 100644
index 03d43b4c6..000000000
--- a/hypha/public/partner/tables.py
+++ /dev/null
@@ -1,147 +0,0 @@
-import babel.numbers
-import django_filters as filters
-import django_tables2 as tables
-from django import forms
-from django.conf import settings
-from django.db.models import Q
-from django.utils.translation import gettext_lazy as _
-
-from hypha.apply.funds.tables import Select2MultipleChoiceFilter
-
-from .models import Investment, InvestmentCategorySettings, PartnerPage
-
-
-class YearMultipleChoiceFilter(Select2MultipleChoiceFilter):
-    def __init__(self, *args, **kwargs):
-        years = (
-            Investment.objects.order_by("-year")
-            .values_list("year", flat=True)
-            .distinct()
-        )
-        choices = [(year, str(year)) for year in years]
-        super().__init__(
-            *args,
-            field_name="year",
-            choices=choices,
-            label=_("Years"),
-            **kwargs,
-        )
-
-    def has_any(self, first, second):
-        return any(item in second for item in first)
-
-    def get_filter_predicate(self, v):
-        return {f"{ self.field_name }": v}
-
-
-class InvestmentFilter(filters.FilterSet):
-    PAGE_CHOICES = (
-        (25, "25"),
-        (50, "50"),
-        (100, "100"),
-    )
-
-    AMOUNT_COMMITTED_CHOICES = (
-        ("0_250k", "0 > 250k"),
-        ("250k_1m", "250k > 1m"),
-        ("1m+", "1m+"),
-    )
-
-    amount_committed = Select2MultipleChoiceFilter(
-        choices=AMOUNT_COMMITTED_CHOICES,
-        label=_("Amount Committed ({currency})").format(
-            currency=babel.numbers.get_currency_symbol(
-                settings.CURRENCY_CODE, locale=settings.CURRENCY_LOCALE
-            ).strip()
-        ),
-        method="filter_amount_committed",
-    )
-    partner__status = Select2MultipleChoiceFilter(
-        choices=PartnerPage.STATUS, label=_("Status")
-    )
-    per_page = filters.ChoiceFilter(
-        choices=PAGE_CHOICES,
-        empty_label=_("Items per page"),
-        label=_("Per page"),
-        method="per_page_handler",
-    )
-
-    class Meta:
-        model = Investment
-        fields = ("year", "amount_committed")
-
-    def __init__(self, *args, **kwargs):
-        super().__init__(*args, **kwargs)
-        self.filters["year"] = YearMultipleChoiceFilter()
-
-    def filter_amount_committed(self, queryset, name, value):
-        query = Q()
-        for v in value:
-            if v == "0_250k":
-                query |= Q(amount_committed__gte=0, amount_committed__lt=250000)
-            if v == "250k_1m":
-                query |= Q(amount_committed__gte=250000, amount_committed__lt=1000000)
-            if v == "1m+":
-                query |= Q(amount_committed__gte=1000000)
-        return queryset.filter(query)
-
-    def per_page_handler(self, queryset, name, value):
-        # Pagination is already implemented in view. We only need to add per_page query parameter.
-        return queryset
-
-
-class InvestmentFilterAndSearch(InvestmentFilter):
-    query = filters.CharFilter(
-        field_name="partner__title", lookup_expr="icontains", widget=forms.HiddenInput
-    )
-
-
-def make_row_class(record):
-    css_class = "all-investments-table__parent"
-    return css_class
-
-
-class InvestmentTable(tables.Table):
-    """Table for listing investments."""
-
-    partner = tables.Column(
-        verbose_name=_("Partner"),
-        linkify=True,
-        attrs={"td": {"class": "js-title title"}},
-    )
-    year = tables.Column(verbose_name=_("Year"))
-    status = tables.Column(accessor="partner__status", verbose_name=_("Status"))
-    amount_committed = tables.Column(verbose_name=_("Amount Committed"))
-    description = tables.Column(visible=False)
-
-    class Meta:
-        model = Investment
-        order_by = ("-updated_at",)
-        fields = ("partner", "year", "status", "amount_committed")
-        template_name = "partner/table.html"
-        row_attrs = {
-            "class": make_row_class,
-            "data-record-id": lambda record: record.id,
-        }
-        attrs = {"class": "all-investments-table"}
-        empty_text = _("No investments available")
-
-    def __init__(self, data, extra_columns=None, *args, **kwargs):
-        self.request = kwargs.pop("request", None)
-        extra_columns = extra_columns or []
-        ics = InvestmentCategorySettings.for_request(self.request)
-        categories = ics.categories.all()
-        for category in categories:
-            field_name = category.name.lower().replace(" ", "_")
-            extra_columns.append(
-                (
-                    field_name,
-                    tables.Column(
-                        orderable=False,
-                    ),
-                )
-            )
-        super().__init__(data, *args, **kwargs, extra_columns=extra_columns)
-
-    def render_amount_committed(self, value):
-        return f"{int(value):,}"
diff --git a/hypha/public/partner/templates/partner/base_investments_table.html b/hypha/public/partner/templates/partner/base_investments_table.html
deleted file mode 100644
index 465ff7ee9..000000000
--- a/hypha/public/partner/templates/partner/base_investments_table.html
+++ /dev/null
@@ -1,28 +0,0 @@
-{% extends "base.html" %}
-
-{% load static %}
-{% load render_table from django_tables2 %}
-{% load querystring from django_tables2 %}
-
-{% block extra_css %}
-    <link rel="stylesheet" href="{% static 'css/apply/fancybox.css' %}">
-    {{ filter.form.media.css }}
-{% endblock %}
-
-{% block content %}
-    {% block table %}
-        {% include "partner/includes/table_filter_and_search.html" with filter_form=filter_form search_term=search_term use_search=True filter_action=filter_action %}
-        {% render_table table %}
-    {% endblock %}
-{% endblock %}
-
-{% block extra_js %}
-    {{ filter.form.media.js }}
-    <script src="{% static 'js/apply/jquery.fancybox.min.js' %}"></script>
-    <script src="{% static 'js/apply/fancybox-global.js' %}"></script>
-    <script src="{% static 'js/public/all-investments-table.js' %}"></script>
-    <script src="{% static 'js/public/investment-tooltips.js' %}"></script>
-    <script src="{% static 'js/apply/symbol-es6.min.js' %}"></script>
-    <script src="{% static 'js/apply/url-search-params.js' %}"></script>
-    <script src="{% static 'js/public/investment-filters.js' %}"></script>
-{% endblock %}
diff --git a/hypha/public/partner/templates/partner/includes/table_filter_and_search.html b/hypha/public/partner/templates/partner/includes/table_filter_and_search.html
deleted file mode 100644
index a87def124..000000000
--- a/hypha/public/partner/templates/partner/includes/table_filter_and_search.html
+++ /dev/null
@@ -1,41 +0,0 @@
-{% load querystring from django_tables2 %}
-
-<div class="wrapper wrapper--table-actions js-table-actions">
-    <div class="actions-bar">
-        {# Left #}
-        <div class="actions-bar__inner actions-bar__inner--left">
-            <a class="button button--primary simplified__button" href="{% querystring '_export'='csv' %}">Download CSV</a>
-        </div>
-
-        {# Right #}
-        <div class="actions-bar__inner actions-bar__inner--right">
-            <button class="button button--filters js-toggle-filters">Filters</button>
-
-            {% if use_search|default:False %}
-                <form action="{{ search_action }}" method="get" role="search" class="form form--search-desktop">
-                    <button class="button button--search" type="submit" aria-label="Search">
-                        <svg class="icon icon--magnifying-glass icon--search"><use xlink:href="#magnifying-glass"></use></svg>
-                    </button>
-                    <input class="input input--search input--secondary" type="text" placeholder="Search {{ search_placeholder|default:"by partner" }}" name="query"{% if search_term %} value="{{ search_term }}"{% endif %} aria-label="Search input">
-                </form>
-            {% endif %}
-        </div>
-    </div>
-</div>
-
-<div class="filters {% if filter_classes %}{{filter_classes}}{% endif %}">
-    <div class="filters__header">
-        <button class="filters__button js-clear-filters">Clear</button>
-        <div>Filter by</div>
-        <button class="filters__button js-close-filters">Close</button>
-    </div>
-
-    <form action="{{ filter_action }}" method="get" class="form form--filters js-filter-form">
-        <ul class="form__filters select2">
-            {{ filter.form.as_ul }}
-            <li>
-                <button class="button button--primary" type="submit" value="Filter">Filter</button>
-            </li>
-        </ul>
-    </form>
-</div>
diff --git a/hypha/public/partner/templates/partner/investments.html b/hypha/public/partner/templates/partner/investments.html
deleted file mode 100644
index 5386c32ec..000000000
--- a/hypha/public/partner/templates/partner/investments.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% extends "partner/base_investments_table.html" %}
-{% block title %}Investments{% endblock %}
-{% block body_class %}light-grey-bg{% endblock %}
-{% block page_title %}Partners{% endblock %}
-{% block content %}
-    <div class="wrapper wrapper--large wrapper--inner-space-medium">
-        {% block table %}
-            {{ block.super }}
-        {% endblock %}
-    </div>
-{% endblock %}
diff --git a/hypha/public/partner/templates/partner/partner_page.html b/hypha/public/partner/templates/partner/partner_page.html
deleted file mode 100644
index 8be26a8aa..000000000
--- a/hypha/public/partner/templates/partner/partner_page.html
+++ /dev/null
@@ -1,30 +0,0 @@
-{% extends "base.html" %}
-
-{% load wagtailcore_tags wagtailimages_tags apply_tags %}
-
-{% block content %}
-    <section class="wrapper wrapper--small wrapper--inner-space-large wrapper--sidebar">
-        <div class="wrapper--sidebar--inner">
-
-            {{ page.description|richtext }}
-
-            <p class="list list--contact"><span>Status</span><br>{{ page.get_status_display }}</p><br>
-
-            {% if page.web_url %}
-                <p class="list list--contact"><span>Website</span><br><a href="{{ page.web_url }}">{{ page.web_url }}</a></p><br>
-            {% endif %}
-
-            {% for key, value in page.category_questions.items %}
-                <p class="list list--contact"><span>{{ key }}</span><br>{{ value|join:', ' }}</p><br>
-            {% endfor %}
-
-            <p class="list list--contact"><span>Total Investments: </span>{{ total_investments|format_number_as_currency }}</p>
-        </div>
-
-        <div>
-            {% if page.logo %}
-                {% image page.logo fill-210x235 class="image image--headshot-desktop" %}
-            {% endif %}
-        </div>
-    </section>
-{% endblock %}
diff --git a/hypha/public/partner/templates/partner/table.html b/hypha/public/partner/templates/partner/table.html
deleted file mode 100644
index dcb39e6b4..000000000
--- a/hypha/public/partner/templates/partner/table.html
+++ /dev/null
@@ -1,62 +0,0 @@
-{% extends 'django_tables2/table.html' %}
-{% load django_tables2 table_tags review_tags wagtailimages_tags i18n %}
-
-{% block table.tbody.row %}
-    <tr {{ row.attrs.as_html }}>
-        {% for column, cell in row.items %}
-            <td {{ column.attrs.td.as_html }}>
-                {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}
-            </td>
-        {% endfor %}
-    </tr>
-
-    {% with investment=row.record %}
-        <tr class="all-investments-table__child" data-parent-id="{{ investment.id }}">
-            <td colspan="{{ table.columns|length }}">
-                <table class="investment-meta">
-                    <tr class="investment-meta__row">
-                        <th><h6 class="heading heading--normal heading--no-margin">Investment Name</h6></th>
-                        <th><h6 class="heading heading--normal heading--no-margin">Investment Description</h6></th>
-                    </tr>
-                    <tr class="investment-meta__row investment-meta__row--black">
-                        <td>{{ investment.name }}</td>
-                        <td>{{ investment.description }}</td>
-                    </tr>
-                </table>
-            </td>
-        </tr>
-    {% endwith %}
-
-{% endblock %}
-
-{% block table.tbody.empty_text %}
-    <tr class="all-investments-table__empty"><td colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr>
-{% endblock table.tbody.empty_text %}
-
-{% block pagination %}
-    {% if table.page and table.paginator.num_pages > 1 %}
-        <ul class="pagination">
-            {% if table.page.has_previous %}
-                <li class="previous">
-                    <a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}">
-                        {% trans 'previous' %}
-                    </a>
-                </li>
-            {% endif %}
-            {% if table.page.has_previous or table.page.has_next %}
-                <li class="cardinality">
-                    <p>
-                        Page {{ table.page.number }}
-                    </p>
-                </li>
-            {% endif %}
-            {% if table.page.has_next %}
-                <li class="next">
-                    <a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}">
-                        {% trans 'next' %}
-                    </a>
-                </li>
-            {% endif %}
-        </ul>
-    {% endif %}
-{% endblock pagination %}
diff --git a/hypha/public/partner/views.py b/hypha/public/partner/views.py
deleted file mode 100644
index f3dc6ba9b..000000000
--- a/hypha/public/partner/views.py
+++ /dev/null
@@ -1,35 +0,0 @@
-from django_filters.views import FilterView
-from django_tables2.export.views import ExportMixin
-from django_tables2.paginators import LazyPaginator
-from django_tables2.views import SingleTableMixin
-
-from .models import Investment
-from .tables import InvestmentFilterAndSearch, InvestmentTable
-
-
-class InvestmentTableView(ExportMixin, SingleTableMixin, FilterView):
-    model = Investment
-    table_class = InvestmentTable
-    filterset_class = InvestmentFilterAndSearch
-    filter_action = ""
-    paginator_class = LazyPaginator
-    table_pagination = {"per_page": 25}
-    export_name = "investments"
-    template_name = "partner/investments.html"
-
-    def get_table_kwargs(self):
-        kwargs = super(InvestmentTableView, self).get_table_kwargs()
-        kwargs["request"] = self.request
-        return kwargs
-
-    def get_context_data(self, **kwargs):
-        search_term = self.request.GET.get("query")
-
-        return super().get_context_data(
-            search_term=search_term,
-            filter_action=self.filter_action,
-            **kwargs,
-        )
-
-    def get_queryset(self):
-        return Investment.objects.filter(partner__public=True)
diff --git a/hypha/public/urls.py b/hypha/public/urls.py
deleted file mode 100644
index 0c4ee8837..000000000
--- a/hypha/public/urls.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from django.urls import path
-
-from .partner import views as partner_views
-
-urlpatterns = [
-    path(
-        "about/portfolio/",
-        partner_views.InvestmentTableView.as_view(),
-        name="investments",
-    ),
-]
diff --git a/hypha/urls.py b/hypha/urls.py
index b1f628434..1d8ae4156 100644
--- a/hypha/urls.py
+++ b/hypha/urls.py
@@ -12,7 +12,6 @@ from wagtail.images.views.serve import ServeView
 
 from hypha.apply.users.urls import public_urlpatterns as user_urls
 from hypha.apply.utils.views import custom_wagtail_page_delete
-from hypha.public import urls as public_urls
 
 urlpatterns = [
     path("django-admin/", admin.site.urls),
@@ -29,7 +28,6 @@ urlpatterns = [
     path("sitemap.xml", sitemap),
     path("upload/", include(django_file_form_urls)),
     path("", include((user_urls, "users_public"))),
-    path("", include(public_urls)),
     path("", include("social_django.urls", namespace="social")),
     path("tinymce/", include("tinymce.urls")),
     path("select2/", include("django_select2.urls")),
diff --git a/public/sandbox_db.dump b/public/sandbox_db.dump
index ec648b1d11d2abed3755d72b5c40159196a6adeb..7b2ddbe33d73dd38ad0684f56012a5e20d207222 100644
GIT binary patch
delta 73
zcmezO)b!s|Q}F<I7vBIzJ_Z&JMn*;kAOI7ZjpD81jIH8Kt>VnB;w-J=tgYf~t>Wyh
Y;vB8woUP(qt>WCR;yhc$d7l>n0CGkUZ~y=R

delta 73
zcmezO)b!s|Q}F<I7vBIzJ_Z&JMn*;kAkYL6VvXXh;*720Os(R~t>P@L;;gOWY^~z#
Zt>PT5;+(DGT&?2Vt>Qde#d)6>0RVQY5QP8$

-- 
GitLab