Merge pull request #40 from adityasharma7/ROL-2154
Improve alert messages (ROL-2154)
diff --git a/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp b/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
index bb8c58b..5f2bed2 100644
--- a/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/tiles/messages.jsp
@@ -17,9 +17,31 @@
--%>
<%@ include file="/WEB-INF/jsps/taglibs-struts2.jsp" %>
+<script>
+ $(document).ready(function () {
+ // Remove the alert box after 10 seconds
+ $(".alert").delay(10000).slideUp(200, function() {
+ $(this).alert('close');
+ });
+ });
+</script>
+<style>
+ <%-- Alert message should not be bulleted --%>
+ .alert ul {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ }
+
+</style>
+
+
<%-- Success Messages --%>
<s:if test="!actionMessages.isEmpty">
<div id="messages" class="alert alert-success">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
<s:actionmessage />
</div>
</s:if>
@@ -27,6 +49,9 @@
<%-- Error Messages --%>
<s:if test="!actionErrors.isEmpty || !fieldErrors.isEmpty">
<div id="errors" class="alert alert-danger">
+ <button type="button" class="close" data-dismiss="alert" aria-label="Close">
+ <span aria-hidden="true">×</span>
+ </button>
<ul>
<s:iterator var="actionError" value="actionErrors">