Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 Binary files differ Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -187,6 +187,7 @@ label.completed =Completed! msg.import.file.format =The import file must be a .zip file exported from LAMS 2 or above, or a .las file exported from LAMS 1.0.2. label.enable.lesson.sorting =Enable lesson sorting +label.disable.lesson.sorting =Disable lesson sorting label.lesson.sorting.enabled =lesson sorting enabled label.show.groups =Show Groups label.forgot.password =Forgot your password? Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java =================================================================== diff -u -re1f00790384d8dc42812ee952998b3104c36b96d -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision e1f00790384d8dc42812ee952998b3104c36b96d) +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -31,6 +31,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -121,7 +122,7 @@ } } - IndexOrgBean iob; + IndexOrgBean iob = null; if (StringUtils.equals(display, "contents")) { iob = new IndexOrgBean(org.getOrganisationId(), org.getName(), org.getOrganisationType() .getOrganisationTypeId()); @@ -139,6 +140,7 @@ request.setAttribute("orgBean", iob); request.setAttribute("allowSorting", allowSorting); + iob.setAllowSorting(allowSorting && iob.getAllowSorting()); if (org.getEnableSingleActivityLessons() && (contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR))) { // if sinble activity lessons are enabled, put sorted list of tools @@ -282,6 +284,9 @@ DisplayGroupAction.log.error("Failed retrieving user's lessons from database: " + e, e); } orgBean.setLessons(lessonBeans); + if (!lessonBeans.isEmpty()) { + orgBean.setAllowSorting(true); + } // create subgroup beans if (orgBean.getType().equals(OrganisationType.COURSE_TYPE)) { @@ -306,7 +311,12 @@ if (contains(roles, Role.ROLE_GROUP_MANAGER)) { classRoles.add(Role.ROLE_GROUP_MANAGER); } - childOrgBeans.add(createHeaderOrgBean(organisation, classRoles, username, isSysAdmin, true)); + IndexOrgBean childOrgBean = createHeaderOrgBean(organisation, classRoles, username, isSysAdmin, + true); + childOrgBeans.add(childOrgBean); + if (childOrgBean.getLessons() != null && !childOrgBean.getLessons().isEmpty()) { + orgBean.setAllowSorting(true); + } } } Collections.sort(childOrgBeans); @@ -333,7 +343,7 @@ } for (IndexLessonBean bean : map.values()) { - List lessonLinks = new ArrayList(); + LinkedList lessonLinks = new LinkedList(); String url = null; Integer lessonStateId = bean.getState(); if (stateId.equals(OrganisationState.ACTIVE)) { @@ -345,7 +355,7 @@ } else if (stateId.equals(OrganisationState.ARCHIVED)) { if (contains(roles, Role.ROLE_LEARNER)) { if (lessonStateId.equals(Lesson.STARTED_STATE) || lessonStateId.equals(Lesson.FINISHED_STATE)) { - lessonLinks.add(new IndexLinkBean("label.export.portfolio", "javascript:openExportPortfolio(" + lessonLinks.addFirst(new IndexLinkBean("label.export.portfolio", "javascript:openExportPortfolio(" + bean.getId() + ")")); } } @@ -373,20 +383,20 @@ if (map.containsKey(bean.getId())) { bean = map.get(bean.getId()); } - List lessonLinks = bean.getLinks(); + LinkedList lessonLinks = (LinkedList) bean.getLinks(); if (lessonLinks == null) { - lessonLinks = new ArrayList(); + lessonLinks = new LinkedList(); } if ((isGroupManagerOrMonitor && stateId.equals(OrganisationState.ACTIVE)) || (stateId.equals(OrganisationState.ARCHIVED) && contains(roles, Role.ROLE_GROUP_MANAGER))) { - lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:showMonitorLessonDialog(" + bean.getId() + lessonLinks.addFirst(new IndexLinkBean("index.monitor", "javascript:showMonitorLessonDialog(" + bean.getId() + ")", null, "mycourses-monitor-img", null)); } // Adding lesson notifications links if enabled if (isGroupManagerOrMonitor && bean.isEnableLessonNotifications()) { - lessonLinks.add(new IndexLinkBean("index.emailnotifications", + lessonLinks.addFirst(new IndexLinkBean("index.emailnotifications", "javascript:showNotificationsDialog(null," + bean.getId() + ")", null, "mycourses-notifications-img", "index.emailnotifications.tooltip")); } @@ -400,7 +410,7 @@ String link = "javascript:openGradebookLessonMonitorPopup(" + "'" + encodedOrgName + "','" + Configuration.get(ConfigurationKeys.SERVER_URL) + "/gradebook/gradebookMonitoring.do?lessonID=" + bean.getId() + "'," + "850,700,0,0);"; - lessonLinks.add(new IndexLinkBean("index.coursegradebookmonitor", link, null, "mycourses-mark-img", + lessonLinks.addFirst(new IndexLinkBean("index.coursegradebookmonitor", link, null, "mycourses-mark-img", null)); } catch (UnsupportedEncodingException e) { DisplayGroupAction.log.error( @@ -413,14 +423,14 @@ String conditionsLink = Configuration.get(ConfigurationKeys.SERVER_URL) + "/lessonConditions.do?method=getIndexLessonConditions&" + CentralConstants.PARAM_LESSON_ID + "=" + bean.getId() + "&KeepThis=true&TB_iframe=true&height=480&width=610"; - lessonLinks.add(new IndexLinkBean("index.conditions", conditionsLink, "thickbox" + orgId, + lessonLinks.addFirst(new IndexLinkBean("index.conditions", conditionsLink, "thickbox" + orgId, "mycourses-conditions-img", "index.conditions.tooltip")); } // Add delete lesson option if (isGroupManagerOrMonitor) { String removeLessonLink = "javascript:removeLesson(" + bean.getId() + ")"; - lessonLinks.add(new IndexLinkBean("index.remove.lesson", removeLessonLink, null, + lessonLinks.addFirst(new IndexLinkBean("index.remove.lesson", removeLessonLink, null, "mycourses-removelesson-img", "index.remove.lesson.tooltip")); } @@ -492,4 +502,4 @@ } return DisplayGroupAction.learningDesignService; } -} +} \ No newline at end of file Index: lams_central/web/css/index.css =================================================================== diff -u -r9846251a8f282306cc80b8a61de8a62ef959e909 -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_central/web/css/index.css (.../index.css) (revision 9846251a8f282306cc80b8a61de8a62ef959e909) +++ lams_central/web/css/index.css (.../index.css) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -3,7 +3,7 @@ } td#messageCell { - width: 80%; + width: 75%; } #message { @@ -13,10 +13,14 @@ border: 1px solid #3c78b5; } -#linksCell div { - margin: 0 5px 15px 0; +.linksCell { + padding: 0 0 10px 0; } +.linksCell div { + margin: 0 5px 5px 0; +} + .dialogContainer { display: none; } @@ -52,76 +56,19 @@ border-left: none; } -#content-main .row { - overflow: visible; -} - -#content-main .mycourses-right-buttons a { - display: block; - padding-bottom: 4px; -} - -#content-main .split-menu-button>ul { - margin: 0; -} - -#content-main .split-menu-button ul li>a { - background-color: inherit; -} - -#content-main .split-menu-button ul li ul { - font-size: 11px; -} - -#content-main .split-menu-button ul li ul li { - padding-top: 0; - padding-bottom: 0; -} - -#content-main .split-menu-button ul li ul li a { - padding-bottom: 0; -} - -#content-main .split-menu-button a.add-lesson-button{ - border-top: none; - border-left: none; - padding-top: 0; - padding-right: 2px; -} - -#content-main .split-menu-button a.sequence-action-link { - padding-top: 1px; -} - -#content-main .split-menu-button a.add-lesson-button span, -#content-main .split-menu-button a.sequence-action-link span { - display: block; - float: left; - padding-top: 4px; -} - -#content-main .split-menu-button a.add-lesson-button img { - display: block; - float: right; - padding-top: 3px; +.sorting img { border: none; } -#content-main .split-menu-button a.sequence-action-link img { - display: block; - float: right; - padding-top: 4px; - border: none; -} - -#content-main .split-menu-button ul.button-menu span { - padding-left: 5px; -} - #content-main div.j-course-contents { clear: both; + padding-top: 5px; } +.lesson-actions a { + border-bottom: none; +} + .ui-tabs-vertical { border: none; } @@ -151,6 +98,20 @@ border: none; } +.split-ui-button + ul span { + color: #999; +} + +.ui-button, .split-ui-button div { + font-size: 12px !important; + font-weight: normal !important; +} + +.child-org-name { + float: left; + padding-top: 5px; +} + td#actionAccord { width: 15%; padding-top: 1px; Index: lams_central/web/groupContentsLesson.jsp =================================================================== diff -u --- lams_central/web/groupContentsLesson.jsp (revision 0) +++ lams_central/web/groupContentsLesson.jsp (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -0,0 +1,47 @@ +<%@ page contentType="text/html; charset=utf-8" language="java"%> + +<%@ taglib uri="tags-fmt" prefix="fmt"%> +<%@ taglib uri="tags-core" prefix="c"%> + + +
+ + + + + + + " class="sequence-name-link"> + + + + + ">  + + + ">  + + + ">  + + + ">  + + + +
+
Index: lams_central/web/images/css/lesson_disabled.png =================================================================== diff -u -raa82454797cd10ef79e35ea526cd29282d26ee6a -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 Binary files differ Index: lams_central/web/images/css/mycourses_monitor.png =================================================================== diff -u -raa82454797cd10ef79e35ea526cd29282d26ee6a -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 Binary files differ Index: lams_central/web/includes/javascript/groupDisplay.js =================================================================== diff -u -rc88e27be7f757370c0c6febf1ed98552a978050f -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision c88e27be7f757370c0c6febf1ed98552a978050f) +++ lams_central/web/includes/javascript/groupDisplay.js (.../groupDisplay.js) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -1,40 +1,19 @@ function initMainPage() { + initButtons(); + $('#orgTabs').tabs({ 'activate' : function(event, ui){ loadOrgTab(ui.newPanel); } }).addClass('ui-tabs-vertical ui-helper-clearfix') .find('li').removeClass('ui-corner-top').addClass('ui-corner-left'); - + loadOrgTab($('.orgTab').first()); $("#actionAccord").accordion({ 'heightStyle' : 'content' }); - - $(".split-menu-button li em") - .live( - "click", - function(event) { - var hidden = $(this).parents("li").children("ul").is( - ":hidden"); - $(this).parents("li").children("ul").hide(); - $(this).parents("li").children("a").removeClass( - "zoneCur"); - if (hidden) { - $(this).parents("li").children("ul").toggle() - .parents("li").children("a").addClass( - "zoneCur"); - } - - event.stopPropagation(); - }); - - $("html").click(function() { - $(".split-menu-button>ul>li>ul").hide(); - }); - // initialise lesson dialog $('#addLessonDialog').dialog( { @@ -178,10 +157,11 @@ function loadOrgTab(orgTab, refresh) { if (!orgTab) { - orgTab = $('div[id^=orgTab-' + $('#orgTabs').tabs('option','active') + ']'); + orgTab = $('div.orgTab[id^=orgTab-' + $('#orgTabs').tabs('option','active') + ']'); } if (refresh || !orgTab.text()) { - var orgId = orgTab.attr("id").split('-')[2]; + var orgTabId = orgTab.attr("id"); + var orgId = orgTabId.split('-')[3]; orgTab.load( "displayGroup.do", @@ -191,12 +171,11 @@ orgId : orgId }, function() { - $('.mycourses-left-buttons', orgTab).remove(); - toggleGroupContents(orgTab, stateId); $("a[class*='thickbox']", orgTab).each(function() { tb_init(this); }); - initMoreActions(orgTab); + + initButtons(orgTabId); }); } } @@ -287,6 +266,37 @@ }); } +function initButtons(containerId) { + var container = containerId ? $('#' + containerId) : document; + + $(".ui-button", container).button(); + $(".split-ui-button", container).each(function(){ + var buttonContainer = $(this); + var buttons = buttonContainer.children(); + buttons.first().button(); + if (buttons.length > 1) { + buttons.last().button({ + text : false, + icons : { + primary : "ui-icon-triangle-1-s" + } + }); + } + + buttons.last().click(function() { + var menu = $(this).parent().next().show().position({ + my : "left top", + at : "left bottom", + of : $(this) + }); + $(document).one("click", function() { + menu.hide(); + }); + return false; + }).parent().buttonset().next().hide().menu(); + }); +} + function initMoreActions(element) { var id = jQuery(element).attr("id"); @@ -338,6 +348,23 @@ } } +// for redesigned main.jsp +function makeOrgSortable2(orgId) { + var org = jQuery("div.orgTab[id$='-org-" + orgId + "']"); + $(".lesson-table", org).each(function() { + makeSortable(this); + }); + + $("a.sorting", org).attr({ + "onClick" : null, + "title" : LABELS.SORTING_DISABLE + }).off('click').click(function(){ + makeOrgUnsortable2(orgId); + }).find("img") + .attr("src", "images/sorting_enabled.gif"); + +} + function makeOrgUnsortable(orgId) { var org = jQuery("div.course-bg#" + orgId); var jLessons = jQuery("div.j-lessons#" + orgId + "-lessons"); @@ -353,12 +380,28 @@ + "\">"); } +function makeOrgUnsortable2(orgId) { + var org = jQuery("div.orgTab[id$='-org-" + orgId + "']"); + $(".lesson-table", org).each(function() { + $(this).sortable('destroy'); + }); + + $("a.sorting", org).attr({ + "onClick" : null, + "title" : LABELS.SORTING_ENABLE + }).off('click').click(function(){ + makeOrgSortable2(orgId); + }).find("img") + .attr("src", "images/sorting_disabled.gif"); +} + function makeSortable(element) { - jQuery(element).sortable( + $(element).sortable( { axis : "y", delay : 100, tolerance : 'pointer', + cursor : 'n-resize', helper : function(e, tr) { var $originals = tr.children(); var $helper = tr.clone(); @@ -373,15 +416,18 @@ forcePlaceholderSize : true, containment : 'parent', stop : function() { - var ids = jQuery(this).sortable('toArray'); + var ids = $(this).sortable('toArray'); - var jLessonsId = jQuery(this).parents( + var jLessonsId = $(this).parents( "div[class$='lessons']").attr("id"); + if (!jLessonsId) { + jLessonsId = $(this).attr("id"); + } var dashIndex = jLessonsId.indexOf("-"); var orgId = (dashIndex > 0 ? jLessonsId.substring(0, dashIndex) : jLessonsId); - jQuery.ajax({ + $.ajax({ url : "servlet/saveLessonOrder", data : { orgId : orgId, @@ -483,4 +529,4 @@ function closeWizard() { setTimeout(refresh, 1000); tb_remove(); -} +} \ No newline at end of file Index: lams_central/web/main2.jsp =================================================================== diff -u -r33da76d05725a84e191a5f6dca50b394cca3c1ee -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_central/web/main2.jsp (.../main2.jsp) (revision 33da76d05725a84e191a5f6dca50b394cca3c1ee) +++ lams_central/web/main2.jsp (.../main2.jsp) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -157,25 +157,23 @@
Important annoucements might be posted here...
- + -
- " href='' class="button"> + -
- " href="javascript:loadOrgTab(null, true)" class="button"> + + + -
- + @@ -190,14 +188,14 @@
  • - +
-
+
Index: lams_common/src/java/org/lamsfoundation/lams/index/IndexOrgBean.java =================================================================== diff -u -r71656c8c9e7d6a21d584bef610eff2c48b50fa66 -r9948b6f3d51147a1325de6e18651a1d9bce1cea4 --- lams_common/src/java/org/lamsfoundation/lams/index/IndexOrgBean.java (.../IndexOrgBean.java) (revision 71656c8c9e7d6a21d584bef610eff2c48b50fa66) +++ lams_common/src/java/org/lamsfoundation/lams/index/IndexOrgBean.java (.../IndexOrgBean.java) (revision 9948b6f3d51147a1325de6e18651a1d9bce1cea4) @@ -30,152 +30,186 @@ /** * @version - * - *

- * View Source - *

- * + * + *

+ * View Source + *

+ * * @author Fei Yang - * - * Created at 10:01:23 on 14/06/2006 + * + * Created at 10:01:23 on 14/06/2006 */ public class IndexOrgBean implements Comparable { - - private Integer id; - private String name; - private Date archivedDate; - private Integer type; - private List links; - private List moreLinks; - private List lessons; - private List childIndexOrgBeans; - - - public IndexOrgBean(Integer id, String name, Integer type) { - this.id = id; - this.name = name; - this.type = type; - this.links = new ArrayList(); - this.lessons = new ArrayList(); - this.childIndexOrgBeans = new ArrayList(); - } - /** - * @return Returns the childIndexOrgBeans. - */ - public List getChildIndexOrgBeans() { - return childIndexOrgBeans; - } - /** - * @param childIndexOrgBeans The childIndexOrgBeans to set. - */ - public void setChildIndexOrgBeans(List childIndexOrgBeans) { - this.childIndexOrgBeans = childIndexOrgBeans; - } - /** - * @return Returns the lessons. - */ - public List getLessons() { - return lessons; - } - /** - * @param lessons The lessons to set. - */ - public void setLessons(List lessons) { - this.lessons = lessons; - } - /** - * @return Returns the links. - */ - public List getLinks() { - return links; - } - /** - * @param links The links to set. - */ - public void setLinks(List links) { - this.links = links; - } - /** - * @return Returns the moreLinks - */ - public List getMoreLinks() { - return moreLinks; - } - /** - * - * @param moreLinks The moreLinks to set - */ - public void setMoreLinks(List moreLinks) { - this.moreLinks = moreLinks; - } - /** - * @return Returns the id. - */ - public Integer getId() { - return id; - } - /** - * @param id The id to set. - */ - public void setId(Integer id) { - this.id = id; - } - /** - * @return Returns the name. - */ - public String getName() { - return name; - } - /** - * @param name The name to set. - */ - public void setName(String name) { - this.name = name; - } - /** - * @return Returns the type. - */ - public Integer getType() { - return type; - } - /** - * @param type The type to set. - */ - public void setType(Integer type) { - this.type = type; - } - /** - * @return Returns the archived date. - */ - public Date getArchivedDate() { - return archivedDate; - } - /** - * @param type The archived date to set. - */ - public void setArchivedDate(Date archivedDate) { - this.archivedDate = archivedDate; - } - - public int compareTo(Object indexOrgBean){ - IndexOrgBean b = (IndexOrgBean)indexOrgBean; - return name.compareTo(b.getName()); + + private Integer id; + private String name; + private Date archivedDate; + private Integer type; + private Boolean allowSorting = false; + private List links; + private List moreLinks; + private List lessons; + private List childIndexOrgBeans; + + public IndexOrgBean(Integer id, String name, Integer type) { + this.id = id; + this.name = name; + this.type = type; + this.links = new ArrayList(); + this.lessons = new ArrayList(); + this.childIndexOrgBeans = new ArrayList(); } - - public boolean equals(Object other) { - if ( !(other instanceof IndexOrgBean) ) return false; - IndexOrgBean castOther = (IndexOrgBean) other; - return new EqualsBuilder() - .append(this.getId(), castOther.getId()) - .isEquals(); + + /** + * @return Returns the childIndexOrgBeans. + */ + public List getChildIndexOrgBeans() { + return childIndexOrgBeans; } - - public void addLesson(IndexLessonBean lesson) { - lessons.add(lesson); + + /** + * @param childIndexOrgBeans + * The childIndexOrgBeans to set. + */ + public void setChildIndexOrgBeans(List childIndexOrgBeans) { + this.childIndexOrgBeans = childIndexOrgBeans; + } + + /** + * @return Returns the lessons. + */ + public List getLessons() { + return lessons; + } + + /** + * @param lessons + * The lessons to set. + */ + public void setLessons(List lessons) { + this.lessons = lessons; + } + + /** + * @return Returns the links. + */ + public List getLinks() { + return links; + } + + /** + * @param links + * The links to set. + */ + public void setLinks(List links) { + this.links = links; + } + + /** + * @return Returns the moreLinks + */ + public List getMoreLinks() { + return moreLinks; + } + + /** + * + * @param moreLinks + * The moreLinks to set + */ + public void setMoreLinks(List moreLinks) { + this.moreLinks = moreLinks; + } + + /** + * @return Returns the id. + */ + public Integer getId() { + return id; + } + + /** + * @param id + * The id to set. + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * @return Returns the name. + */ + public String getName() { + return name; + } + + /** + * @param name + * The name to set. + */ + public void setName(String name) { + this.name = name; + } + + /** + * @return Returns the type. + */ + public Integer getType() { + return type; + } + + /** + * @param type + * The type to set. + */ + public void setType(Integer type) { + this.type = type; + } + + /** + * @return Returns the archived date. + */ + public Date getArchivedDate() { + return archivedDate; + } + + /** + * @param type + * The archived date to set. + */ + public void setArchivedDate(Date archivedDate) { + this.archivedDate = archivedDate; + } + + @Override + public int compareTo(Object indexOrgBean) { + IndexOrgBean b = (IndexOrgBean) indexOrgBean; + return name.compareTo(b.getName()); + } + + @Override + public boolean equals(Object other) { + if (!(other instanceof IndexOrgBean)) { + return false; } - - public void addChildOrgBean(IndexOrgBean orgBean) { - childIndexOrgBeans.add(orgBean); - } + IndexOrgBean castOther = (IndexOrgBean) other; + return new EqualsBuilder().append(this.getId(), castOther.getId()).isEquals(); + } + public void addLesson(IndexLessonBean lesson) { + lessons.add(lesson); + } + + public void addChildOrgBean(IndexOrgBean orgBean) { + childIndexOrgBeans.add(orgBean); + } + + public Boolean getAllowSorting() { + return allowSorting; + } + + public void setAllowSorting(Boolean allowSorting) { + this.allowSorting = allowSorting; + } + }