From c3dc038c312e8247569edaa93abd741201655f23 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 23 Oct 2018 10:40:25 +0200 Subject: [PATCH 1/2] script to open/close menu --- rowers/templates/list_workouts.html | 2 +- rowers/templates/menu_analytics.html | 2 ++ rowers/templates/menu_help.html | 2 ++ rowers/templates/menu_plan.html | 2 ++ rowers/templates/menu_profile.html | 2 ++ rowers/templates/menu_racing.html | 2 ++ rowers/templates/menu_teams.html | 1 + rowers/templates/menu_workout.html | 2 ++ rowers/templates/menu_workouts.html | 2 ++ rowers/templates/menuscript.html | 21 +++++++++++++++++++++ 10 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 rowers/templates/menuscript.html diff --git a/rowers/templates/list_workouts.html b/rowers/templates/list_workouts.html index 05b513eb..5214ee8a 100644 --- a/rowers/templates/list_workouts.html +++ b/rowers/templates/list_workouts.html @@ -1,7 +1,7 @@ {% extends "newbase.html" %} {% load staticfiles %} {% load rowerfilters %} -xo + {% block title %}Rowsandall Workouts List{% endblock %} {% block scripts %} diff --git a/rowers/templates/menu_analytics.html b/rowers/templates/menu_analytics.html index 6d92023e..f9c50cda 100644 --- a/rowers/templates/menu_analytics.html +++ b/rowers/templates/menu_analytics.html @@ -93,3 +93,5 @@ {% endif %} {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_help.html b/rowers/templates/menu_help.html index 9e88aa21..dab9640a 100644 --- a/rowers/templates/menu_help.html +++ b/rowers/templates/menu_help.html @@ -22,3 +22,5 @@ + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_plan.html b/rowers/templates/menu_plan.html index 7ddb10d6..ee1e2cb2 100644 --- a/rowers/templates/menu_plan.html +++ b/rowers/templates/menu_plan.html @@ -160,3 +160,5 @@ {% endif %} {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_profile.html b/rowers/templates/menu_profile.html index 8bcdfc7c..8fda9f4a 100644 --- a/rowers/templates/menu_profile.html +++ b/rowers/templates/menu_profile.html @@ -53,3 +53,5 @@ {% endif %} {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_racing.html b/rowers/templates/menu_racing.html index 95660480..9eb8e11f 100644 --- a/rowers/templates/menu_racing.html +++ b/rowers/templates/menu_racing.html @@ -54,3 +54,5 @@ {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_teams.html b/rowers/templates/menu_teams.html index e0696a4e..d7006e7d 100644 --- a/rowers/templates/menu_teams.html +++ b/rowers/templates/menu_teams.html @@ -92,3 +92,4 @@ {% endif %} +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_workout.html b/rowers/templates/menu_workout.html index ec62b95e..d79def7f 100644 --- a/rowers/templates/menu_workout.html +++ b/rowers/templates/menu_workout.html @@ -300,3 +300,5 @@ {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menu_workouts.html b/rowers/templates/menu_workouts.html index 738c9130..b4af3e51 100644 --- a/rowers/templates/menu_workouts.html +++ b/rowers/templates/menu_workouts.html @@ -62,3 +62,5 @@ {% endif %} {% endif %} + +{% include 'menuscript.html' %} diff --git a/rowers/templates/menuscript.html b/rowers/templates/menuscript.html new file mode 100644 index 00000000..6f7c5651 --- /dev/null +++ b/rowers/templates/menuscript.html @@ -0,0 +1,21 @@ + + From c967d495f170519d3d4de7c8bf02519b4bf368a6 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 23 Oct 2018 10:56:26 +0200 Subject: [PATCH 2/2] clearing local storage on logout --- rowers/templates/.#menuscript.html | 1 + rowers/templates/menuscript.html | 2 ++ rowers/templates/registration/login.html | 2 ++ templates/newbase.html | 15 ++++++++++++++- 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 rowers/templates/.#menuscript.html diff --git a/rowers/templates/.#menuscript.html b/rowers/templates/.#menuscript.html new file mode 100644 index 00000000..9a681b55 --- /dev/null +++ b/rowers/templates/.#menuscript.html @@ -0,0 +1 @@ +E408191@CZ27LT9RCGN72.14924:1540272798 \ No newline at end of file diff --git a/rowers/templates/menuscript.html b/rowers/templates/menuscript.html index 6f7c5651..455a0fb9 100644 --- a/rowers/templates/menuscript.html +++ b/rowers/templates/menuscript.html @@ -8,7 +8,9 @@ function(i, obj) { var theid = $(this).attr('id'); var state = localStorage.getItem(theid); + if (state !== null) { $(this).find('input:first').prop("checked",state); + }; }); }); $(function() { diff --git a/rowers/templates/registration/login.html b/rowers/templates/registration/login.html index 10e2f027..e2d74eb2 100644 --- a/rowers/templates/registration/login.html +++ b/rowers/templates/registration/login.html @@ -41,3 +41,5 @@ {% endblock %} + + diff --git a/templates/newbase.html b/templates/newbase.html index 9f2c7401..c9390afa 100644 --- a/templates/newbase.html +++ b/templates/newbase.html @@ -163,7 +163,7 @@
  • - +
  • @@ -380,3 +380,16 @@ {% block body_bottom %}{% endblock %} + + +