Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added text to export data and reset buttons #361

Merged
merged 1 commit into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions public/css/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ button {
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
font-size: 14px;
border: 1px solid var(--black);
border-radius: 2px;
background-color: var(--white2);
background-color: var(--white);
color: var(--black);
border: 0px;
}

button:hover {
Expand Down Expand Up @@ -633,20 +633,21 @@ i.fa.fa-toolbox {

.header-icon {
color: var(--green2);
padding-top: 8.5px;
padding-left: 5px;
font-size: large;
cursor: pointer;
}

#buttonsTable .tabulator-tableHolder{
position: absolute;
left: -10000000000000000000000000px;
}

#buttonsTable .tabulator-headers{
display: flex;
#gradesButtons{
height:35px;
display:flex;
justify-content: flex-end;
vertical-align:middle;
background-color: var(--white);
}

#gradesButtons button {
height:35px;
}

#classesTable .tabulator-col,
Expand Down
22 changes: 12 additions & 10 deletions public/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,6 @@ <h4 id="title" onclick="openTab('grades')">Aspine</h4>
</div>
</div>

<!--
<div id="loader" class="modal" style="background-color: rgba(0,0,0,0.0); padding-top: 300px; display: inline-block;">
<div id="loader_modal_content" class="model-content" style=" width: 500px; height: 150px; margin: auto;">
<div id="loader_modal_content" class="model-content" style=" width: 500px; height: 150px; margin: auto;border: 2px solid black;background-color: white;">
<h1 style="top: 25%; position: relative;"> Loading! </h1>
</div>
</div>
</div>
-->
<div id="loader">
<div class="loader"></div>
</div>
Expand Down Expand Up @@ -214,7 +205,18 @@ <h3 id="import_modal_title">Import Data</h3>
</div>

<div id="grades" class="tabcontent">
<div id="buttonsTable"></div>

<div id="gradesButtons">
<button onclick="exportData();">
<text>Export Data</text>
<i class="fa fa-file-download header-icon tooltip" aria-hidden="true" tooltip="Export Grades"></i>
</button>
<button onclick="resetTableData();">
<text>Reset</text>
<i class="fa fa-sync-alt header-icon tooltip" aria-hidden="true" tooltip="Reset"></i>
</button>
</div>

<div id="classesTable"></div>
<div id="mostRecentDiv" style="display:none">
<!-- hide most recent activity; removed from aspen -->
Expand Down
22 changes: 22 additions & 0 deletions public/js/buttonFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -507,3 +507,25 @@ let importTableData = async function(obj) {

$(`#tableData_select-items-${currentTableDataIndex}`).click();
};

let exportData = function(){
// Disable checkboxes for inaccessible terms
termConverter.forEach(term => {
let isAccessibleObj = isAccessible(term);

if (isAccessibleObj.accessible) {
$(`#export_checkbox_terms_${term}`).removeAttr("disabled");
$(`#export_checkbox_terms_${term} ~ span`)
.removeAttr("aria-label")
.removeAttr("tabindex")
.removeClass("hastooltip");
} else {
$(`#export_checkbox_terms_${term}`).attr("disabled", true);
$(`#export_checkbox_terms_${term} ~ span`)
.attr("aria-label", isAccessibleObj.reason)
.attr("tabindex", 0)
.addClass("hastooltip");
}
});
exportModal.style.display = "inline-block";
}
47 changes: 0 additions & 47 deletions public/js/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -758,53 +758,6 @@ let scheduleTable = new Tabulator("#scheduleTable", {
],
});

let buttonsTable = new Tabulator("#buttonsTable", {
//height:205, // set height of table (in CSS or here), this enables the Virtual DOM and improves render speed dramatically (can be any valid css height value)
index: "name",
selectable: 1,
headerHozAlign:"right",
layout: "fitColumns", //fit columns to width of table (optional)
columns: [ // Define Table Columns
{
title: "Export Table Data",
titleFormatter: () => '<i class="fa fa-file-download header-icon tooltip" aria-hidden="true" tooltip="Export Grades"></i>',
headerClick: async () => {
// Disable checkboxes for inaccessible terms
termConverter.forEach(term => {
let isAccessibleObj = isAccessible(term);

if (isAccessibleObj.accessible) {
$(`#export_checkbox_terms_${term}`).removeAttr("disabled");
$(`#export_checkbox_terms_${term} ~ span`)
.removeAttr("aria-label")
.removeAttr("tabindex")
.removeClass("hastooltip");
} else {
$(`#export_checkbox_terms_${term}`).attr("disabled", true);
$(`#export_checkbox_terms_${term} ~ span`)
.attr("aria-label", isAccessibleObj.reason)
.attr("tabindex", 0)
.addClass("hastooltip");
}
});
exportModal.style.display = "inline-block";
},
width: 76,
headerSort: false,
cssClass: "icon-col"
},
{
title: "Reset Table Data",
titleFormatter: () => '<i class="fa fa-sync-alt header-icon tooltip" aria-hidden="true" tooltip="Reset"></i>',
headerClick: resetTableData,
width: 76,
headerSort: false,
cssClass: "icon-col"
},
],
}
);

let classesTable = new Tabulator("#classesTable", {
//height:205, // set height of table (in CSS or here), this enables the Virtual DOM and improves render speed dramatically (can be any valid css height value)
index: "name",
Expand Down