From f8ffbdbc422d2f26a8d69511c41920ef57501c81 Mon Sep 17 00:00:00 2001 From: Bradley Erickson Date: Mon, 24 Feb 2025 17:34:56 -0500 Subject: [PATCH 1/2] updated homepage --- VERSION | 2 +- learning_observer/VERSION | 2 +- .../static/modules/course.html | 71 +++++++++++----- .../learning_observer/static/webapp.html | 84 ++++++++++--------- .../learning_observer/static/webapp.js | 38 +++++++-- 5 files changed, 123 insertions(+), 74 deletions(-) diff --git a/VERSION b/VERSION index a8ceee52..ba22614d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+2025.01.02T16.11.54.892Z.0ba3c08e.berickson.requirements.cleanup +0.1.0+2025.02.24T22.34.56.392Z.e6d405f7.berickson.course.list.homepage.improvements diff --git a/learning_observer/VERSION b/learning_observer/VERSION index f6be1883..ba22614d 100644 --- a/learning_observer/VERSION +++ b/learning_observer/VERSION @@ -1 +1 @@ -0.1.0+2024.12.20T14.09.00.406Z.257bae3a.master +0.1.0+2025.02.24T22.34.56.392Z.e6d405f7.berickson.course.list.homepage.improvements diff --git a/learning_observer/learning_observer/static/modules/course.html b/learning_observer/learning_observer/static/modules/course.html index 9ed7bf55..924ad98e 100644 --- a/learning_observer/learning_observer/static/modules/course.html +++ b/learning_observer/learning_observer/static/modules/course.html @@ -6,38 +6,63 @@
- {{{ tools }}} + {{{ tools }}}

- {{ descriptionHeading }}

+ {{ description_heading }}

- - - diff --git a/learning_observer/learning_observer/static/webapp.html b/learning_observer/learning_observer/static/webapp.html index 5238f5d2..cf57a334 100644 --- a/learning_observer/learning_observer/static/webapp.html +++ b/learning_observer/learning_observer/static/webapp.html @@ -1,57 +1,61 @@ - - - - - - - - - - - Writing Analysis - - - -
+ + + + + + + + + + + + Writing Analysis + + + + +
- +
-
- - +
+ + + \ No newline at end of file diff --git a/learning_observer/learning_observer/static/webapp.js b/learning_observer/learning_observer/static/webapp.js index d1626e70..37a4e78b 100644 --- a/learning_observer/learning_observer/static/webapp.js +++ b/learning_observer/learning_observer/static/webapp.js @@ -31,6 +31,19 @@ function ajax(config) } } +function initializeBurgerMenu() { + console.log('initializing burger menu'); + document.querySelectorAll('.navbar-burger').forEach(burger => { + burger.addEventListener('click', () => { + const target = burger.dataset.target; + const targetMenu = document.getElementById(target); + burger.classList.toggle('is-active'); + targetMenu.classList.toggle('is-active'); + }); + }); +} + + requirejs( // TODO: Clean up absolute paths. We hardcoded these for now, due to refactor. @@ -52,11 +65,12 @@ requirejs( function(config, tool_list, d3, mustache, showdown, fontawesome, unauth, login, courses, course, tool, navbar_li, info, auth_info) { // Parse client configuration. config = JSON.parse(config); - console.log(tool_list); + // console.log(tool_list); tool_list = JSON.parse(tool_list); - console.log(tool_list); - console.log(auth_info); - console.log(JSON.stringify(auth_info)); + // console.log(tool_list); + // console.log(auth_info); + // console.log(JSON.stringify(auth_info)); + // Add libraries config.d3 = d3; config.ajax = ajax(config); @@ -152,7 +166,7 @@ requirejs( // * course_json are the course properties // Merged, we can render tools for courses! joined = Object.assign({}, course_json, tool_list[i]); - console.log(joined); + // console.log(joined); tools += mustache.render(tool, joined); } course_json['tools'] = tools; @@ -225,10 +239,16 @@ requirejs( } function loggedin_navbar_menu() { - d3.select(".main-navbar-menu").html(mustache.render(navbar_li, { - 'user_name': user_info()['name'], - 'user_picture': user_info()['picture'] - })); + const navbarMenu = d3.select("#mainNavbar"); + const navbarBurger = d3.select(".navbar-burger"); + + navbarMenu.html(mustache.render(navbar_li, { + 'user_name': user_info()['name'], + 'user_picture': user_info()['picture'] + })); + navbarMenu.classed("is-hidden", false); + navbarBurger.classed("is-hidden", false); + initializeBurgerMenu(); } function setup_page() { From fe62f067a32e76fbd80065a51c64983ee51ebafe Mon Sep 17 00:00:00 2001 From: Bradley Erickson Date: Tue, 1 Apr 2025 10:51:04 -0400 Subject: [PATCH 2/2] small updates --- VERSION | 2 +- learning_observer/VERSION | 2 +- learning_observer/learning_observer/static/webapp.html | 2 +- learning_observer/learning_observer/static/webapp.js | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index ba22614d..3b7eea53 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0+2025.02.24T22.34.56.392Z.e6d405f7.berickson.course.list.homepage.improvements +0.1.0+2025.04.01T14.51.04.751Z.f8ffbdbc.berickson.course.list.homepage.improvements diff --git a/learning_observer/VERSION b/learning_observer/VERSION index ba22614d..3b7eea53 100644 --- a/learning_observer/VERSION +++ b/learning_observer/VERSION @@ -1 +1 @@ -0.1.0+2025.02.24T22.34.56.392Z.e6d405f7.berickson.course.list.homepage.improvements +0.1.0+2025.04.01T14.51.04.751Z.f8ffbdbc.berickson.course.list.homepage.improvements diff --git a/learning_observer/learning_observer/static/webapp.html b/learning_observer/learning_observer/static/webapp.html index cf57a334..9effc938 100644 --- a/learning_observer/learning_observer/static/webapp.html +++ b/learning_observer/learning_observer/static/webapp.html @@ -47,7 +47,7 @@

Learning Observer by Piotr Mitros and Bradley Erickson. Copyright - (c) 2020-2024. Educational Testing + (c) 2020-2025. Educational Testing Service. The source code is available under the diff --git a/learning_observer/learning_observer/static/webapp.js b/learning_observer/learning_observer/static/webapp.js index 37a4e78b..e6908275 100644 --- a/learning_observer/learning_observer/static/webapp.js +++ b/learning_observer/learning_observer/static/webapp.js @@ -32,7 +32,6 @@ function ajax(config) } function initializeBurgerMenu() { - console.log('initializing burger menu'); document.querySelectorAll('.navbar-burger').forEach(burger => { burger.addEventListener('click', () => { const target = burger.dataset.target;