codeforlife-portal 8.1.2__py2.py3-none-any.whl → 8.2.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of codeforlife-portal might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: codeforlife-portal
3
- Version: 8.1.2
3
+ Version: 8.2.0
4
4
  Classifier: Programming Language :: Python
5
5
  Classifier: Programming Language :: Python :: 3.12
6
6
  Classifier: Framework :: Django
@@ -94,6 +94,7 @@ deploy/middleware/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
94
94
  deploy/middleware/admin_access.py,sha256=-uF9Wgm7WPmNCEQ2Ti-rBXMrYJb0NnrIfnUdRIXzlWs,1207
95
95
  deploy/middleware/basicauth.py,sha256=DiSImGc9mepmsVK1Be5hc2iLnGzsOFx-S2i8AQnXMwY,1170
96
96
  deploy/middleware/exceptionlogging.py,sha256=qE3fJnaCwEslrCpF3k8jK1MeqldnvALPnlrUsiqV-5g,474
97
+ deploy/middleware/maintenance.py,sha256=JhlQD7FowzxnRxk1_uGXYRQ2Aas6v3C9BRxYgN1HLAY,932
97
98
  deploy/middleware/screentime_warning.py,sha256=-YmaOn9_RQwTU8C6VxDLWct_0G3Y5oHjAv9AvKZSvIw,1152
98
99
  deploy/middleware/security.py,sha256=LOZ-OUFo2dVhbRzI_KdSCMh4TItcJhhqzZg5zNAH-6Q,870
99
100
  deploy/middleware/session_timeout.py,sha256=Vfl6_9d8KwPsWRvCIcpBm7kWjgvHC8I7exJOejbyI4k,1023
@@ -106,23 +107,23 @@ deploy/static/robots.txt,sha256=5cS4RITuQhbpNzvpk4AyDCXdlIBfmfCoBYRvCHY2VT8,24
106
107
  deploy/templates/deploy/csrf_failure.html,sha256=-pBRPn4Y7nUdYHGpTHCokT9Boi-isuwuivF8V2K1SgM,412
107
108
  example_project/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
109
  example_project/manage.py,sha256=EUgybZlZ7xk2Zf2KCwBbK_z7gf7Ifqs0_bl4Kijhdgo,242
109
- example_project/portal_test_settings.py,sha256=7Q7SdosA0Ba85qz-xkAe3EHyMPpSIQ61CSlwYL4uNog,7321
110
- example_project/settings.py,sha256=NjFhtDNLwdY5vhUAtqk9a9m3GRfcuWRVqIqnJ3u0o6E,5658
110
+ example_project/portal_test_settings.py,sha256=mTyObCGkZEI0IQSZkqCjb1WZ7ebjQLwuiT_SykRnP6g,7315
111
+ example_project/settings.py,sha256=pHQDI_A_yXV3u1efj689tc-vPI6nBFma4gMMPBzj0aI,5652
111
112
  example_project/urls.py,sha256=FUTzHPlUS1O5kqMHjL5V4L552N2ln7uTDXcw9wjKUto,422
112
113
  example_project/wsgi.py,sha256=U1W6WzZxZaIdYZ5tks7w9fqp5WS5qvn2iThsVcskrWw,829
113
- portal/__init__.py,sha256=EsLdncrDNNSYcAkb6bacgIFA7Oh4EZnzpp9alKokT5A,22
114
+ portal/__init__.py,sha256=Xb24P8T6pG5QQaEw-UTO0iybyDoxvRGJaUR_qFoVAJQ,22
114
115
  portal/admin.py,sha256=RKJizTF6dPJKmGPZw7nZUM0X8jkiTjgyKhLQxtvHJ0I,6148
115
116
  portal/app_settings.py,sha256=DhWLQOwM0zVOXE3O5TNKbMM9K6agfLuCsHOdr1J7xEI,651
116
117
  portal/backends.py,sha256=2Dss6_WoQwPuDzJUF1yEaTQTNG4eUrD12ujJQ5cp5Tc,812
117
118
  portal/beta.py,sha256=0TCC-9_KZoM1nuzJ9FiuKR5n9JITdMYenHGQtRvn9UU,255
118
- portal/context_processors.py,sha256=Q68UhmArLPRchS2KmfVR4hKrijllXal3sO5cHYWC2Fc,222
119
+ portal/context_processors.py,sha256=1TrUZqnMqGa5f7ERph9EpBqojSMJvOrcpnJzTdeCLDI,133
119
120
  portal/handlers.py,sha256=gF99OfQrGcIGDnUyONhvylZNU8sl6XHYEurwu0fuiss,422
120
121
  portal/models.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
- portal/urls.py,sha256=9d7cV2O8CTMT_Y2Nlkfxxfw8NHa0bw_RKgQw4ddqsgk,18194
122
+ portal/urls.py,sha256=LFSumASmTGjFciMcc6OEFvJ1MWgFUS5wNRugGWON40E,18211
122
123
  portal/wsgi.py,sha256=3yRcNxBQG30NhzrVi93bX-DrbXtsIQBc70HiW5wbOyE,401
123
124
  portal/forms/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
124
125
  portal/forms/admin.py,sha256=Cdl8-wvasAzvMfgUlFYzQjYeuyC7gIsSiy8V_-jMp7w,2080
125
- portal/forms/dotmailer.py,sha256=j-o9qthQc7xmOsHSQGEEoHvaEyOpzlWrj6bOnV0PpsI,1567
126
+ portal/forms/dotmailer.py,sha256=AiHoN8ZRl3A69FYSldkjlhICGx_l4BujP5HjYdSRCok,897
126
127
  portal/forms/error_messages.py,sha256=8d3z_3e2L-5zwj5hFhnUByC5k2CEpIVVuJg2nYkCUQ8,148
127
128
  portal/forms/invite_teacher.py,sha256=jkDNcCfkts4_lXRzhcI3xBam21Zn2yX9wMpMVhDtW1w,880
128
129
  portal/forms/organisation.py,sha256=QcQyd7AiqBmvt4y8uQSQylguUbKOKqo2pjqWIkpWjDg,7433
@@ -268,7 +269,7 @@ portal/static/portal/img/colorboxImages/loading_background.png,sha256=lZ7Mxrcb7-
268
269
  portal/static/portal/img/colorboxImages/overlay.png,sha256=qy73bf_q55z4kktuaTaMhVrxDzVRCIjgmBQ5cbOmLtE,182
269
270
  portal/static/portal/js/bootstrap.min.js,sha256=nuL8_2cJ5NDSSwnKD8VqreErSWHtnEP9E7AySL-1ev4,39680
270
271
  portal/static/portal/js/carouselCards.js,sha256=IByMjKk37E-TCc3vx9nfF-IJWl9BOFPNVqf4WuD75GI,778
271
- portal/static/portal/js/common.js,sha256=kVUdm0luaqMLElbDq3Mht1k5DfkYHXAmJtce1Rekogg,7554
272
+ portal/static/portal/js/common.js,sha256=S39e0B75gycBQ2KEULPD-i-yZdM7vP-jvW3gIFTn5GU,6980
272
273
  portal/static/portal/js/independentLogin.js,sha256=wjjJBAF5arJ2iwW30lHTraG_f2FJ9UMGnXGpUSXwXIs,538
273
274
  portal/static/portal/js/independentRegistration.js,sha256=YWhIzwJcl0acU9weAKB7pWK76J1dpAuAQkI7DrUm3uA,2622
274
275
  portal/static/portal/js/join_create_game_toggle.js,sha256=eWxhMfzVKu1oft9iUFV4w8CgqMRv9-unb5P5cGi1h_4,393
@@ -395,19 +396,19 @@ portal/static/portal/sass/modules/_all.scss,sha256=k1U_FAKajqT8B3U53UT9B1Hc4jn5P
395
396
  portal/static/portal/sass/modules/_animation.scss,sha256=s75-4xRmPSmqwHUuyVy0OcnbS5jreRnotMXm-CuTLkE,39
396
397
  portal/static/portal/sass/modules/_breakpoints.scss,sha256=Nc7nrvjzQ0eK844ITuqwYcybIJxpYVFU5s30mz3BGOg,498
397
398
  portal/static/portal/sass/modules/_card_constants.scss,sha256=FUojcT5Fs-IYErt-frahD3HnVb06A515k4SQJrqVUfQ,107
398
- portal/static/portal/sass/modules/_colours.scss,sha256=Wen7UlF98ijyDjIEsLeIzLx0fcgXOLjavAVIh8PfqX0,4350
399
+ portal/static/portal/sass/modules/_colours.scss,sha256=6Wz1ev8T0nDmftQBWzUiCvOcJUrbkqQTCTisfnb-0Go,4250
399
400
  portal/static/portal/sass/modules/_homepage_constants.scss,sha256=GfSppJtWNxufu4hKO6vHX7YBQgmU1oB0KBonh-ltgv0,44
400
401
  portal/static/portal/sass/modules/_levels.scss,sha256=-PrZ21k_-sQAxYZB0uJd7macz46-VVwsQdmtxYyZYnA,106
401
402
  portal/static/portal/sass/modules/_mixins.scss,sha256=8xDWuApUG6B3pjadB4iHpJ87ehXCg0qqpabnVd2cgxU,1987
402
403
  portal/static/portal/sass/modules/_spacing.scss,sha256=WHBcd8ZSl4UHqPAOmW_JLt_MOfww44Hj8W42dWOpTO8,31
403
404
  portal/static/portal/sass/partials/_banners.scss,sha256=Q13Mybarzkq0GWvhStiqIuK_bgKku8wkqC6qCFIruEg,5658
404
405
  portal/static/portal/sass/partials/_base.scss,sha256=cUvskrzNXLA-Xg1EgpL-S0wTWDnRn86AcdMbE2_aLMM,26
405
- portal/static/portal/sass/partials/_buttons.scss,sha256=UR0a6ne8nZQyyWlWzVDD5RG2vfVe8w9rM5yWLBav3qM,9572
406
+ portal/static/portal/sass/partials/_buttons.scss,sha256=IoExpRV7Ng7wQ--jpOgnXC3D9SZqV95hM4bLEwNKNAw,8913
406
407
  portal/static/portal/sass/partials/_carousel.scss,sha256=m8N6jSuHBzeKyMUNGGc48NlNYTmotKlaiy10hwFnyWY,3500
407
408
  portal/static/portal/sass/partials/_footer.scss,sha256=oqt-Qvz7vtUFNnpe4FkQkaZk3J3fojCy9cKCxqGTWoM,2493
408
409
  portal/static/portal/sass/partials/_forms.scss,sha256=cbonSxhtfaHR-4R6i0u65AaIZRG_25C837CgZlLuwCI,7101
409
410
  portal/static/portal/sass/partials/_grids.scss,sha256=pnMQht5lZ65MRB-0_nl8yn655hlKC_oWCwZopillVwc,4968
410
- portal/static/portal/sass/partials/_header.scss,sha256=NmVmNasogxhrygApoqAY1KSmq_37eJROj0lstVr6MEY,7422
411
+ portal/static/portal/sass/partials/_header.scss,sha256=P2Sb3dyJjiPCpzbNE83HYWomBPfak8wHTO-q5S-qyQA,7339
411
412
  portal/static/portal/sass/partials/_images.scss,sha256=Fro4a0VfLo6FyrvGk5yjsjzzGKWVdHeMFJiVC96C7vk,6213
412
413
  portal/static/portal/sass/partials/_popup.scss,sha256=GQ6Vtmj3vdOP4Hvsf8ZxKdEtuL8gqoClYpDgQ19kvnQ,2280
413
414
  portal/static/portal/sass/partials/_progress-bars.scss,sha256=cTyRa9WLeIE0rETmY58Rcyf-8O6JE3iDTa_jw3mk23g,144
@@ -432,10 +433,11 @@ portal/templates/404.html,sha256=Tk6HmuzDdIT4ojoIHvH2MibU_0OekU5gmuJmk5M4K_Q,563
432
433
  portal/templates/500.html,sha256=aqJfDXPzaEw9K6LToPpE4rARuunLSxiIrJ_GnuJr8pI,1703
433
434
  portal/templates/email.html,sha256=MXB64zc1Sd34eIq8mGT1HhrjAiZUNvRx0_XjZllfKUU,268
434
435
  portal/templates/email.txt,sha256=z3bkT2WnkCrVa1RLVbGd-pE81cLEHlZ_QowfbSQAOvg,19
436
+ portal/templates/maintenance.html,sha256=RmPSkcTt9Vs6nGsIK9Q9rMyMAICqbaqMql4FmwL6Rak,1599
435
437
  portal/templates/django_recaptcha/widget_v2_invisible.html,sha256=3t5JHgyr_so5FQEUtbq501kEjz80KYBOoVz3PuU1JOc,318
436
438
  portal/templates/django_recaptcha/includes/js_v2_invisible.html,sha256=QQnBzZBqdtPeJeYFOIihJM18YoSUWbsGjuoMy-5gxNM,1408
437
439
  portal/templates/portal/about.html,sha256=_iD0GCP6q3-XuZ2LC-9O0KYY-mKL6c9qk3O-NRRqsRM,10321
438
- portal/templates/portal/base.html,sha256=4xLACNgKmRQTdEsdNNGYhLzMozzYzWIIzk31HrLGBf0,12109
440
+ portal/templates/portal/base.html,sha256=7fkLX5l48Puf63zlnhxdrD0utw8FwOAHCuXKvyijtuQ,11690
439
441
  portal/templates/portal/base_no_userprofile.html,sha256=PlRufyYmUUGWBZ6CvbYhJWOMTqKqdcee4xnO5--AogA,447
440
442
  portal/templates/portal/coding_club.html,sha256=DhPSIhxxzo6w0v80jXKVo_fjZ_TKnv7_u5cQq0woW8Q,5324
441
443
  portal/templates/portal/contribute.html,sha256=UIC_N3Lun9wB_6jEra0wvlT9fDiiIeMby7_onXYo6k0,4176
@@ -470,9 +472,8 @@ portal/templates/portal/partials/benefits.html,sha256=TZm4U_XimgivkPMjDXxxkV7PLf
470
472
  portal/templates/portal/partials/card_list.html,sha256=yHcp4oc0WRG9H6Ek871VCHbwYkDRcwQYbZ320gtsFn8,1550
471
473
  portal/templates/portal/partials/character_list.html,sha256=SnNFHzbIkOSaiRPIvSdplEf_B87UYgJ1pOvMltNDxLE,415
472
474
  portal/templates/portal/partials/delete_popup.html,sha256=nEhnwgnmKoFzb6LlCwdX973Em9bVOFh6MON36RPteYs,1275
473
- portal/templates/portal/partials/donate_popup.html,sha256=iPxXqIwZ-9_n4ssdUEiZ_GY3nbpes2AlcEKphL2Plno,2151
474
475
  portal/templates/portal/partials/footer.html,sha256=mJFsBJY1jfDUdujuceh0Y1bIXccIEWzbvEfsmNGl6D4,5036
475
- portal/templates/portal/partials/header.html,sha256=Qba01GARPeb5XAbZkWY__vA7D1LMFJ39085bLlOkaM0,20643
476
+ portal/templates/portal/partials/header.html,sha256=aRFgTy5JSQTqXSGUo7XQWd3a4Ia4auvJl3D3iNgJhm0,20250
476
477
  portal/templates/portal/partials/headline.html,sha256=xKb-WtkT0FyQqT0smyNSKkXFvU7KQ5Czad8ca6YKQg4,89
477
478
  portal/templates/portal/partials/hero_card.html,sha256=UN5hyxrw-McuXFsDzPBIECB9yGrv9VjsFf8SEBowwXc,786
478
479
  portal/templates/portal/partials/info_popup.html,sha256=gzffd5MBVb7p2hGQuZMNDudThrRgs847hCu9ziT9uLE,566
@@ -538,7 +539,7 @@ portal/tests/test_api.py,sha256=Yo5s_nEGOoG35jA39yZ6nuDOUZvuCZ8o8o8XhZos61w,1381
538
539
  portal/tests/test_captcha_forms.py,sha256=Yn_VYO_6jbq6AeKeLcv-YFL1YwXZpU0C3y7SK8fRUm4,1033
539
540
  portal/tests/test_class.py,sha256=MfR8fRsi0XjqS5cbeV19y3Be2RVhOLUHsAy_mjm7P70,17644
540
541
  portal/tests/test_emails.py,sha256=pLr06j3uMBxP1raoZQWzUTBVFvsEDFtUh85J8OnqCwE,9238
541
- portal/tests/test_global_forms.py,sha256=A5JpAe4AYK-wpu0o1qU4THmeNv_wr7lhzaMbjz5czpY,1543
542
+ portal/tests/test_global_forms.py,sha256=GIm_oSN4VsfaO--E2SMRu8CwVraan0UBj-_LE_tu8w0,833
542
543
  portal/tests/test_helper_methods.py,sha256=-SQCDZm2XUtyXGEp0CHIb_SSC9CPD-XOSnpnY8QclHk,890
543
544
  portal/tests/test_independent_student.py,sha256=NrRjTEr6V4WXpCE74N8LYNVocvLSvddkjuo3dYpfAZc,27245
544
545
  portal/tests/test_invite_teacher.py,sha256=gUe1spFp60v3i6kMqGoNgJd0OlBEcwplPPNYLomTJS4,12269
@@ -609,7 +610,7 @@ portal/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
609
610
  portal/views/about.py,sha256=-muXy17UhxCSKkjnMAkSLXiCvT_pBPlf2ykTYr794dI,443
610
611
  portal/views/admin.py,sha256=4Xt3zEyQH7sUwQSrwuRtoCodWidjOzd7gJUwWU96pXY,957
611
612
  portal/views/api.py,sha256=mdWmFkV5mxmR-mvj6ttIe8uwW9tbcx9-5ykk5dpX0LI,7047
612
- portal/views/dotmailer.py,sha256=x49p89TtwA1MLysRLtq5yRRzVtIpzGoU__Xb5hPuHak,3208
613
+ portal/views/dotmailer.py,sha256=OH06IXuqqjhQbEie8g8y2ZY1oZvsCtNHhkQRLa-julg,2467
613
614
  portal/views/email.py,sha256=V3wXRxIjeZ4OJBVqGCQrPn-GQWKZK1PCXbR1f2Zpa_4,2174
614
615
  portal/views/home.py,sha256=8leK4ADxRg-gK-bm7D08CR44bhV3I8lt5pCV59HXMkk,9619
615
616
  portal/views/legal.py,sha256=nUunsTHnhMcXBcDlg1GmUal86k9Vhinne4A2FWfq78M,342
@@ -633,8 +634,8 @@ portal/views/two_factor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
633
634
  portal/views/two_factor/core.py,sha256=Lk32z2SN2Pg0rRkK-N-LXMvXC1kKKsH3l692kiSDQ4E,964
634
635
  portal/views/two_factor/form.py,sha256=lnHNKI-BMlpncTuW3zUzjPaJJNuEra2I_nOam0eOKFY,257
635
636
  portal/views/two_factor/profile.py,sha256=SHSg_xHccE5PtD-OfuOkYhREYz_er4bj5ro1RjJ88Yw,393
636
- codeforlife_portal-8.1.2.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
637
- codeforlife_portal-8.1.2.dist-info/METADATA,sha256=8CmqSD1WWVfvsulf47gxjkpy2HNBNZvXZyycu_0anTI,3077
638
- codeforlife_portal-8.1.2.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
639
- codeforlife_portal-8.1.2.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
640
- codeforlife_portal-8.1.2.dist-info/RECORD,,
637
+ codeforlife_portal-8.2.0.dist-info/LICENSE.md,sha256=9AbRlCDqD2D1tPibimysFv3zg3AIc49-eyv9aEsyq9w,115
638
+ codeforlife_portal-8.2.0.dist-info/METADATA,sha256=ZSsWDJV-GTrgYnPCZ2sb5Q2_y3c2c_RaLoTN3QZudd4,3077
639
+ codeforlife_portal-8.2.0.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
640
+ codeforlife_portal-8.2.0.dist-info/top_level.txt,sha256=8e5pdsuIoTqEAMqpelHBjGjLbffcBtgOoggmd2q7nMw,41
641
+ codeforlife_portal-8.2.0.dist-info/RECORD,,
@@ -0,0 +1,25 @@
1
+ from django.http import HttpResponseRedirect
2
+ from django.urls import reverse, reverse_lazy
3
+
4
+
5
+ class MaintenanceMiddleware(object):
6
+ """
7
+ This middleware allows us to turn on "Maintenance Mode". Toggle `MAINTENANCE_MODE` to True in
8
+ `process_view` to redirect all requests in the app to the maintenance holding page.
9
+ """
10
+
11
+ def __init__(self, get_response):
12
+ self.get_response = get_response
13
+
14
+ def __call__(self, request):
15
+ response = self.get_response(request)
16
+ return response
17
+
18
+ def process_view(self, request, callback, callback_args, callback_kwargs):
19
+ MAINTENANCE_MODE = False
20
+
21
+ if MAINTENANCE_MODE and not request.path.startswith(reverse("maintenance")):
22
+ return HttpResponseRedirect(reverse_lazy("maintenance"))
23
+
24
+ if not MAINTENANCE_MODE and request.path.startswith(reverse("maintenance")):
25
+ return HttpResponseRedirect(reverse_lazy("home"))
@@ -157,6 +157,7 @@ MIDDLEWARE = [
157
157
  "preventconcurrentlogins.middleware.PreventConcurrentLoginsMiddleware",
158
158
  "csp.middleware.CSPMiddleware",
159
159
  "deploy.middleware.screentime_warning.ScreentimeWarningMiddleware",
160
+ "deploy.middleware.maintenance.MaintenanceMiddleware",
160
161
  ]
161
162
 
162
163
  TEMPLATES = [
@@ -172,7 +173,6 @@ TEMPLATES = [
172
173
  "common.context_processors.module_name",
173
174
  "common.context_processors.cookie_management_enabled",
174
175
  "portal.context_processors.process_newsletter_form",
175
- "portal.context_processors.process_donate_form",
176
176
  ]
177
177
  },
178
178
  }
@@ -115,6 +115,7 @@ MIDDLEWARE = [
115
115
  "preventconcurrentlogins.middleware.PreventConcurrentLoginsMiddleware",
116
116
  "csp.middleware.CSPMiddleware",
117
117
  "deploy.middleware.screentime_warning.ScreentimeWarningMiddleware",
118
+ "deploy.middleware.maintenance.MaintenanceMiddleware",
118
119
  ]
119
120
 
120
121
  TEMPLATES = [
@@ -130,7 +131,6 @@ TEMPLATES = [
130
131
  "common.context_processors.module_name",
131
132
  "common.context_processors.cookie_management_enabled",
132
133
  "portal.context_processors.process_newsletter_form",
133
- "portal.context_processors.process_donate_form",
134
134
  ]
135
135
  }
136
136
  }
portal/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "8.1.2"
1
+ __version__ = "8.2.0"
@@ -1,9 +1,5 @@
1
- from portal.forms.dotmailer import DonateForm, NewsletterForm
1
+ from portal.forms.dotmailer import NewsletterForm
2
2
 
3
3
 
4
4
  def process_newsletter_form(request):
5
5
  return {"news_form": NewsletterForm()}
6
-
7
-
8
- def process_donate_form(request):
9
- return {"donate_form": DonateForm()}
portal/forms/dotmailer.py CHANGED
@@ -19,28 +19,6 @@ class NewsletterForm(forms.Form):
19
19
  )
20
20
 
21
21
 
22
- class DonateForm(forms.Form):
23
- email = forms.EmailField(
24
- label="This data will only be used for this purpose and you will be "
25
- "able to opt out anytime. Please read our privacy notice for "
26
- "further details.",
27
- label_suffix="",
28
- widget=forms.EmailInput(
29
- attrs={
30
- "placeholder": "Enter your email address",
31
- "id": "donate_email_field",
32
- }
33
- ),
34
- help_text="Enter your email address",
35
- )
36
-
37
- age_verification = forms.BooleanField(
38
- widget=forms.CheckboxInput(attrs={"id": "donate_age_verification"}),
39
- initial=False,
40
- required=True,
41
- )
42
-
43
-
44
22
  class ConsentForm(forms.Form):
45
23
  email = forms.EmailField(
46
24
  label="Email",
@@ -38,24 +38,6 @@ function hidePopupConfirmation() {
38
38
  $("#popup").find(".popup-text").remove();
39
39
  }
40
40
 
41
- function showDonatePopup(title, text) {
42
- let popup = $("#donate-popup");
43
- popup.find(".popup-box__title").text(title);
44
- popup.find(".popup-box__msg").append(text);
45
-
46
- popup.addClass("popup--fade");
47
- }
48
-
49
- function hideDonatePopup() {
50
- $("#donate-popup").removeClass("popup--fade");
51
- $("#donate-popup").find(".popup-text").remove();
52
- $("#donate_email_field").val("");
53
- $('#donate_age_verification').prop("checked", false);
54
- const donateSubmitButton = $('#confirm_donate_button');
55
- donateSubmitButton.addClass("disabled");
56
- donateSubmitButton.prop("disabled", true);
57
- }
58
-
59
41
  function showDonateConfirmation(path) {
60
42
  let title = "We would love to have you support our non-profit mission! ❤️";
61
43
  let text =
@@ -63,9 +63,6 @@ $color-button-contained-disabled: $color-secondary-100;
63
63
  $color-button-outlined-border: $color-secondary-600;
64
64
  $color-button-outlined-border-active: $color-secondary-600;
65
65
  $color-button-subnav-border: white;
66
- $color-button-pill: #86ae18;
67
- $color-button-pill-hover: #82a210;
68
- $color-button-pill-active: #82a210;
69
66
  // Old buttons
70
67
  $color-button-primary-action-navigation: $color-secondary;
71
68
  $color-button-primary-action-navigation-hover: $color-secondary;
@@ -138,30 +138,6 @@ table {
138
138
  }
139
139
  }
140
140
 
141
- /* Green button */
142
- .button--tertiary {
143
- @include _padding(10px, 15px, 10px, 15px);
144
- background: $color-button-pill;
145
- color: $color-text-secondary;
146
-
147
- &:hover:not(.disabled){
148
- @include material-shadow();
149
- background: $color-button-pill-hover;
150
- color: $color-text-secondary;
151
- text-decoration: none;
152
- }
153
-
154
- &:active:not(.disabled) {
155
- background: $color-button-pill-active;
156
- color: $color-text-secondary;
157
- box-shadow: none;
158
- }
159
- }
160
-
161
- .button--pill {
162
- @include _border-radius-all(20px);
163
- }
164
-
165
141
  .button-right-arrow {
166
142
  &:after {
167
143
  content: "\e5e1";
@@ -437,13 +413,6 @@ td .button--primary {
437
413
  justify-content: center;
438
414
  }
439
415
 
440
- &.button--donate {
441
- background: $color-button-pill;
442
- border: 0;
443
- color: $color-text-secondary;
444
- justify-content: center;
445
- }
446
-
447
416
  &.button--header--login {
448
417
  border: 2px solid $color-secondary-600;
449
418
  margin: 0;
@@ -265,11 +265,6 @@
265
265
  font-weight: normal;
266
266
  }
267
267
 
268
- .button--pill:hover,
269
- .button--pill:focus, {
270
- font-weight: 600;
271
- }
272
-
273
268
  .button--menu--secondary {
274
269
  @include _padding($spacing * 3, 0px, $spacing * 3, 0px);
275
270
  }
@@ -0,0 +1,34 @@
1
+ {% load static %}
2
+ {% load app_tags %}
3
+ <!DOCTYPE html>
4
+ <html>
5
+ <head>
6
+ <title>Code For Life - maintenance</title>
7
+ <link rel="stylesheet" type="text/css" href="{% static 'portal.css' %}">
8
+ <link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500&display=swap" rel="stylesheet">
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
10
+ <link rel="shortcut icon" href="{% static 'portal/img/favicon.ico' %}" type="image/x-icon">
11
+ <link rel="icon" href="{% static 'portal/img/favicon.ico' %}" type="image/x-icon">
12
+ </head>
13
+ <body>
14
+ <div class="content-footer-wrapper">
15
+ <div id="contentWrapper">
16
+ {% block topBar %}
17
+ {% include 'portal/partials/header.html' %}
18
+ {% endblock topBar %}
19
+ <div class="content">
20
+ <div class="error-page background container">
21
+ <div class="row mx-0 d-flex justify-content-between">
22
+ <div class="flex-grow-1">
23
+ <h2>Works in progress!</h2>
24
+ <h5>Apologies! Dee is working on something important.</h5>
25
+ <p>The website is temporarily unavailable.</p>
26
+ </div>
27
+ <img title="Dee" alt="Dee" src="{% static 'portal/img/dee.png' %}"/>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </body>
34
+ </html>
@@ -81,7 +81,6 @@
81
81
  {% include "portal/tag_manager/tag_manager_body.html" %}
82
82
  {% render_block "js" %}
83
83
  {% include 'portal/mouseflow.html' %}
84
- {% include "portal/partials/donate_popup.html" %}
85
84
  <div class="content-footer-wrapper">
86
85
  {% block contentWrapper %}
87
86
  <div {% block pageID %}id="contentWrapper"{% endblock %}>
@@ -240,25 +239,16 @@
240
239
  });
241
240
  </script>
242
241
  <script>
243
- // disable newsletter signup and donate buttons by default
242
+ // disable newsletter signup button by default
244
243
  const newsletterSubmitButton = $('#submit_newsletter');
245
244
  newsletterSubmitButton.addClass("disabled");
246
245
  newsletterSubmitButton.prop("disabled", true);
247
246
 
248
- const donateSubmitButton = $('#confirm_donate_button');
249
- donateSubmitButton.addClass("disabled");
250
- donateSubmitButton.prop("disabled", true);
251
-
252
- // enable them or disable them depending on age verification checkbox
247
+ // enable them or disable it depending on age verification checkbox
253
248
  $('#id_age_verification').on("click", function() {
254
249
  newsletterSubmitButton.prop("disabled", !this.checked);
255
250
  newsletterSubmitButton.toggleClass("disabled", !this.checked);
256
251
  });
257
-
258
- $('#donate_age_verification').on("click", function() {
259
- donateSubmitButton.prop("disabled", !this.checked);
260
- donateSubmitButton.toggleClass("disabled", !this.checked);
261
- })
262
252
  </script>
263
253
  {% endblock scripts %}
264
254
  </body>
@@ -57,7 +57,6 @@
57
57
  <a class="button--menu button--menu--secondary button--menu--disabled">Games</a>
58
58
  <a class="button--menu button--menu--secondary button--menu--disabled">Teaching Resources</a>
59
59
  {% endif %}
60
- <button onclick="showDonateConfirmation()" class="button--menu button--pill button--tertiary">Donate</button>
61
60
  {% else %}
62
61
  {% if user|is_independent_student %}
63
62
  <div class="menu--title">Independent</div>
@@ -104,7 +103,6 @@
104
103
  <div class="menu__left-side col-md-5">
105
104
  <a href="{% url 'teach' %}" class="button--menu button--menu--primary button--menu--enabled">Teachers</a>
106
105
  <a href="{% url 'play' %}" class="button--menu button--menu--primary button--menu--enabled">Students</a>
107
- <button id="donate" onclick="showDonateConfirmation()" class="button--menu button--pill button--tertiary">Donate</button>
108
106
  {% endif %}
109
107
  </div>
110
108
  {% if user|is_logged_in %}
@@ -241,8 +239,6 @@
241
239
  {% else %}
242
240
  <a class="button button--menu__item button--register"
243
241
  href="{% url 'register' %}">Register now</a>
244
- <button onclick="showDonateConfirmation()"
245
- class="button--menu__item button--donate">Donate</button>
246
242
  <button class="button--menu__item button--menu__item--sub-header login"
247
243
  data-toggle="collapse" data-target="#login-tabs">Log in</button>
248
244
  <div id="login-tabs" class="collapse">
@@ -18,19 +18,3 @@ class TestGlobalForms(TestCase):
18
18
  response = client.post(url, data)
19
19
  messages = list(response.wsgi_request._messages)
20
20
  assert len([m for m in messages if "error" in m.tags]) == 1
21
-
22
- def test_donate_signup_successful(self):
23
- url = reverse("process_donate_form")
24
- client = Client()
25
- data = {"email": "valid_email@example.com", "age_verification": "on"}
26
- response = client.post(url, data)
27
- messages = list(response.wsgi_request._messages)
28
- assert len([m for m in messages if m.tags == "success"]) == 1
29
-
30
- def test_donate_signup_fail(self):
31
- url = reverse("process_donate_form")
32
- client = Client()
33
- data = {"email": "invalid_email", "age_verification": "on"}
34
- response = client.post(url, data)
35
- messages = list(response.wsgi_request._messages)
36
- assert len([m for m in messages if "error" in m.tags]) == 1
portal/urls.py CHANGED
@@ -37,7 +37,6 @@ from portal.views.api import (
37
37
  )
38
38
  from portal.views.dotmailer import (
39
39
  dotmailer_consent_form,
40
- process_donate_form,
41
40
  process_newsletter_form,
42
41
  )
43
42
  from portal.views.email import verify_email
@@ -279,9 +278,6 @@ urlpatterns = [
279
278
  process_newsletter_form,
280
279
  name="process_newsletter_form",
281
280
  ),
282
- re_path(
283
- r"^donate_signup/$", process_donate_form, name="process_donate_form"
284
- ),
285
281
  re_path(r"^consent_form/$", dotmailer_consent_form, name="consent_form"),
286
282
  re_path(
287
283
  r"^verify_email/$",
@@ -531,4 +527,9 @@ urlpatterns = [
531
527
  name="remove_fake_accounts",
532
528
  ),
533
529
  re_path(r"^celebrate/", ten_year_map_page, name="celebrate"),
530
+ re_path(
531
+ r"^maintenance/$",
532
+ TemplateView.as_view(template_name="maintenance.html"),
533
+ name="maintenance",
534
+ ),
534
535
  ]
portal/views/dotmailer.py CHANGED
@@ -12,7 +12,7 @@ from django.shortcuts import render
12
12
  from django.urls import reverse_lazy
13
13
  from django.views.decorators.csrf import csrf_exempt
14
14
 
15
- from portal.forms.dotmailer import NewsletterForm, DonateForm, ConsentForm
15
+ from portal.forms.dotmailer import NewsletterForm, ConsentForm
16
16
 
17
17
 
18
18
  @csrf_exempt
@@ -40,27 +40,6 @@ def process_newsletter_form(request):
40
40
  return HttpResponse(status=405)
41
41
 
42
42
 
43
- @csrf_exempt
44
- def process_donate_form(request):
45
- if request.method == "POST":
46
- donate_form = DonateForm(data=request.POST)
47
- if donate_form.is_valid():
48
- user_email = request.POST.get("email", "")
49
- add_to_dotmailer("", "", user_email, address_book_ids["donors"])
50
- messages.success(
51
- request, "Thank you for registering your interest! 🎉"
52
- )
53
- return HttpResponseRedirect(reverse_lazy("home"))
54
- messages.error(
55
- request,
56
- "Invalid email address. Please try again.",
57
- extra_tags="sub-nav--warning",
58
- )
59
- return HttpResponseRedirect(reverse_lazy("home"))
60
-
61
- return HttpResponse(status=405)
62
-
63
-
64
43
  def dotmailer_consent_form(request):
65
44
  if request.method == "POST":
66
45
  consent_form = ConsentForm(data=request.POST)
@@ -1,46 +0,0 @@
1
- {% load static %}
2
- {% load app_tags %}
3
- {# A popup with a form input for email addresses. #}
4
- <section id="donate-popup" class="popup-wrapper">
5
- <div class="popup-box">
6
- <div>
7
- <button type="button" onclick="hideDonatePopup()" class="close popup-box__close" aria-label="Close">
8
- <span class="iconify" data-icon="mdi:close"></span>
9
- </button>
10
- </div>
11
- <div class="popup-box__title"></div>
12
- <div class="popup-box__msg"></div>
13
- <form id="donate_form" action="{% url 'process_donate_form' %}"
14
- method="post">
15
- <div class="col-sm-12">
16
- {{ donate_form.non_field_errors }}
17
- <div class="form--row">
18
- <div class="form--row__input">
19
- <label><small>{{ donate_form.email.label }}</small></label>
20
- <div class="input--icon">
21
- {{ donate_form.email }}
22
- <span class="iconify" data-icon="mdi:email-outline"></span>
23
- </div>
24
- {{ donate_form.email.errors }}
25
- <small>{{ donate_form.email.help_text }}</small>
26
- </div>
27
- </div>
28
- <div class="form--row justify-content-between">
29
- <div class="form__checkbox">
30
- <div class="form__checkbox-input">
31
- {{ donate_form.age_verification }}
32
- </div>
33
- <p class="p-0">Please confirm that you are over 18.</p>
34
- </div>
35
- </div>
36
- </div>
37
- <div class="popup-box__buttons">
38
- <a class="button button--small button--secondary button--secondary--dark"
39
- onclick="hideDonatePopup()" aria-labelledby="cancel_button">Cancel</a>
40
- <button type="submit" id="confirm_donate_button"
41
- class='button button--small button--primary'
42
- aria-labelledby="confirm_button">Confirm</button>
43
- </div>
44
- </form>
45
- </div>
46
- </section>