Repository: ocadotechnology/codeforlife-portal

Issue:
Link resources menu directly to Gitbook - remove explanatory pages
- [ ] Remove intermediary pages about gitbook (remove unused images)
- [ ] Update the related navbars (add icon @lauracumming  ?)
- [ ] Updates include teacher and independent student 


Discussion:
Hey team! Please [add your planning poker estimate](https://app.zenhub.com/workspaces/Code-for-Life-Development--56f2afba6e54555c586f6db3/issues/ocadotechnology/codeforlife-portal/1873?planning-poker) with Zenhub @faucomte97 @KamilPawel
There is an endpoint /materials, which checks that the user is logged in as a teacher and redirects them to the resources.  I guess that is to restrict access to the answers!  But the gitbook material doesn't have any access restriction - I guess that's because the material there is different now.  Is that right?

Resolving patch:
diff --git a/portal/urls.py b/portal/urls.py
--- a/portal/urls.py
+++ b/portal/urls.py
@@ -88,12 +88,7 @@
     teacher_download_csv,
     teacher_view_class,
 )
-from portal.views.teacher.teacher_resources import (
-    teacher_kurono_resources,
-    teacher_rapid_router_resources,
-    kurono_teaching_packs,
-    materials,
-)
+
 from portal.views.two_factor.core import CustomSetupView
 from portal.views.two_factor.profile import CustomDisableView
 
@@ -238,10 +233,6 @@
     url(r"^terms", terms, name="terms"),
     url(r"^privacy-notice/$", privacy_notice, name="privacy_notice"),
     url(r"^privacy-policy/$", privacy_notice, name="privacy_policy"),  # Keeping this to route from old URL
-    url(r"^teach/materials/$", materials, name="materials"),
-    url(r"^teach/kurono_teaching_packs$", kurono_teaching_packs, name="kurono_packs"),
-    url(r"^teach/resources/$", teacher_rapid_router_resources, name="teaching_resources"),
-    url(r"^teach/kurono_resources/$", teacher_kurono_resources, name="kurono_teaching_resources"),
     url(r"^teach/dashboard/$", dashboard_manage, name="dashboard"),
     url(r"^teach/dashboard/kick/(?P<pk>[0-9]+)/$", organisation_kick, name="organisation_kick"),
     url(r"^teach/dashboard/toggle_admin/(?P<pk>[0-9]+)/$", organisation_toggle_admin, name="organisation_toggle_admin"),
diff --git a/portal/views/teacher/teacher_resources.py b/portal/views/teacher/teacher_resources.py
deleted file mode 100644
--- a/portal/views/teacher/teacher_resources.py
+++ /dev/null
@@ -1,42 +0,0 @@
-from common.permissions import logged_in_as_teacher
-from django.contrib.auth.decorators import login_required, user_passes_test
-from django.http import HttpResponseRedirect
-from django.shortcuts import render
-from django.urls import reverse_lazy
-
-from portal.strings.teacher_resources import (
-    RAPID_ROUTER_RESOURCES_BANNER,
-    KURONO_RESOURCES_BANNER,
-)
-
-
-@login_required(login_url=reverse_lazy("teacher_login"))
-@user_passes_test(logged_in_as_teacher, login_url=reverse_lazy("teacher_login"))
-def teacher_rapid_router_resources(request):
-    return render(
-        request,
-        "portal/teach/teacher_resources.html",
-        {"BANNER": RAPID_ROUTER_RESOURCES_BANNER, "rapid_router_resources": True},
-    )
-
-
-@login_required(login_url=reverse_lazy("teacher_login"))
-@user_passes_test(logged_in_as_teacher, login_url=reverse_lazy("teacher_login"))
-def teacher_kurono_resources(request):
-    return render(
-        request,
-        "portal/teach/teacher_resources.html",
-        {"BANNER": KURONO_RESOURCES_BANNER},
-    )
-
-
-@login_required(login_url=reverse_lazy("teacher_login"))
-@user_passes_test(logged_in_as_teacher, login_url=reverse_lazy("teacher_login"))
-def materials(request):
-    return HttpResponseRedirect(reverse_lazy("teaching_resources"))
-
-
-@login_required(login_url=reverse_lazy("teacher_login"))
-@user_passes_test(logged_in_as_teacher, login_url=reverse_lazy("teacher_login"))
-def kurono_teaching_packs(request):
-    return HttpResponseRedirect(reverse_lazy("kurono_teaching_resources"))


Test patch:
diff --git a/portal/tests/test_security.py b/portal/tests/test_security.py
--- a/portal/tests/test_security.py
+++ b/portal/tests/test_security.py
@@ -82,7 +82,3 @@ def test_class_page_wrong_teacher(self):
         """Try and view a class page without being the teacher for that class."""
         self._test_incorrect_teacher_cannot_login("onboarding-class")
 
-    def test_anonymous_cannot_access_teaching_materials(self):
-        c = Client()
-        page = reverse_lazy("materials")
-        self.assertNotEqual(str(c.get(page).status_code)[0], 2)
diff --git a/portal/tests/test_teacher.py b/portal/tests/test_teacher.py
--- a/portal/tests/test_teacher.py
+++ b/portal/tests/test_teacher.py
@@ -473,26 +473,6 @@ def test_signup_login_success(self):
         page = page.login_no_school(email, password)
         assert self.is_onboarding_page(page)
 
-    def test_view_resources(self):
-        email, password = signup_teacher_directly()
-        create_organisation_directly(email)
-        _, _, access_code = create_class_directly(email)
-        create_school_student_directly(access_code)
-        self.selenium.get(self.live_server_url)
-        page = HomePage(self.selenium)
-        page = page.go_to_teacher_login_page()
-        page = page.login(email, password)
-
-        assert self.is_dashboard_page(page)
-
-        page = page.go_to_rapid_router_resources_page()
-
-        assert self.is_resources_page(page)
-
-        page = page.go_to_kurono_resources_page()
-
-        assert self.is_resources_page(page)
-
     def test_edit_details(self):
         email, password = signup_teacher_directly()
         create_organisation_directly(email)