Skip to content

Commit

Permalink
Merge pull request #166 from Aspine/recent-activity
Browse files Browse the repository at this point in the history
Hide assignments from recent activity and hide "Most Recent Activity" from home page

- Aspen doesn't show recent assignments anymore, so I hid the toggle from that page, and it now just shows recent attendance. I also hid the most recent activity on the grades tab, either permanently or at least until we have our own algorithm for calculating recent assignments. I also fixed the issue of the "VP" attendance event not showing correctly.

- Change tab name from "Recent Activity" to "Attendance" and move lower in order in toolbar (After clock)

- Remove clock tab because people can click on the clock directly to enlarge it, and the original function of switching lunches is no longer applicable due to covid-19. When the school reopens, we can restore this feature in the settings page instead of on the clock.
  • Loading branch information
psvenk authored Nov 11, 2020
2 parents c868cfe + 9437119 commit 383ac9a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
19 changes: 11 additions & 8 deletions public/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ <h4 id="title">Aspine</h4>

<div class="tab">
<button class="tablinks" onclick="openTab(event, 'grades')" id="default_open">Grades</button>
<button class="tablinks" onclick="openTab(event, 'recent')">Recent Activity</button>
<button class="tablinks" onclick="openTab(event, 'schedule')">Schedule</button>
<button class="tablinks" onclick="openTab(event, 'clock')">Clock</button>
<button class="tablinks" onclick="openTab(event, 'recent')">Attendance</button>
<!--<button class="tablinks" onclick="openTab(event, 'clock')">Clock</button>-->
<!-- TODO: post-covid, setting lunch should be migrated to settings -->
<!--<button class="tablinks" onclick="openTab(event, 'calendar-tab')">Calendar</button>-->
<button class="tablinks" onclick="openTab(event, 'reports')" id="reports_open">Reports</button>
<!--#ifndef lite-->
Expand Down Expand Up @@ -246,8 +247,9 @@ <h3 id="import_modal_title">Import Data</h3>
<div id="grades" class="tabcontent">
<div id="classesTable"></div>
<div id="mostRecentDiv" style="display:none">
<h3 align="left">Most Recent Activity:</h3>
<div id="mostRecentTable"></div>
<!-- hide most recent activity; removed from aspen -->
<!-- <h3 align="left">Most Recent Activity:</h3> -->
<div id="mostRecentTable" style="display: none;"></div>
</div>
<div id="categoriesTable"></div>
<div id="assignmentsTable"></div>
Expand Down Expand Up @@ -301,13 +303,14 @@ <h3>Add Calendar</h3>
</div>
-->
<div id="recent" class="tabcontent">
<label class="switch">
<!-- <label class="switch">
<input type="checkbox" id="recent_toggle" onclick="recent_toggle();">
<span class="slider round"></span>
<p id="recent_title" class="unselectable">Assignments</p>
</label>
<div id="recentActivity"></div>
<div id="recentAttendance"></div>
</label>-->
<div id="recentActivity" style="display: none"></div>
<div id="recentAttendance" style="display: block"></div>
<!-- recentActivity is hidden because Aspen does not display recent assignments -->
</div>
<div id="reports" class="tabcontent">
<div class="pdf_topnav">
Expand Down
13 changes: 10 additions & 3 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ function responseCallback(response, includedTerms) {
if (currentTableData.recent.recentAttendanceArray[i].tardy === "true") {
currentTableData.recent.recentAttendanceArray[i].event += "Tardy ";
}
// addition for COVID
if (currentTableData.recent.recentAttendanceArray[i].code === "VP") {
currentTableData.recent.recentAttendanceArray[i].event += "VP ";
}
}

let activityArray = currentTableData.recent.recentActivityArray.slice();
Expand Down Expand Up @@ -1010,22 +1014,25 @@ function pdfCallback(response) {
generate_pdf(pdf_index);
}
}

// Currently no need for toggle; there are no recent assignments
/*
function recent_toggle() {
if (!document.getElementById("recent_toggle").checked) {
//recentActivity.setData(tableData.recent.recentActivityArray);
recentActivity.setData(tableData.recent.recentActivityArray);
document.getElementById("recentActivity").style.display = "block";
document.getElementById("recentAttendance").style.display = "none";
document.getElementById("recent_title").innerHTML = "Assignments";
recentActivity.redraw();
} else {
}
else {
//recentActivity.setData(tableData.recent.recentAttendanceArray);
document.getElementById("recentActivity").style.display = "none";
document.getElementById("recentAttendance").style.display = "block";
document.getElementById("recent_title").innerHTML = "Attendance";
recentAttendance.redraw();
}
}
*/

function schedule_toggle() {
if (document.getElementById("schedule_toggle").checked) {
Expand Down

0 comments on commit 383ac9a

Please sign in to comment.