From f6841f5fed5f0b26ab0e7b1e8f5f272828d39abe Mon Sep 17 00:00:00 2001 From: Eve Martin Date: Tue, 25 Jun 2024 12:39:47 +0000 Subject: [PATCH 01/14] start work --- portal/static/portal/img/world_map.svg | 977 ++++++++++++++++++++++ portal/strings/ten_year_map.py | 13 + portal/templates/portal/ten_year_map.html | 59 ++ portal/urls.py | 46 +- portal/views/ten_year_map.py | 9 + 5 files changed, 1088 insertions(+), 16 deletions(-) create mode 100644 portal/static/portal/img/world_map.svg create mode 100644 portal/strings/ten_year_map.py create mode 100644 portal/templates/portal/ten_year_map.html create mode 100644 portal/views/ten_year_map.py diff --git a/portal/static/portal/img/world_map.svg b/portal/static/portal/img/world_map.svg new file mode 100644 index 000000000..84c8e242e --- /dev/null +++ b/portal/static/portal/img/world_map.svg @@ -0,0 +1,977 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/portal/strings/ten_year_map.py b/portal/strings/ten_year_map.py new file mode 100644 index 000000000..574aea1e7 --- /dev/null +++ b/portal/strings/ten_year_map.py @@ -0,0 +1,13 @@ +TEN_YEAR_MAP_BANNER = { + "title": "Celebrate", + "subtitle": "Join us in celebrating our 10 year anniversary!", + "text": "", + "image_class": "banner--picture--educate", + "alt": "Female teacher helping young female student on a laptop", +} + +TEN_YEAR_MAP_HEADLINE = { + "title": "Code for Life is turning 10!", + "description": "For our 10th anniversary, we're going global! Check out these " + "events run by our amazing volunteers from around the world.", +} diff --git a/portal/templates/portal/ten_year_map.html b/portal/templates/portal/ten_year_map.html new file mode 100644 index 000000000..a468d319b --- /dev/null +++ b/portal/templates/portal/ten_year_map.html @@ -0,0 +1,59 @@ +{% extends 'portal/base.html' %} +{% load static %} +{% load app_tags banner_tags headline_tags character_list_tags %} + +{% block subNav %} +{% banner banner_name="BANNER" %} +{% endblock subNav %} + +{% block content %} + +
+ {% headline headline_name="HEADLINE" %} +
+ +
+ +
+ +
+ +
+
+
+
Starting with Blockly
+

TEST MAP PAGE

+

If you are not part of a school, you can register here.

+
+ + +
+
+ + Image of Rapid Router game with play button in bottom right corner + +
+
+
+ + + +{% endblock content %} diff --git a/portal/urls.py b/portal/urls.py index b83f7fdbf..d2846c9b5 100644 --- a/portal/urls.py +++ b/portal/urls.py @@ -1,24 +1,30 @@ from aimmo.urls import HOMEPAGE_REGEX from common.permissions import teacher_verified from django.conf.urls import include, url -from django.urls import path from django.http import HttpResponse +from django.urls import path from django.views.generic import RedirectView from django.views.generic.base import TemplateView from django.views.i18n import JavaScriptCatalog from game.views.level import play_default_level -from two_factor.views import BackupTokensView, ProfileView, QRGeneratorView, SetupCompleteView +from two_factor.views import ( + BackupTokensView, + ProfileView, + QRGeneratorView, + SetupCompleteView, +) from portal.helpers.decorators import ratelimit from portal.helpers.ratelimit import ( RATELIMIT_LOGIN_GROUP, - RATELIMIT_METHOD, RATELIMIT_LOGIN_RATE, RATELIMIT_LOGIN_RATE_SCHOOL_STUDENT, + RATELIMIT_METHOD, + school_student_key, ) -from portal.helpers.ratelimit import school_student_key from portal.helpers.regexes import ACCESS_CODE_REGEX, JWT_REGEX -from portal.views.about import about, getinvolved, contribute +from portal.views import cron +from portal.views.about import about, contribute, getinvolved from portal.views.admin import AdminChangePasswordDoneView, AdminChangePasswordView from portal.views.aimmo.dashboard import StudentAimmoDashboard, TeacherAimmoDashboard from portal.views.api import ( @@ -43,41 +49,50 @@ from portal.views.legal import privacy_notice, terms from portal.views.login import old_login_form_redirect from portal.views.login.independent_student import IndependentStudentLoginView -from portal.views.login.student import StudentLoginView, StudentClassCodeView, student_direct_login +from portal.views.login.student import ( + StudentClassCodeView, + StudentLoginView, + student_direct_login, +) from portal.views.login.teacher import TeacherLoginView from portal.views.organisation import organisation_leave, organisation_manage from portal.views.play_landing_page import play_landing_page from portal.views.registration import ( + delete_account, password_reset_check_and_confirm, password_reset_done, student_password_reset, teacher_password_reset, - delete_account, ) from portal.views.student.edit_account_details import ( - independentStudentEditAccountView, SchoolStudentEditAccountView, + independentStudentEditAccountView, student_edit_account, ) -from portal.views.student.play import SchoolStudentDashboard, IndependentStudentDashboard, student_join_organisation +from portal.views.student.play import ( + IndependentStudentDashboard, + SchoolStudentDashboard, + student_join_organisation, +) from portal.views.teach import teach from portal.views.teacher.dashboard import ( dashboard_manage, - organisation_kick, + delete_teacher_invite, invite_toggle_admin, + invited_teacher, + organisation_kick, organisation_toggle_admin, + resend_invite_teacher, teacher_accept_student_request, teacher_disable_2FA, teacher_reject_student_request, - delete_teacher_invite, - invited_teacher, - resend_invite_teacher, ) from portal.views.teacher.teach import ( teacher_class_password_reset, teacher_delete_class, teacher_delete_students, teacher_dismiss_students, + teacher_download_csv, teacher_edit_class, teacher_edit_student, teacher_move_students, @@ -85,11 +100,9 @@ teacher_onboarding_create_class, teacher_onboarding_edit_class, teacher_print_reminder_cards, - teacher_download_csv, teacher_view_class, ) -from portal.views import cron - +from portal.views.ten_year_map import ten_year_map_page from portal.views.two_factor.core import CustomSetupView from portal.views.two_factor.profile import CustomDisableView @@ -347,4 +360,5 @@ url(r"^codingClub/$", coding_club, name="codingClub"), url(r"^codingClub/(?P[3-4])/", download_student_pack, name="download_student_pack"), url(r"^removeFakeAccounts/", RemoveFakeAccounts.as_view(), name="remove_fake_accounts"), + url(r"^tenYears/", ten_year_map_page, name="tenYears"), ] diff --git a/portal/views/ten_year_map.py b/portal/views/ten_year_map.py new file mode 100644 index 000000000..49f2203c2 --- /dev/null +++ b/portal/views/ten_year_map.py @@ -0,0 +1,9 @@ +from django.shortcuts import render + +from portal.strings.ten_year_map import TEN_YEAR_MAP_BANNER, TEN_YEAR_MAP_HEADLINE + + +def ten_year_map_page(request): + return render( + request, "portal/ten_year_map.html", {"BANNER": TEN_YEAR_MAP_BANNER, "HEADLINE": TEN_YEAR_MAP_HEADLINE} + ) From 91de495d523adcdcb3ec3573a88e18999dbf8107 Mon Sep 17 00:00:00 2001 From: Eve Martin Date: Tue, 25 Jun 2024 16:09:17 +0000 Subject: [PATCH 02/14] add pins to map --- portal/static/portal/img/ten_year_map_pin.svg | 1 + portal/static/portal/img/world_map.svg | 2 +- portal/static/portal/js/tenYearMap.js | 18 ++++ .../static/portal/sass/partials/_images.scss | 6 ++ portal/templates/portal/ten_year_map.html | 100 +++++++++++++----- 5 files changed, 98 insertions(+), 29 deletions(-) create mode 100644 portal/static/portal/img/ten_year_map_pin.svg create mode 100644 portal/static/portal/js/tenYearMap.js diff --git a/portal/static/portal/img/ten_year_map_pin.svg b/portal/static/portal/img/ten_year_map_pin.svg new file mode 100644 index 000000000..232e86eb8 --- /dev/null +++ b/portal/static/portal/img/ten_year_map_pin.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/portal/static/portal/img/world_map.svg b/portal/static/portal/img/world_map.svg index 84c8e242e..e3b39f96d 100644 --- a/portal/static/portal/img/world_map.svg +++ b/portal/static/portal/img/world_map.svg @@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --> - + diff --git a/portal/static/portal/js/tenYearMap.js b/portal/static/portal/js/tenYearMap.js new file mode 100644 index 000000000..bebe4f092 --- /dev/null +++ b/portal/static/portal/js/tenYearMap.js @@ -0,0 +1,18 @@ +let currentActivePin; +let currentActiveCarousel; + +function setActivePin(city) { + if (currentActivePin) { + currentActivePin.setAttribute("fill", "#00A3E0"); + } + + currentActivePin = document.getElementById(city + "-pin").getElementsByTagName("svg")[0] + currentActivePin.setAttribute("fill", "#EE0857"); + + if (currentActiveCarousel) { + currentActiveCarousel.setAttribute("class", "item"); + } + + currentActiveCarousel = document.getElementById(city + "-carousel"); + currentActiveCarousel.setAttribute("class", "item active"); +} \ No newline at end of file diff --git a/portal/static/portal/sass/partials/_images.scss b/portal/static/portal/sass/partials/_images.scss index de16702ae..51c51b3b2 100644 --- a/portal/static/portal/sass/partials/_images.scss +++ b/portal/static/portal/sass/partials/_images.scss @@ -73,6 +73,12 @@ img { content: url("../img/logo_cfl.png"); } +.map-pin { + position: absolute; + background: 0 0; + min-width: 0px !important; +} + .glyphicon { @include _font-size(30px); font-weight: 500; diff --git a/portal/templates/portal/ten_year_map.html b/portal/templates/portal/ten_year_map.html index a468d319b..e6eb27c30 100644 --- a/portal/templates/portal/ten_year_map.html +++ b/portal/templates/portal/ten_year_map.html @@ -6,47 +6,78 @@ {% banner banner_name="BANNER" %} {% endblock subNav %} +{% block scripts %} +{{ block.super }} + +{% endblock scripts %} + {% block content %}
{% headline headline_name="HEADLINE" %}
-
-