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

Lmsa 9204 #32

Merged
merged 3 commits into from
Mar 25, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -542,25 +542,31 @@ public String doSubmitConfirmation(@PathVariable("courseId") String courseId, Mo

if (hasErrors || hasSuccesses) {
SubmissionStatus status = new SubmissionStatus();
String titleKey = null;
String messageKey = null;
String pageTitle = "";

if (hasSuccesses && !hasErrors) {
status.setStatusClass(CrosslistConstants.STATUS_SUCCESS);
messageKey = "status.success";
titleKey = "status.success.title";
messageKey = "status.success.msg";
pageTitle = "Success - Cross-listing Assistant";
} else if (hasSuccesses) {
status.setStatusClass(CrosslistConstants.STATUS_PARTIAL);
messageKey = "status.partial";
titleKey = "status.partial.title";
messageKey = "status.partial.msg";
pageTitle = "Some sites cross-listed - Cross-listing Assistant";
} else {
status.setStatusClass(CrosslistConstants.STATUS_FAILED);
messageKey = "status.error";
titleKey = "status.error.title";
messageKey = "status.error.msg";
pageTitle = "Error has occurred - Cross-listing Assistant";
}

String statusMessage = messageSource.getMessage(messageKey, null, Locale.getDefault());
String statusTitle = messageSource.getMessage(titleKey, null, Locale.getDefault());
status.setStatusMessage(statusMessage);
status.setStatusTitle(statusTitle);
model.addAttribute("submissionStatus", status);

// Page title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@
public class SubmissionStatus {
private String statusClass;
private String statusMessage;
private String statusTitle;
}
9 changes: 6 additions & 3 deletions src/main/resources/crosslist.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
# #L%
###
status.error=<span class="rvt-text-bold">Error</span>: Your cross-listing changes failed. See below for the current list of sections in this course, and try your changes again.
status.partial=<span class="rvt-text-bold">Alert</span>: Some of your cross-listing changes were <em>not</em> successful. See below for the current list of sections in this course. To make additional changes, try again.
status.success=<span class="rvt-text-bold">Success</span>: Your cross-listing changes were successful!
status.error.title=Error
status.error.msg=Your cross-listing changes failed. See below for the current list of sections in this course, and try your changes again.
status.partial.title=Alert
status.partial.msg=Some of your cross-listing changes were not successful. See below for the current list of sections in this course. To make additional changes, try again.
status.success.title=Success
status.success.msg=Your cross-listing changes were successful!
etext.message=An IU eTexts order is associated with the original section in this course. Before taking any action, make sure the same materials were ordered for all the sections you wish to cross-list.
9 changes: 0 additions & 9 deletions src/main/resources/static/js/crosslisting.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,6 @@ $(document).ready(function(){
// this will prevent forms from submitting twice
$('form').preventDoubleSubmission();

$(function(){
if ($("#alert").length) {
$("#alert").focus();
}
if ($("#focusText").length) {
$("#focusText").focus();
}
});

$('#addTerm').on('change', function() {
var obj = $(this);
var urlBase = obj.data('urlbase');
Expand Down
10 changes: 6 additions & 4 deletions src/main/resources/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,20 @@
<body>
<div layout:fragment="content">
<div class="rvt-container-xl rvt-m-top-sm">
<div th:insert="fragments/enterImpersonationMode :: enterImpersonationMode"></div>
<div id="alert" th:if="${submissionStatus}" class="rvt-alert rvt-m-bottom-md" th:classappend="${submissionStatus.statusClass}"
role="alert" data-rvt-alert="error">
<p class="rvt-alert__message" th:utext="${submissionStatus.statusMessage}">status message goes here</p>
<button type="button" class="rvt-alert__dismiss" data-alert-close>
role="alert" data-rvt-alert="submissionStatus">
<div class="rvt-alert__title" th:text="${submissionStatus.statusTitle}">Success</div>
<p class="rvt-alert__message" th:text="${submissionStatus.statusMessage}">status message goes here</p>
<button th:unless="${submissionStatus.statusClass == T(edu.iu.uits.lms.crosslist.CrosslistConstants).STATUS_FAILED}" type="button" class="rvt-alert__dismiss" data-rvt-alert-close>
<span class="rvt-sr-only">Close</span>
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="currentColor" d="M9.41,8l5.29-5.29a1,1,0,0,0-1.41-1.41L8,6.59,2.71,1.29A1,1,0,0,0,1.29,2.71L6.59,8,1.29,13.29a1,1,0,1,0,1.41,1.41L8,9.41l5.29,5.29a1,1,0,0,0,1.41-1.41Z"/>
</svg>
</button>
</div>

<div th:insert="fragments/enterImpersonationMode :: enterImpersonationMode"></div>

<h2 class="rvt-ts-26" th:text="${courseTitle}">SP16-BL-MUS-A112-15890 - A112 (Online):15890</h2>
<p id="instructions" class="rvt-ts-18">
Check the sections you wish to add (cross-list) and uncheck the sections you wish to remove (de-cross-list).
Expand Down