From ec2865ff1efbef4752c5e9e2a7f3112f06166231 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jean-S=C3=A9bastien=20Caux?= <git@jscaux.org>
Date: Fri, 29 Oct 2021 04:35:52 +0200
Subject: [PATCH] Clean up portal files

---
 .../templates/scipost/acad_field_portal.html       | 14 --------------
 .../scipost/{ => portal}/_hx_publications.html     |  0
 .../{ => portal}/_hx_publications_page.html        |  0
 .../scipost/{ => portal}/_hx_submissions.html      |  0
 .../scipost/{ => portal}/_hx_submissions_page.html |  0
 .../templates/scipost/{ => portal}/portal.html     |  0
 scipost_django/scipost/urls.py                     |  4 ++--
 scipost_django/scipost/views.py                    |  6 +++---
 8 files changed, 5 insertions(+), 19 deletions(-)
 delete mode 100644 scipost_django/scipost/templates/scipost/acad_field_portal.html
 rename scipost_django/scipost/templates/scipost/{ => portal}/_hx_publications.html (100%)
 rename scipost_django/scipost/templates/scipost/{ => portal}/_hx_publications_page.html (100%)
 rename scipost_django/scipost/templates/scipost/{ => portal}/_hx_submissions.html (100%)
 rename scipost_django/scipost/templates/scipost/{ => portal}/_hx_submissions_page.html (100%)
 rename scipost_django/scipost/templates/scipost/{ => portal}/portal.html (100%)

diff --git a/scipost_django/scipost/templates/scipost/acad_field_portal.html b/scipost_django/scipost/templates/scipost/acad_field_portal.html
deleted file mode 100644
index d793672a7..000000000
--- a/scipost_django/scipost/templates/scipost/acad_field_portal.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{% extends 'scipost/base.html' %}
-
-{% load render_bundle from webpack_loader %}
-
-
-{% block content %}
-
-  <h1>{{ acad_field.name }} portal</h1>
-
-{% endblock content %}
-
-
-{% block footer_script %}
-{% endblock footer_script %}
diff --git a/scipost_django/scipost/templates/scipost/_hx_publications.html b/scipost_django/scipost/templates/scipost/portal/_hx_publications.html
similarity index 100%
rename from scipost_django/scipost/templates/scipost/_hx_publications.html
rename to scipost_django/scipost/templates/scipost/portal/_hx_publications.html
diff --git a/scipost_django/scipost/templates/scipost/_hx_publications_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_publications_page.html
similarity index 100%
rename from scipost_django/scipost/templates/scipost/_hx_publications_page.html
rename to scipost_django/scipost/templates/scipost/portal/_hx_publications_page.html
diff --git a/scipost_django/scipost/templates/scipost/_hx_submissions.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions.html
similarity index 100%
rename from scipost_django/scipost/templates/scipost/_hx_submissions.html
rename to scipost_django/scipost/templates/scipost/portal/_hx_submissions.html
diff --git a/scipost_django/scipost/templates/scipost/_hx_submissions_page.html b/scipost_django/scipost/templates/scipost/portal/_hx_submissions_page.html
similarity index 100%
rename from scipost_django/scipost/templates/scipost/_hx_submissions_page.html
rename to scipost_django/scipost/templates/scipost/portal/_hx_submissions_page.html
diff --git a/scipost_django/scipost/templates/scipost/portal.html b/scipost_django/scipost/templates/scipost/portal/portal.html
similarity index 100%
rename from scipost_django/scipost/templates/scipost/portal.html
rename to scipost_django/scipost/templates/scipost/portal/portal.html
diff --git a/scipost_django/scipost/urls.py b/scipost_django/scipost/urls.py
index 63f22f58b..851806ea3 100644
--- a/scipost_django/scipost/urls.py
+++ b/scipost_django/scipost/urls.py
@@ -84,7 +84,7 @@ urlpatterns = [
     # HTMX-delivered fragments
     path(
         '_hx_publications',
-        TemplateView.as_view(template_name='scipost/_hx_publications.html'),
+        TemplateView.as_view(template_name='scipost/portal/_hx_publications.html'),
         name='_hx_publications'
     ),
     path(
@@ -94,7 +94,7 @@ urlpatterns = [
     ),
     path(
         '_hx_submissions',
-        TemplateView.as_view(template_name='scipost/_hx_submissions.html'),
+        TemplateView.as_view(template_name='scipost/portal/_hx_submissions.html'),
         name='_hx_submissions'
     ),
     path(
diff --git a/scipost_django/scipost/views.py b/scipost_django/scipost/views.py
index ae3be955e..e6fab9ade 100644
--- a/scipost_django/scipost/views.py
+++ b/scipost_django/scipost/views.py
@@ -175,7 +175,7 @@ def portal(request):
     if request.GET.get('field', None):
         request.session['session_acad_field_slug'] = request.GET.get('field', None)
     request.session['session_specialty_slug'] = ''
-    return render(request, 'scipost/portal.html')
+    return render(request, 'scipost/portal/portal.html')
 
 
 def _hx_publications_page(request):
@@ -190,7 +190,7 @@ def _hx_publications_page(request):
     page_nr = request.GET.get('page')
     page_obj = paginator.get_page(page_nr)
     context = { 'page_obj': page_obj }
-    return render(request, 'scipost/_hx_publications_page.html', context)
+    return render(request, 'scipost/portal/_hx_publications_page.html', context)
 
 
 def _hx_submissions_page(request):
@@ -205,7 +205,7 @@ def _hx_submissions_page(request):
     page_nr = request.GET.get('page')
     page_obj = paginator.get_page(page_nr)
     context = { 'page_obj': page_obj }
-    return render(request, 'scipost/_hx_submissions_page.html', context)
+    return render(request, 'scipost/portal/_hx_submissions_page.html', context)
 
 
 def _hx_news(request):
-- 
GitLab