+
diff --git a/home/tests/test_resource_link.py b/home/tests/test_resource_link.py
new file mode 100644
index 00000000..29deb720
--- /dev/null
+++ b/home/tests/test_resource_link.py
@@ -0,0 +1,29 @@
+from django.test import TestCase
+from django.urls import reverse
+
+from home.factories import ResourceLinkFactory
+
+
+class ResourceLinkViewTests(TestCase):
+ @classmethod
+ def setUpTestData(cls):
+ cls.resource_link = ResourceLinkFactory.create()
+ cls.url = reverse("resource_link", kwargs={"path": cls.resource_link.path})
+
+ def test_get(self):
+ response = self.client.get(self.url)
+ self.assertRedirects(
+ response, self.resource_link.url, fetch_redirect_response=False
+ )
+
+ def test_get_not_found(self):
+ response = self.client.get(
+ reverse("resource_link", kwargs={"path": "not-found"})
+ )
+ self.assertEqual(response.status_code, 404)
+
+ def test_post(self):
+ response = self.client.post(self.url)
+ self.assertRedirects(
+ response, self.resource_link.url, fetch_redirect_response=False
+ )
diff --git a/home/urls.py b/home/urls.py
index eb44871d..06fb1aef 100644
--- a/home/urls.py
+++ b/home/urls.py
@@ -1,6 +1,7 @@
from django.urls import path
from .views import CreateUserSurveyResponseFormView
+from .views import resource_link
from .views import event_calendar
from .views import EventDetailView
from .views import EventListView
@@ -28,4 +29,5 @@
UserSurveyResponseView.as_view(),
name="user_survey_response",
),
+ path("resource/
", resource_link, name="resource_link"),
]
diff --git a/home/views.py b/home/views.py
index d0a3c42e..7d1170dd 100644
--- a/home/views.py
+++ b/home/views.py
@@ -4,7 +4,7 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import UserPassesTestMixin
from django.db.models import Prefetch
-from django.shortcuts import render
+from django.shortcuts import render, get_object_or_404, redirect
from django.urls import reverse_lazy
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormMixin
@@ -18,6 +18,7 @@
from .models import Survey
from .models import UserQuestionResponse
from .models import UserSurveyResponse
+from .models import ResourceLink
def event_calendar(request):
@@ -178,3 +179,7 @@ def get_context_data(self, **kwargs):
kwargs["read_only"] = True
context_data = super().get_context_data(**kwargs)
return context_data
+
+
+def resource_link(request, path):
+ return redirect(get_object_or_404(ResourceLink, path=path).url)
diff --git a/indymeet/templates/base.html b/indymeet/templates/base.html
index 8687a7a7..57da074a 100644
--- a/indymeet/templates/base.html
+++ b/indymeet/templates/base.html
@@ -42,6 +42,11 @@
--main-color: {{blog_page.main_color}};
}
+ {# Fontawesome #}
+
+
+
+
{% tailwind_css %}
{% endblock css %}
diff --git a/indymeet/templates/base_landing.html b/indymeet/templates/base_landing.html
index 4a3740e6..037f34ab 100644
--- a/indymeet/templates/base_landing.html
+++ b/indymeet/templates/base_landing.html
@@ -32,17 +32,17 @@
{# temporary cdn #}
-
-
-
-
+
+
+
+
{% tailwind_css %}
{% endblock css %}
-
+
{% if 'Home' not in page.title %}
{% include 'includes/breadcrumbs.html' %}
{% endif %}
diff --git a/indymeet/templates/includes/footer.html b/indymeet/templates/includes/footer.html
index 868262a4..6001f0ac 100644
--- a/indymeet/templates/includes/footer.html
+++ b/indymeet/templates/includes/footer.html
@@ -4,18 +4,27 @@
-