diff --git a/JavaSource/org/unitime/timetable/gwt/client/reservations/ReservationTable.java b/JavaSource/org/unitime/timetable/gwt/client/reservations/ReservationTable.java index fb24a58344..3dd284204b 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/reservations/ReservationTable.java +++ b/JavaSource/org/unitime/timetable/gwt/client/reservations/ReservationTable.java @@ -201,9 +201,13 @@ private void clear(boolean loading) { else iHeader.clearMessage(); } + + public void populate(List reservations) { + populate(reservations, -1); + } - public void populate(List reservations) { + public void populate(List reservations, int owLimit) { List header = new ArrayList(); for (final ReservationColumn column: ReservationColumn.values()) { @@ -297,10 +301,10 @@ public String getName() { for (IdName student: ((IndividualReservation) reservation).getStudents()) { students.add(new Label(student.getName(), false)); } - if (students.getWidgetCount() > 6) { - int more = students.getWidgetCount(); - while (students.getWidgetCount() > 5) - students.remove(5); + if (owLimit > 0 && students.getWidgetCount() > owLimit + 1) { + int more = students.getWidgetCount() - owLimit; + while (students.getWidgetCount() > owLimit) + students.remove(owLimit); Label l = new Label(MESSAGES.moreItems(more), false); l.getElement().getStyle().setMarginLeft(10, Unit.PX); students.add(l); } @@ -387,10 +391,10 @@ else if (firstClasf) { l.getElement().getStyle().setMarginLeft(10, Unit.PX); owner.add(l); } - if (owner.getWidgetCount() > 6) { - int more = owner.getWidgetCount() - 5; - while (owner.getWidgetCount() > 5) - owner.remove(5); + if (owLimit > 0 && owner.getWidgetCount() > owLimit + 1) { + int more = owner.getWidgetCount() - owLimit; + while (owner.getWidgetCount() > owLimit) + owner.remove(owLimit); Label l = new Label(MESSAGES.moreItems(more), false); l.getElement().getStyle().setMarginLeft(10, Unit.PX); owner.add(l); } @@ -412,6 +416,13 @@ else if (firstClasf) { for (Clazz clazz: reservation.getClasses()) { restrictions.add(new Label(clazz.getName() + (clazz.getLimit() == null ? "" : " (" + clazz.getLimit() + ")"), false)); } + if (owLimit > 0 && restrictions.getWidgetCount() > owLimit + 1) { + int more = restrictions.getWidgetCount() - owLimit; + while (restrictions.getWidgetCount() > owLimit) + restrictions.remove(owLimit); + Label l = new Label(MESSAGES.moreItems(more), false); l.getElement().getStyle().setMarginLeft(10, Unit.PX); + restrictions.add(l); + } line.add(restrictions); if (reservation.hasInclusive() && reservation.isInclusive()) { restrictions.addStyleName("unitime-ReservationInclusive"); diff --git a/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java b/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java index 9a75100096..9fe51b2a2d 100644 --- a/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java +++ b/JavaSource/org/unitime/timetable/gwt/client/sectioning/SectioningStatusPage.java @@ -3154,7 +3154,7 @@ public void onSuccess(List result) { } if (result != null && !result.isEmpty() && iMouseOver) { ReservationTable rt = new ReservationTable(false, false); - rt.populate(result); + rt.populate(result, 5); rt.getTable().setColumnVisible(ReservationColumn.LAST_LIKE.ordinal(), false); rt.getTable().setColumnVisible(ReservationColumn.PROJECTED_BY_RULE.ordinal(), false); rt.getTable().setColumnVisible(ReservationColumn.EXPIRATION_DATE.ordinal(), iOnline);