Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf Binary files differ Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision c33d82bf97152099b7a309a156ec2707239b622c) +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -115,6 +115,10 @@ request.setAttribute("tools", getLearningDesignService().getToolDTOs(false, false, request.getRemoteUser())); } + + //set whether organisation is favorite + boolean isFavorite = service.isOrganisationFavorite(orgId, user.getUserId()); + iob.setFavorite(isFavorite); } return mapping.findForward("group"); Index: lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java (.../IndexAction.java) (revision c33d82bf97152099b7a309a156ec2707239b622c) +++ lams_central/src/java/org/lamsfoundation/lams/web/IndexAction.java (.../IndexAction.java) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -43,6 +43,7 @@ import org.apache.tomcat.util.json.JSONObject; import org.lamsfoundation.lams.config.Registration; import org.lamsfoundation.lams.index.IndexLinkBean; +import org.lamsfoundation.lams.usermanagement.Organisation; import org.lamsfoundation.lams.usermanagement.Role; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.OrganisationDTO; @@ -123,6 +124,9 @@ if (reg != null) { request.setAttribute("lamsCommunityEnabled", reg.isEnableLamsCommunityIntegration()); } + + List favoriteOrganisations = userManagementService.getFavoriteOrganisationsByUser(userDTO.getUserID()); + request.setAttribute("favoriteOrganisations", favoriteOrganisations); return mapping.findForward("main"); } @@ -159,7 +163,7 @@ } /** - * Returns list of organisations for . + * Returns list of organisations for user. Used by offcanvas tablesorter on main.jsp. */ public ActionForward getOrgs(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse res) throws IOException, ServletException, JSONException { @@ -206,7 +210,53 @@ res.getWriter().print(new String(responcedata.toString())); return null; } + + /** + * Toggles whether organisation is marked as favorite. + */ + public ActionForward toggleFavoriteOrganisation(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse res) throws IOException, ServletException { + getUserManagementService(); + Integer orgId = WebUtil.readIntParam(request, "orgId", false); + Integer userId = getUserId(); + if (orgId != null) { + userManagementService.toggleOrganisationFavorite(orgId, userId); + } + + List favoriteOrganisations = userManagementService.getFavoriteOrganisationsByUser(userId); + request.setAttribute("favoriteOrganisations", favoriteOrganisations); + + String activeOrgId = request.getParameter("activeOrgId"); + request.setAttribute("activeOrgId", activeOrgId); + + return mapping.findForward("favoriteOrganisations"); + } + + /** + * Saves to DB last visited organisation. It's required for displaying some org on main.jsp next time user logs in. + */ + public ActionForward storeLastVisitedOrganisation(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse res) throws IOException, ServletException { + getUserManagementService(); + Integer lastVisitedOrganisationId = WebUtil.readIntParam(request, "orgId", false); + + //saves to DB last visited organisation + if (lastVisitedOrganisationId != null) { + User user = userManagementService.getUserByLogin(request.getRemoteUser()); + user.setLastVisitedOrganisationId(lastVisitedOrganisationId); + userManagementService.save(user); + } + + return null; + } + + private Integer getUserId() { + HttpSession ss = SessionManager.getSession(); + UserDTO learner = (UserDTO) ss.getAttribute(AttributeNames.USER); + return learner != null ? learner.getUserID() : null; + } + private IUserManagementService getUserManagementService() { if (userManagementService == null) { WebApplicationContext ctx = WebApplicationContextUtils Fisheye: Tag 353fe07604639c2166ed68fbf832810959f3f3cf refers to a dead (removed) revision in file `lams_central/src/java/org/lamsfoundation/lams/web/UpdateCollapsedGroupServlet.java'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/WEB-INF/struts-config.xml =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision c33d82bf97152099b7a309a156ec2707239b622c) +++ lams_central/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -130,6 +130,11 @@ redirect="false" /> + - updateCollapsedGroup - org.lamsfoundation.lams.web.UpdateCollapsedGroupServlet - - - - GetRecordingServlet org.lamsfoundation.lams.webservice.GetRecordingServlet @@ -465,10 +459,6 @@ - updateCollapsedGroup - /servlet/updateCollapsedGroup - - GetRecordingServlet /GetRecording Fisheye: Tag 353fe07604639c2166ed68fbf832810959f3f3cf refers to a dead (removed) revision in file `lams_central/web/css/index.css'. Fisheye: No comparison available. Pass `N' to diff? Index: lams_central/web/css/main.css =================================================================== diff -u -rff04fcd49940d68f8206489d3623716706a5e240 -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/web/css/main.css (.../main.css) (revision ff04fcd49940d68f8206489d3623716706a5e240) +++ lams_central/web/css/main.css (.../main.css) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -9,7 +9,7 @@ } #offcanvas { position: fixed; - width: 300px; + width: 220px; z-index: 10; height: 100%; background: #2f4050; @@ -29,7 +29,7 @@ } #page-wrapper { min-height: 1000px; - margin: 0 0 0 300px; + margin: 0 0 0 220px; padding: 10px 20px 0px; } .offcanvas-hidden #offcanvas { @@ -62,6 +62,15 @@ } } +.content { + /*background: #fff;*/ + padding: 7px 10px; + background: #fff; +} +#org-container { + padding: 17px 10px 17px 25px; +} + /*FOOTER*/ footer { background: #fff; @@ -79,13 +88,17 @@ } /*OFFCANVAS BAR*/ -#offcanvas-menu > li > a, .tablesorter a { +#favorite-organisations { + border-top: 1px solid rgba(255, 255, 255, 0.16); + border-bottom: 1px solid rgba(255, 255, 255, 0.16); +} +#favorite-organisations > li > a, .tablesorter a { color: #a7b1c2; font-weight: 400; padding: 14px 20px 14px 25px; } -#offcanvas-menu > li > a:hover, -#offcanvas-menu > li > a:focus, +#favorite-organisations > li > a:hover, +#favorite-organisations > li > a:focus, .pagesize:hover, .tablesorter a:hover, .tablesorter a:focus { @@ -109,22 +122,20 @@ border-right: 10px solid #19aa8d; background: #293846; } -li.offcanvas-logo { +.offcanvas-logo { padding: 20px 0px 0px 25px; background-color: #293846; } -img.offcanvas-logo{ +.offcanvas-logo img{ width: 100px; } -li.offcanvas-header { - padding: 10px 0px 0px 0px; +.offcanvas-header { + padding: 15px 0px 0px 0px; background-color: #293846; - border-bottom: 1px solid rgba(255, 255, 255, 0.16); } -li.offcanvas-search { - padding: 20px 19px 10px; +.offcanvas-search { + padding: 15px 19px 15px; margin-bottom: 0; - border-top: 1px solid rgba(255, 255, 255, 0.16); } .offcanvas-search .form-control { box-shadow: inset 0 1px 0px rgba(208, 206, 206, 0.25); @@ -154,12 +165,15 @@ .ts-pager .btn{ color: #2f4050; background-color: #a7b1c2; + padding: 2px 5px; + line-height: 1; } .tablesorter tfoot i { font-size: 11px; } .tablesorter tfoot th { - background-color: #25323E !important; + background-color: #293846 !important; + padding: 10px 0; } .pagesize { @@ -168,7 +182,6 @@ cursor: pointer; } -/*ICON*/ .icon-remove { cursor: pointer; position: absolute; @@ -238,7 +251,8 @@ margin: 2px 2px 0; width: 98% !important; } -/*HEADER links*/ + +/*TOP HEADER LINKS*/ .offcanvas-toggle-wrapper:hover, ul.dropdown-usermenu li a:focus, ul.dropdown-usermenu li a:hover, .top_nav .nav > li > a:hover, .top_nav .nav .open > a, .top_nav .nav .open > a:focus, .top_nav .nav .open > a:hover { background: #D9DEE4; } @@ -300,17 +314,232 @@ border-radius: 10px; } -/*MAIN*/ -.content { - /*background: #fff;*/ - padding: 7px 10px; - background: #fff; +/*DIALOGS*/ +.dialogContainer { + -webkit-overflow-scrolling: touch !important; } -.container-turned-off-lams { - background: #fff; - padding: 7px 10px; + +.dialogContainer .modal-body { + height : 100%; + max-height: calc(100% - 60px); + padding: 0; } -/*OLDER STUFF*/ -.orgTab { - padding: 10px 0 10px 15px; + +.dialogContainer iframe { + width: 100%; + height: 100%; + border: none; +} + +.dialogContainer button { + cursor: pointer; +} +.dialogContainer button:focus { + outline: none; +} + +.dialogContainer button .fa { + font-size: 16px; + margin-left: 10px; +} + +.dialogContainer .ui-draggable .modal-header { + cursor: move; +} + +#dialogMinContainer { + height: 35px; + bottom: 1px; + left: 1px; + position: fixed; + right: 1px; + z-index: 9999; +} + +.dialogMin { + overflow: hidden !important; + padding: 0 !important; + margin: 0; + float: left; + position: static !important; +} + +.dialogMin .modal-title { + white-space: nowrap; + overflow: hidden; +} + +.dialogMin .modal-dialog { + left: 0 !important; + top: 0 !important; +} + +.dialogMin .modal-dialog, .dialogMin .modal-content { + width: 250px !important; + height: 35px !important; + margin: 0 !important; + padding: 0 !important; +} + +.dialogMin .modal-header { + height: 100%; + margin: 0 !important; + padding: 3px 5px !important; +} + +.ui-dialog .ui-dialog-content { + padding: 3px; +} + +#dialogPrivateNotifications table tr:first-child td { + font-weight: bold; + text-align: center; +} + +#dialogPrivateNotifications td.notificationsReadCell { + font-size: 16px; + width: 30px; + text-align: center; +} + +#dialogPrivateNotifications td.notificationsPendingCell { + font-weight: bold; +} + +#dialogPrivateNotifications td.notificationsClickableCell:hover { + cursor: pointer; + border-color: #9be0f9; + background-color: #F0F8FF; + /* CSS3 glow effect: */ + -moz-border-radius: 6px; + -webkit-border-radius: 6px; + border-radius: 6px; + -moz-box-shadow: 0 0 5px #A6E5FD; + -webkit-box-shadow: 0 0 5px #A6E5FD; + box-shadow: 0 0 5px #A6E5FD; +} + +/* GROUP CONTAINER */ +.j-single-lesson { + list-style: none; + margin: 6px; + padding: 3px 3px 3px 10px; + position: relative; +} + +.j-single-lesson:hover { + border-color: #9be0f9; + background-color: #F0F8FF; + display: block; + /* CSS3 glow effect: */ + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + -moz-box-shadow: 0 0 5px #A6E5FD; + -webkit-box-shadow: 0 0 5px #A6E5FD; + box-shadow: 0 0 5px #A6E5FD; +} + +.j-single-lesson:hover .lesson-actions { + opacity: 1; + filter: alpha(opacity = 100); /* msie */ + display: block; +} + +.j-single-lesson:hover .mycourses-monitor-img { +} + +.j-single-lesson:hover .mycourses-mark-img { +} + +.j-single-lesson:hover .mycourses-notifications-img { +} + +.j-single-lesson:hover .mycourses-conditions-img { +} + +.j-single-lesson:hover .mycourses-removelesson-img { +} + +.j-single-lesson:hover .mycourses-move-img { + background: url('../images/css/arrow_move.png') no-repeat 0 0px; +} + +.lesson-actions { + float: right; + font-size: 1.2em; + opacity: 0.3; + filter: alpha(opacity = 10); /* msie */ +} + +.lesson-actions a { + border-bottom: none; +} + +.child-org-name { + float: left; + padding-top: 5px; +} + +.split-ui-button+ul { + z-index: 1; +} + +.split-ui-button+ul li { + list-style-type: none; +} + +.split-ui-button+ul li a { + border: none; +} + +.split-ui-button div:first-child { + margin-right: -0.4em; +} + +.split-ui-button + ul span { + color: #999; +} + +.ui-button, .split-ui-button div { + font-size: 12px !important; + font-weight: normal !important; +} + +a.sorting { + border-bottom: none; + cursor: pointer; +} + +.lesson-table { + margin: 0 auto; + width: 100%; +} + +.subgroup-lesson-table { + padding-top: 30px; +} + +.course-right-buttons { + padding-right: 20px; +} + +.group-name { + margin-top: 20px; + margin-left: 30px; +} + +.group-name p { + padding-top: 0px; + margin-bottom: 0px; + padding-left: 0px; + margin-left: 0px; +} + +.group-name strong { + color: #666; +} + +.course-header i{ + font-size: 16px; } \ No newline at end of file Index: lams_central/web/editprofile.jsp =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision c33d82bf97152099b7a309a156ec2707239b622c) +++ lams_central/web/editprofile.jsp (.../editprofile.jsp) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -17,7 +17,7 @@ - + - + - + + @@ -84,13 +83,13 @@ PRIVATE_NOTIFICATIONS_READ_ALL_HINT : '', MY_PROFILE : '', + REMOVE_ORG_FAVORITE : '', + MARK_ORG_FAVORITE : '', }, stateId = 1, // TODO Figure out when stateId is required to be equal 3. Old version code: stateId = tabName == 'profile' ? 3 : 1; - activeOrgId = -1; //not set for now + activeOrgId = null${lastVisitedOrganisationId}; $(document).ready(function(){ - initMainPage(); - <%-- If it's the user's first login, display a dialog asking if tutorial videos should be shown --%> @@ -100,135 +99,39 @@ $.get("${disableAllTutorialVideosUrl}"); } - - var $tablesorter = $(".tablesorter").tablesorter({ - theme: 'bootstrap', - headerTemplate : '{content} {icon}', - widgets: ["filter"], - widgetOptions : { - filter_columnFilters: false - }, - widthFixed: true, - sortInitialOrder: 'desc', - sortList: [[1]], - headers: { 0: { sorter: false, filter: false} } - }); - - $.tablesorter.filter.bindSearch($tablesorter, $('#offcanvas-search-input') ); - - $(".tablesorter").each(function() { - $(this).tablesorterPager({ - savePages: false, - container: $(this).find(".ts-pager"), - output: '{startRow} to {endRow} ({totalRows})', - cssPageDisplay: '.pagedisplay', - cssPageSize: '.pagesize', - cssDisabled: 'disabled', - ajaxUrl : "?dispatch=getOrgs&page={page}&size={size}&{sortList:column}&{filterList:fcol}", - ajaxProcessing: function (data, table) { - if (data && data.hasOwnProperty('rows')) { - var rows = [], - json = {}; - - for (i = 0; i < data.rows.length; i++){ - var orgData = data.rows[i]; - var orgId = orgData["id"]; - - rows += ''; - - rows += ''; - rows += ''; - - rows += ''; - rows += ''; - rows += orgData["name"]; - rows += ''; - rows += ''; - - rows += ''; - } - - json.total = data.total_rows; - json.rows = $(rows); - return json; - } - } - }) - }); - - $('.tablesorter').bind('filterEnd pagerComplete', function(event, data){ - - //hide pager if total amount of courses is less than 10 - if (data.totalRows < 10) { - $(".tablesorter-pager").hide(); - } else { - $(".tablesorter-pager").show(); - } - - //in case active course is not yet chosen by user, select the fist one from the list - if ((activeOrgId < 0) && (event.type == "pagerComplete") && (data.totalRows > 0)) { - var firstOrgId = $('.tablesorter a').first().data("id"); - selectOrganisation(firstOrgId); - } - }); - }); - +class="offcanvas-hidden"> @@ -335,8 +238,6 @@ @@ -355,9 +256,7 @@
-
-
-
+
Index: lams_central/web/passwordChangeContent.jsp =================================================================== diff -u -rc6b80dfdf1fa898b96bd84e2888ee287cf0a6079 -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/web/passwordChangeContent.jsp (.../passwordChangeContent.jsp) (revision c6b80dfdf1fa898b96bd84e2888ee287cf0a6079) +++ lams_central/web/passwordChangeContent.jsp (.../passwordChangeContent.jsp) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -23,7 +23,7 @@ - + - + Index: lams_central/web/profile.jsp =================================================================== diff -u -rc33d82bf97152099b7a309a156ec2707239b622c -r353fe07604639c2166ed68fbf832810959f3f3cf --- lams_central/web/profile.jsp (.../profile.jsp) (revision c33d82bf97152099b7a309a156ec2707239b622c) +++ lams_central/web/profile.jsp (.../profile.jsp) (revision 353fe07604639c2166ed68fbf832810959f3f3cf) @@ -17,7 +17,7 @@ - +