Skip to content

Commit

Permalink
SAK-48421 gradebook: fix summary modal dialog (sakaiproject#11285)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianfish authored Feb 27, 2023
1 parent caf49aa commit 3bc34ba
Show file tree
Hide file tree
Showing 8 changed files with 189 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

<div class="tabbable tabs-left">
<ul class="nav nav-tabs" wicket:id="tabs-container">
<li wicket:id="tabs">
<a data-bs-toggle="tab" href="#" wicket:id="link"><span wicket:id="title">[tab title]</span></a>
<li wicket:id="tabs" class="nav-item">
<a class="nav-link" href="#" wicket:id="link"><span wicket:id="title">[tab title]</span></a>
</li>
</ul>
<div class="tab-content">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<wicket:panel>
<wicket:enclosure child="categoriesList">
<div wicket:id="toggleActions" class="pull-right">
<div wicket:id="toggleActions" class="float-end">
<a href="javascript:void(0);" class="button" id="toggleCategories" wicket:id="toggleCategoriesLink" aria-controls="gradeSummaryTable"><wicket:message key="label.toolbar.togglecategories"></wicket:message></a>
<a href="javascript:void(0);" class="gb-summary-expand-all" wicket:id="expandCategoriesLink" aria-controls="gradeSummaryTable"><wicket:message key="label.studentsummary.expandall"></wicket:message></a>
<a href="javascript:void(0);" class="gb-summary-collapse-all" wicket:id="collapseCategoriesLink" aria-controls="gradeSummaryTable"><wicket:message key="label.studentsummary.collapseall"></wicket:message></a>
Expand Down Expand Up @@ -50,7 +50,7 @@
<tr wicket:id="assignmentsForCategory" class="gb-summary-grade-row">
<th scope="row">
<span class="gb-summary-grade-title" wicket:id="title"></span>
<span><a href="javascript:void(0);" class="gb-summary-grade-stats pull-right" wicket:message="title:studentsummary.gradebookitem.assignmentstats" wicket:id="assignmentStatsLink"></a></span>
<span><a href="javascript:void(0);" class="gb-summary-grade-stats float-end" wicket:message="title:studentsummary.gradebookitem.assignmentstats" wicket:id="assignmentStatsLink"></a></span>
<span class="gb-summary-grade-flags" wicket:id="flags">
<span wicket:id="isExtraCredit" class="gb-flag-extra-credit"></span>
<span wicket:id="isNotCounted" class="gb-flag-not-counted"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<body>
<wicket:panel>
<div class="gb-summary-grade-panel">
<div class="pull-left">
<div class="float-start">
<div wicket:id="course-grade-panel" class="gb-summary-course-grade">
<div class="card">
<div class="card-body">
Expand All @@ -20,7 +20,7 @@
<span wicket:id="studentCourseGradeComment"> </span>
</span>
</div>
<a href="javascript:void(0);" class="gb-summary-grade-stats pull-right" wicket:message="title:studentsummary.gradebookitem.gradebookstats" wicket:id="courseGradeStatsLink"></a>
<a href="javascript:void(0);" class="gb-summary-grade-stats float-end" wicket:message="title:studentsummary.gradebookitem.gradebookstats" wicket:id="courseGradeStatsLink"></a>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@

<div class="row">
<div class="col-md-12">
<button type="submit" class="button_color gb-summary-close" wicket:id="done"><wicket:message key="button.done" /></button>
<button type="submit" class="button_color btn btn-link gb-summary-close" wicket:id="done"><wicket:message key="button.done" /></button>
<button type="button" class="button_color gb-summary-fake-close" style="display: none;"><wicket:message key="button.done" /></button>
<button type="button" class="btn btn-link btn-xs gb-summary-print"><wicket:message key="button.print" /></button>
</div>
</div>
</div>
<button type="button" class="btn btn-info btn-xs gb-summary-print"><wicket:message key="button.print" /></button>
</div>

<script id="studentGradeSummaryCloseConfirmationTemplate" type="text/template">
<div class="modal fade gb-grade-summary-close-confirmation">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<button type="button" class="close" data-bs-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 class="modal-title"><wicket:message key="label.studentsummary.closeconfirmation.title" /></h3>
</div>
<div class="modal-body">
<p><wicket:message key="label.studentsummary.closeconfirmation.content" /></p>
</div>
<div class="modal-footer">
<button type="button" class="button_color btn-student-summary-continue" data-dismiss="modal"><wicket:message key="label.studentsummary.closeconfirmation.continue" /></button>
<button type="button" class="btn-student-summary-cancel" data-dismiss="modal"><wicket:message key="label.studentsummary.closeconfirmation.cancel" /></button>
<button type="button" class="btn btn-link button_color btn-student-summary-continue" data-bs-dismiss="modal"><wicket:message key="label.studentsummary.closeconfirmation.continue" /></button>
<button type="button" class="btn btn-link btn-student-summary-cancel" data-bs-dismiss="modal"><wicket:message key="label.studentsummary.closeconfirmation.cancel" /></button>
</div>
</div>
</div>
Expand Down
13 changes: 9 additions & 4 deletions gradebookng/tool/src/webapp/scripts/gradebook-gbgrade-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,10 @@ GbGradeTable.renderTable = function (elementId, tableData) {

dropdownMenu = link.nextElementSibling;

if (!dropdownMenu) {
return;
}

dropdownMenu.classList.add("gb-dropdown-menu");

$(dropdownMenu).data("cell", $(link.closest("td, th")));
Expand Down Expand Up @@ -3442,11 +3446,12 @@ GbGradeTable.focusColumnForAssignmentId = function(assignmentId, showPopupForNew
$('body, button').on('click keyup touchend', function (e) {
if ($(e.target).data("bs-toggle") !== 'popover'
&& $(e.target).parents('.popover.in').length === 0) {
$('[data-bs-toggle="popover"]').popover('hide');
document.querySelectorAll('[data-bs-toggle="popover"]').forEach(el => {
bootstrap.Popover.getInstance(el)?.hide();
});
}
});
$selectedField.popover();
$selectedField.popover('show');
})
(new bootstrap.Popover($selectedField[0])).show();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ GradebookGradeSummary.prototype.bindModalClose = function() {


GradebookGradeSummary.prototype.setupPopovers = function() {
this.$content.find('[data-bs-toggle="popover"]').popover();

this.$content[0].querySelectorAll('[data-bs-toggle="popover"]').forEach(el => {
(new bootstrap.Popover(el));
});
};


Expand Down
Loading

0 comments on commit 3bc34ba

Please sign in to comment.