fixed navigation of series leaderboard link

This commit is contained in:
fmittag committed 2014-10-25 16:41:41 +02:00
1 parent c7aa8819ff
commit d27125494e
4 files changed
+14 -10

No files matched your search

@@ -71,7 +71,8 @@ public class EventHeader extends AbstractEventComposite {
// private final List<Anchor> links3;
private final PlaceNavigator placeNavigator;
private PlaceNavigation<LeaderboardPlace> overallLeaderboardNavigation = null;
public EventHeader(EventDTO event, PlaceNavigator placeNavigator, EventPageNavigator pageNavigator) {
super(event, pageNavigator);
@@ -143,6 +144,10 @@ public class EventHeader extends AbstractEventComposite {
if(isSeries) {
LeaderboardGroupDTO leaderboardGroupDTO = event.getLeaderboardGroups().get(0);
eventName = leaderboardGroupDTO.getDisplayName() != null ? leaderboardGroupDTO.getDisplayName() : leaderboardGroupDTO.getName();
String overallLeaderboardName = leaderboardGroupDTO.getName() + " " + LeaderboardNameConstants.OVERALL;
overallLeaderboardNavigation = placeNavigator.getLeaderboardNavigation(event.id.toString(), overallLeaderboardName, event.getBaseURL(), event.isOnRemoteServer());
seriesLeaderboardAnchor.setHref(overallLeaderboardNavigation.getTargetUrl());
StrippedLeaderboardDTO leaderboardFittingToEvent = findLeaderboardWithSameCourseArea(event);
if(leaderboardFittingToEvent != null) {
@@ -229,12 +234,8 @@ public class EventHeader extends AbstractEventComposite {
@UiHandler("seriesLeaderboardAnchor")
void seriesLeaderboardClicked(ClickEvent clickevent) {
EventDTO event = getEvent();
if(event.isFakeSeries()) {
LeaderboardGroupDTO leaderboardGroupDTO = getEvent().getLeaderboardGroups().get(0);
String overallLeaderboardName = leaderboardGroupDTO.getName() + " " + LeaderboardNameConstants.OVERALL;
PlaceNavigation<LeaderboardPlace> leaderboardNavigation = placeNavigator.getLeaderboardNavigation(event.id.toString(), overallLeaderboardName, event.getBaseURL(), event.isOnRemoteServer());
placeNavigator.goToPlace(leaderboardNavigation);
if(event.isFakeSeries() && overallLeaderboardNavigation != null) {
placeNavigator.goToPlace(overallLeaderboardNavigation);
}
}
@@ -53,7 +53,7 @@
</div>
<div ui:field="seriesLeaderboardDiv" class="{local_res.css.eventheader_sharing}">
<div class="{style.action}">
<g:Anchor ui:field="seriesLeaderboardAnchor" href="javascript:;" styleName="{res.mainCss.button} {style.action_link}"><ui:text from='{i18n.overallLeaderboard}'/></g:Anchor>
<g:Anchor ui:field="seriesLeaderboardAnchor" styleName="{res.mainCss.button} {style.action_link}"><ui:text from='{i18n.overallLeaderboard}'/></g:Anchor>
</div>
</div>
</div>
@@ -297,7 +297,7 @@ public interface SailingService extends RemoteService {
void renameEvent(UUID eventId, String newName);
EventDTO getEventById(UUID id, boolean withStatisticalData);
EventDTO getEventById(UUID id, boolean withStatisticalData) throws Exception;
Iterable<String> getScoreCorrectionProviderNames();
@@ -3387,11 +3387,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
}
@Override
public EventDTO getEventById(UUID id, boolean withStatisticalData) {
public EventDTO getEventById(UUID id, boolean withStatisticalData) throws MalformedURLException {
EventDTO result = null;
String requestBaseURL = getRequestBaseURL().toString();
Event event = getService().getEvent(id);
if (event != null) {
result = convertToEventDTO(event, withStatisticalData);
result.setBaseURL(requestBaseURL);
result.setIsOnRemoteServer(false);
}
return result;
}