diff --git a/hypha/apply/dashboard/templates/dashboard/dashboard.html b/hypha/apply/dashboard/templates/dashboard/dashboard.html index 512e79bb32af07109f3dced0725ed4356726825e..eaccf5f2a70de266d399ea92c9ab0e2238687d38 100644 --- a/hypha/apply/dashboard/templates/dashboard/dashboard.html +++ b/hypha/apply/dashboard/templates/dashboard/dashboard.html @@ -113,7 +113,7 @@ {% if my_reviewed.table.data %} <div class="wrapper wrapper--bottom-space"> {% trans "Your previous reviews" as review_heading %} - {% include "funds/includes/table_filter_and_search.html" with filter=my_reviewed.filterset filter_action=my_reviewed.url search_term=search_term search_action=my_reviewed.url use_search=True use_batch_actions=False heading=review_heading %} + <h2 class="heading heading--normal">{{ review_heading }}</h2> {% render_table my_reviewed.table %} {% if my_reviewed.display_more %} diff --git a/hypha/apply/dashboard/views.py b/hypha/apply/dashboard/views.py index 0665f4ae0258dd455a4f5b647c6fffee1f7fcad4..2edd5e9a24a3496a938b15653fb891a2630f9512 100644 --- a/hypha/apply/dashboard/views.py +++ b/hypha/apply/dashboard/views.py @@ -82,17 +82,18 @@ class AdminDashboardView(MyFlaggedMixin, TemplateView): context.update( { - "active_invoices": self.active_invoices(), "awaiting_reviews": self.awaiting_reviews(submissions), "can_export": can_export_submissions(self.request.user), "my_reviewed": self.my_reviewed(submissions), - "projects": self.projects(), "rounds": self.rounds(), "my_flagged": self.my_flagged(submissions), - "paf_for_review": self.paf_for_review(), "my_tasks": self.my_tasks(), } ) + if settings.PROJECTS_ENABLED: + context["projects"] = self.projects() + context["active_invoices"] = self.active_invoices() + context["paf_for_review"] = self.paf_for_review() return context diff --git a/hypha/apply/funds/models/utils.py b/hypha/apply/funds/models/utils.py index b8ead66526f2d296615dfae1d9a8d01a863ceeb9..ac643869c7febe2254c0bac61136c5121f4ae8e3 100644 --- a/hypha/apply/funds/models/utils.py +++ b/hypha/apply/funds/models/utils.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.db import models from django.shortcuts import redirect from django.urls import reverse @@ -144,12 +145,16 @@ class WorkflowStreamForm(WorkflowHelpers, AbstractStreamForm): # type: ignore help_text="Add a form to be used by external reviewers.", ), InlinePanel("determination_forms", label=_("Determination Forms")), - InlinePanel("approval_forms", label=_("Project Approval Form"), max_num=1), - InlinePanel("sow_forms", label=_("Project SOW Form"), max_num=1), - # The models technically allow for multiple Report forms but to start we permit only one in the UIs. - InlinePanel("report_forms", label=_("Project Report Form"), max_num=1), ] + if settings.PROJECTS_ENABLED: + content_panels += [ + InlinePanel("approval_forms", label=_("Project Approval Form"), max_num=1), + InlinePanel("sow_forms", label=_("Project SOW Form"), max_num=1), + # The models technically allow for multiple Report forms but to start we permit only one in the UIs. + InlinePanel("report_forms", label=_("Project Report Form"), max_num=1), + ] + class EmailForm(AbstractEmailForm): """ diff --git a/hypha/apply/funds/urls.py b/hypha/apply/funds/urls.py index 060cd40456aefd8f1793de340ee3789b261efcf7..da8e5bd0a24c07669a34f062678e1f28ab236823 100644 --- a/hypha/apply/funds/urls.py +++ b/hypha/apply/funds/urls.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.urls import include, path from django.views.generic import RedirectView @@ -238,9 +239,12 @@ rounds_urls = ( "rounds", ) - urlpatterns = [ path("submissions/", include(submission_urls)), path("rounds/", include(rounds_urls)), - path("projects/", include(projects_urls)), ] + +if settings.PROJECTS_ENABLED: + urlpatterns += [ + path("projects/", include(projects_urls)), + ] diff --git a/hypha/apply/projects/wagtail_hooks.py b/hypha/apply/projects/wagtail_hooks.py index 1c393532016fe5cc1777f6e673ae4e009e401315..ec4a970045ad1248cde825366a150bca92d049a8 100644 --- a/hypha/apply/projects/wagtail_hooks.py +++ b/hypha/apply/projects/wagtail_hooks.py @@ -1,5 +1,7 @@ +from django.conf import settings from wagtail.contrib.modeladmin.options import modeladmin_register from .admin import ProjectAdminGroup -modeladmin_register(ProjectAdminGroup) +if settings.PROJECTS_ENABLED: + modeladmin_register(ProjectAdminGroup) diff --git a/hypha/apply/utils/views.py b/hypha/apply/utils/views.py index f04e933d39e773eeeef55f6da19ca5ae1d017b0b..fcce16db59e02b7f57e4100e355a306941bd30f7 100644 --- a/hypha/apply/utils/views.py +++ b/hypha/apply/utils/views.py @@ -1,3 +1,4 @@ +from django.conf import settings from django.contrib.auth.decorators import login_required from django.db.models import ProtectedError from django.forms.models import ModelForm @@ -57,9 +58,9 @@ class ViewDispatcher(View): view = self.partner_view elif self.community_check(request): view = self.community_view - elif self.finance_check(request): + elif settings.PROJECTS_ENABLED and self.finance_check(request): view = self.finance_view - elif self.contracting_check(request): + elif settings.PROJECTS_ENABLED and self.contracting_check(request): view = self.contracting_view elif self.applicant_check(request): view = self.applicant_view