From b62074adc3a9c5f0fd49d6f4467488069bcc9687 Mon Sep 17 00:00:00 2001 From: Wagner Date: Thu, 21 Mar 2024 07:54:19 -0700 Subject: [PATCH 1/2] LMSA-9204 separate title from alert msg --- .../crosslist/controller/CrosslistController.java | 12 +++++++++--- .../uits/lms/crosslist/model/SubmissionStatus.java | 2 ++ src/main/resources/crosslist.properties | 9 ++++++--- src/main/resources/templates/index.html | 6 ++++-- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java b/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java index a4e914a..72056e5 100644 --- a/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java +++ b/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java @@ -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"; + messageKey = "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 diff --git a/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java b/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java index ad6cfbb..fa7b6bb 100644 --- a/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java +++ b/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java @@ -42,4 +42,6 @@ public class SubmissionStatus { private String statusClass; private String statusMessage; + + private String statusTitle; } diff --git a/src/main/resources/crosslist.properties b/src/main/resources/crosslist.properties index f64e10e..e0712d2 100644 --- a/src/main/resources/crosslist.properties +++ b/src/main/resources/crosslist.properties @@ -30,7 +30,10 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. # #L% ### -status.error=Error: Your cross-listing changes failed. See below for the current list of sections in this course, and try your changes again. -status.partial=Alert: 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=Success: 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. diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index e095f93..ba26ef0 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -44,10 +44,10 @@
-
+
+

SP16-BL-MUS-A112-15890 - A112 (Online):15890

Check the sections you wish to add (cross-list) and uncheck the sections you wish to remove (de-cross-list). From 21cf52837f275d41a7a233940fe8dd53025d2813 Mon Sep 17 00:00:00 2001 From: Wagner Date: Fri, 22 Mar 2024 09:31:44 -0700 Subject: [PATCH 2/2] LMSA-9204 alert msg improvements --- .../lms/crosslist/controller/CrosslistController.java | 2 +- .../iu/uits/lms/crosslist/model/SubmissionStatus.java | 1 - src/main/resources/static/js/crosslisting.js | 9 --------- src/main/resources/templates/index.html | 4 ++-- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java b/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java index 72056e5..a175bd9 100644 --- a/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java +++ b/src/main/java/edu/iu/uits/lms/crosslist/controller/CrosslistController.java @@ -553,7 +553,7 @@ public String doSubmitConfirmation(@PathVariable("courseId") String courseId, Mo pageTitle = "Success - Cross-listing Assistant"; } else if (hasSuccesses) { status.setStatusClass(CrosslistConstants.STATUS_PARTIAL); - messageKey = "status.partial.title"; + titleKey = "status.partial.title"; messageKey = "status.partial.msg"; pageTitle = "Some sites cross-listed - Cross-listing Assistant"; } else { diff --git a/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java b/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java index fa7b6bb..0ef6d8b 100644 --- a/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java +++ b/src/main/java/edu/iu/uits/lms/crosslist/model/SubmissionStatus.java @@ -42,6 +42,5 @@ public class SubmissionStatus { private String statusClass; private String statusMessage; - private String statusTitle; } diff --git a/src/main/resources/static/js/crosslisting.js b/src/main/resources/static/js/crosslisting.js index 9cc05b0..4a3b680 100644 --- a/src/main/resources/static/js/crosslisting.js +++ b/src/main/resources/static/js/crosslisting.js @@ -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'); diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index 3694dad..bd5c3b4 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -45,10 +45,10 @@