From 1e1c27951b02d49daf19020b91996353af0b8931 Mon Sep 17 00:00:00 2001 From: zawn Date: Fri, 11 Apr 2025 17:01:50 -0400 Subject: [PATCH 01/15] report data visualization front-end --- app/static/js/minorAdminPage.js | 16 ++++++++++++++-- app/templates/admin/cceMinor.html | 20 +++++++++++++++++++- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/app/static/js/minorAdminPage.js b/app/static/js/minorAdminPage.js index d3e02cb2f..6021fdb31 100644 --- a/app/static/js/minorAdminPage.js +++ b/app/static/js/minorAdminPage.js @@ -1,6 +1,5 @@ import searchUser from './searchUser.js' - $(document).ready(function() { $('button[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { let activeTab = $(e.target).attr('id').replace('-tab', ''); @@ -57,10 +56,23 @@ $(document).ready(function() { if (activeTab) { $('#studentTabs button[data-bs-target="#' + activeTab + '"]').tab('show'); } - + $("#cceMinor").on("click", ()=>{ + $.ajax({ + type: 'GET', + url: '/profile/' + username + '/cceMinor', + data: JSON, + success: function(response) { + location.reload() + }, + error: function(error) { + console.log("error") + } + }); + }) }) + function emailMinorCandidates(studentEmails){ // If there are any students interested or declared, open the mailto link if (studentEmails.length) { diff --git a/app/templates/admin/cceMinor.html b/app/templates/admin/cceMinor.html index b5dd65666..a741b5dc4 100644 --- a/app/templates/admin/cceMinor.html +++ b/app/templates/admin/cceMinor.html @@ -19,9 +19,28 @@

CCE Minor Management

CCE Minor Progress

+ Download Report
+ + @@ -111,7 +130,6 @@

CCE Minor Candidates

- @@ -51,7 +51,7 @@ From e56fb8ea747115d22e0bb8eb2e08bbd5acbbd487 Mon Sep 17 00:00:00 2001 From: zawn Date: Thu, 17 Apr 2025 16:26:08 -0400 Subject: [PATCH 05/15] add x and y labels --- app/controllers/admin/minor.py | 1 - app/static/js/minorAdminPage.js | 20 ++++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/minor.py b/app/controllers/admin/minor.py index 8fb9f3ba4..ab904cb14 100644 --- a/app/controllers/admin/minor.py +++ b/app/controllers/admin/minor.py @@ -8,7 +8,6 @@ @admin_bp.route('/profile//cceMinorChart', methods=['GET']) def cceMinorChart(username): - print("****" * 19) if not g.current_user.isAdmin: abort(403) else: diff --git a/app/static/js/minorAdminPage.js b/app/static/js/minorAdminPage.js index 3b6cb5db1..ee3c28904 100644 --- a/app/static/js/minorAdminPage.js +++ b/app/static/js/minorAdminPage.js @@ -85,13 +85,25 @@ $(document).ready(function() { }] }, options: { - y: { - beginAtZero: true, - max: maxValue + scales:{ + y: { + beginAtZero: true, + max: maxValue, + title:{ + display:true, + text:'Hours of Engagements' + } + }, + x: { + title:{ + display:true, + text:'Names' + } + } }, plugins: { legend: { - display: false, // Show legend + display: false, }, tooltip: { callbacks: { From 0bf17ad208d3f1f34ea3a411bb48b01530deff93 Mon Sep 17 00:00:00 2001 From: zawn Date: Mon, 21 Apr 2025 17:53:56 -0400 Subject: [PATCH 06/15] changes are met --- app/controllers/admin/minor.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/controllers/admin/minor.py b/app/controllers/admin/minor.py index ab904cb14..975a08b10 100644 --- a/app/controllers/admin/minor.py +++ b/app/controllers/admin/minor.py @@ -11,16 +11,12 @@ def cceMinorChart(username): if not g.current_user.isAdmin: abort(403) else: - progress_list = getMinorProgress() + progressList = getMinorProgress() turnToChart = [] - for progress in progress_list: + for progress in progressList: turnToChart.append({'name':progress["firstName"] + " " + progress["lastName"], "engagementCount" : progress['engagementCount'], "completeSummer": "Yes" if progress['hasSummer'] == "Complete" else "No"}) return jsonify(turnToChart) - - - - @admin_bp.route('/admin/cceMinor', methods=['GET','POST']) def manageMinor(): if not g.current_user.isAdmin: From ced1d39a4a6b4218fd4570af87e71eb4caa23d62 Mon Sep 17 00:00:00 2001 From: zawn Date: Mon, 21 Apr 2025 17:58:05 -0400 Subject: [PATCH 07/15] changes are met again --- app/static/js/minorAdminPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/static/js/minorAdminPage.js b/app/static/js/minorAdminPage.js index ee3c28904..5ea45c771 100644 --- a/app/static/js/minorAdminPage.js +++ b/app/static/js/minorAdminPage.js @@ -123,7 +123,7 @@ $(document).ready(function() { } }, error: function(error) { - console.log("error") + console.log("error: " + error); } }); }) From b579cfd4a40108c97c0344d5d08f23b482def305 Mon Sep 17 00:00:00 2001 From: Stevenson Date: Wed, 23 Apr 2025 11:09:02 -0400 Subject: [PATCH 08/15] Change font and address feedback --- app/static/js/minorAdminPage.js | 30 ++++++++++++++++++------------ app/templates/admin/cceMinor.html | 21 ++++++++++++++------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/app/static/js/minorAdminPage.js b/app/static/js/minorAdminPage.js index 5ea45c771..e2e1fc4e9 100644 --- a/app/static/js/minorAdminPage.js +++ b/app/static/js/minorAdminPage.js @@ -61,18 +61,20 @@ $(document).ready(function() { const xValues = []; const yValues = []; const barColors = []; + $.ajax({ type: 'GET', url: '/profile/' + username + '/cceMinorChart', data: JSON, success: function(responses) { - for (let i = 0; i { - const downloadLink = document.createElement('a'); // create a link - downloadLink.href = canvas.toDataURL(); // turn it inot a data url - downloadLink.download = fileName; //put the file name as download - downloadLink.click(); // stimulate the click + const downloadLink = document.createElement('a'); + downloadLink.href = canvas.toDataURL(); + downloadLink.download = fileName; + downloadLink.click(); }) }) - }) - function emailMinorCandidates(studentEmails){ // If there are any students interested or declared, open the mailto link if (studentEmails.length) { @@ -164,7 +171,6 @@ function emailAll(){ emailMinorCandidates(allMinorCandidateEmails); } - function getInterestedStudents() { // get all the checkboxes and return a list of users who's // checkboxes are selected diff --git a/app/templates/admin/cceMinor.html b/app/templates/admin/cceMinor.html index 2bdf89e46..f186c894c 100644 --- a/app/templates/admin/cceMinor.html +++ b/app/templates/admin/cceMinor.html @@ -12,6 +12,7 @@ {{super()}} + {% endblock %} {% endblock %} {% block app_content %} @@ -27,6 +28,8 @@

CCE Minor Progress

+ +