Skip to content

Commit

Permalink
SAK-41380 Adjusted width of gb sections column (sakaiproject#6648)
Browse files Browse the repository at this point in the history
Makes the section and student number column widths property
configurable
  • Loading branch information
adrianfish authored Mar 13, 2019
1 parent 5b77992 commit bf9fd76
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1858,6 +1858,13 @@
# DEFAULT: true
# gradebookng.showSections=false

# SAK-41380: Set the sections column width
# DEFAULT: 140
# gradebookng.sectionsColumnWidth=100

# SAK-41380: Set the student number column width
# DEFAULT: 140
# gradebookng.studentNumberColumnWidth=100

# ASSIGNMENT 1
# Allows an instructor or any user with assignments management permissions to submit the assignment on behalf of a student
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@
</div>
</script>
<script id="sectionsCellTemplate" type="text/template">
<div class="gb-value">
<div class="gb-value gb-section-cell">
{if sections.length > 0}
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button class="btn btn-secondary dropdown-toggle gb-section-button" type="button" title="${sections[0]}" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
${sections[0]}
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,12 @@ public void renderHead(final IHeaderResponse response) {

response.render(OnDomReadyHeaderItem.forScript(String.format("GbGradeTable.renderTable('%s', tableData)",
component.getMarkupId())));

int sectionsColumnWidth = serverConfigService.getInt("gradebookng.sectionsColumnWidth", 140);
int studentNumberColumnWidth = serverConfigService.getInt("gradebookng.studentNumberColumnWidth", 140);
StringBuilder sb = new StringBuilder();
sb.append("var sectionsColumnWidth = ").append(sectionsColumnWidth);
sb.append(", studentNumberColumnWidth = ").append(studentNumberColumnWidth).append(";");
response.render(JavaScriptHeaderItem.forScript(sb.toString(), null));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3249,7 +3249,7 @@ GbGradeTable.setupStudentNumberColumn = function() {
return student.studentNumber || "";
}),
editor: false,
width: 140,
width: studentNumberColumnWidth,
});
};

Expand Down Expand Up @@ -3297,7 +3297,7 @@ GbGradeTable.setupSectionsColumn = function () {
return student.sections || "";
}),
editor: false,
width: 140,
width: sectionsColumnWidth,
});
};

Expand Down
11 changes: 11 additions & 0 deletions gradebookng/tool/src/webapp/styles/gradebook-gbgrade-table.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@
text-align: left;
vertical-align: middle;
}
#gradeTableWrapper .gb-section-cell {
direction: rtl;
}
#gradeTableWrapper .gb-section-button {
margin: 1px 0px 2px 2px !important;
padding: 2px 2px !important;
font-size: 12px !important;
}
#gradeTableWrapper .gb-student-number-cell .rowHeader {
font-size: 12px;
}
#gradeTableWrapper .handsontableInputHolder {
text-align: center;
}
Expand Down

0 comments on commit bf9fd76

Please sign in to comment.