Skip to content
Snippets Groups Projects
Commit 6ec4f62c authored by srosse's avatar srosse
Browse files

OO-49: fix number of person in course and update of this number while browsing the course

parent 4d8a4205
No related branches found
No related tags found
No related merge requests found
...@@ -657,11 +657,13 @@ public class RunMainController extends MainLayoutBasicController implements Gene ...@@ -657,11 +657,13 @@ public class RunMainController extends MainLayoutBasicController implements Gene
} }
//re set current user count but not every click //re set current user count but not every click
if (currentUserCountLink != null && event.hashCode() % 2 == 0) { if (currentUserCountLink != null) {
OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, course.getResourceableId()); OLATResourceable courseRunOres = OresHelper.createOLATResourceableInstance(RunMainController.ORES_TYPE_COURSE_RUN, course.getResourceableId());
int cUsers = CoordinatorManager.getInstance().getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres); int cUsers = CoordinatorManager.getInstance().getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres);
if (cUsers == 0) cUsers = 1; if (cUsers == 0) {
currentUserCountLink.setCustomDisplayText("    "+String.valueOf(cUsers)+" "+getTranslator().translate("participants.in.course")); cUsers = 1;
}
currentUserCountLink.setCustomDisplayText(getTranslator().translate("participants.in.course", new String[]{ String.valueOf(cUsers) }));
currentUserCountLink.setEnabled(false); currentUserCountLink.setEnabled(false);
} }
} }
...@@ -1277,7 +1279,10 @@ public class RunMainController extends MainLayoutBasicController implements Gene ...@@ -1277,7 +1279,10 @@ public class RunMainController extends MainLayoutBasicController implements Gene
return; return;
} }
currentUserCount = 1 + CoordinatorManager.getInstance().getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres); currentUserCount = CoordinatorManager.getInstance().getCoordinator().getEventBus().getListeningIdentityCntFor(courseRunOres);
if(currentUserCount == 0) {
currentUserCount = 1;
}
currentUserCountLink.setCustomDisplayText( currentUserCountLink.setCustomDisplayText(
translate( translate(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment