Integrated link to races view for single regatta and series events which

can be enabled/disabled via experimental features flag
This commit is contained in:
Benjamin Barth committed 2015-08-25 17:16:22 +02:00
1 parent 06fdce3505
commit d4cb686e84
6 files changed
+22 -20

No files matched your search

@@ -32,6 +32,6 @@ public class RegattaRacesPlace extends AbstractEventRegattaPlace implements Mobi
@Override
public boolean hasMobileVersion() {
return ExperimentalFeatures.SHOW_RACES_ON_MOBILE;
return ExperimentalFeatures.SHOW_REGATTA_OVERVIEW_AND_RACES_ON_MOBILE;
}
}
@@ -61,7 +61,7 @@ public class RegattaStatus extends Composite implements RefreshableWidget<Regatt
}
private RegattaStatusRegatta addRegatta(MobileSection container, RegattaMetadataDTO regatta) {
PlaceNavigation<?> placeNavigation = ExperimentalFeatures.SHOW_REGATTA_OVERVIEW_ON_MOBILE ?
PlaceNavigation<?> placeNavigation = ExperimentalFeatures.SHOW_REGATTA_OVERVIEW_AND_RACES_ON_MOBILE ?
presenter.getRegattaOverviewNavigation(regatta.getId()) : presenter.getRegattaMiniLeaderboardNavigation(regatta.getId());
RegattaStatusRegatta regattaWidget = new RegattaStatusRegatta(regatta, placeNavigation);
container.addContent(regattaWidget);
@@ -8,14 +8,18 @@ import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;
import com.sap.sailing.gwt.home.client.place.event.regatta.tabs.reload.RefreshManager;
import com.sap.sailing.gwt.home.mobile.partials.eventheader.EventHeader;
import com.sap.sailing.gwt.home.mobile.partials.quickfinder.Quickfinder;
import com.sap.sailing.gwt.home.mobile.partials.section.MobileSection;
import com.sap.sailing.gwt.home.mobile.partials.sectionHeader.SectionHeaderContent;
import com.sap.sailing.gwt.home.mobile.partials.simpleinfoblock.SimpleInfoBlock;
import com.sap.sailing.gwt.home.mobile.places.QuickfinderPresenter;
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventType;
import com.sap.sailing.gwt.ui.shared.eventview.RegattaMetadataDTO;
@@ -71,6 +75,16 @@ public abstract class AbstractEventView<P extends EventViewBase.Presenter> exten
protected void setQuickFinderValues(Quickfinder quickfinder, Collection<RegattaMetadataDTO> regattaMetadatas) {
QuickfinderPresenter.getForRegattaLeaderboards(quickfinder, currentPresenter, regattaMetadatas);
}
protected void initRacesNavigation(Panel container) {
MobileSection mobileSection = new MobileSection();
SectionHeaderContent header = new SectionHeaderContent();
header.setSectionTitle(StringMessages.INSTANCE.racesCount(currentPresenter.getCtx().getRegatta().getRaceCount()));
header.setInfoText(StringMessages.INSTANCE.showAll());
header.setClickAction(currentPresenter.getRegattaRacesNavigation(getRegattaId()));
mobileSection.addHeader(header);
container.add(mobileSection);
}
@Override
public final void setQuickFinderValues(Collection<RegattaMetadataDTO> regattaMetadatas) {
@@ -70,6 +70,9 @@ public class EventViewImpl extends AbstractEventView<EventView.Presenter> implem
miniLeaderboard.setAction(MSG.showAll(), currentPresenter.getRegattaMiniLeaderboardNavigation(getRegattaId()));
container.add(miniLeaderboard);
refreshManager.add(miniLeaderboard, new GetMiniLeaderbordAction(getEventId(), getRegattaId(), 3));
if (ExperimentalFeatures.SHOW_REGATTA_OVERVIEW_AND_RACES_ON_MOBILE) {
initRacesNavigation(container);
}
}
}
@@ -7,8 +7,6 @@ import com.google.gwt.user.client.ui.Panel;
import com.sap.sailing.gwt.home.mobile.partials.eventsteps.EventSteps;
import com.sap.sailing.gwt.home.mobile.partials.minileaderboard.MinileaderboardBox;
import com.sap.sailing.gwt.home.mobile.partials.quickfinder.Quickfinder;
import com.sap.sailing.gwt.home.mobile.partials.section.MobileSection;
import com.sap.sailing.gwt.home.mobile.partials.sectionHeader.SectionHeaderContent;
import com.sap.sailing.gwt.home.mobile.partials.statisticsBox.StatisticsBox;
import com.sap.sailing.gwt.home.mobile.partials.updatesBox.UpdatesBox;
import com.sap.sailing.gwt.home.mobile.places.QuickfinderPresenter;
@@ -60,16 +58,6 @@ public class RegattaViewImpl extends AbstractEventView<RegattaView.Presenter> im
}
}
private void initRacesNavigation(Panel container) {
MobileSection mobileSection = new MobileSection();
SectionHeaderContent header = new SectionHeaderContent();
header.setSectionTitle(StringMessages.INSTANCE.racesCount(currentPresenter.getCtx().getRegatta().getRaceCount()));
header.setInfoText(StringMessages.INSTANCE.showAll());
header.setClickAction(currentPresenter.getRegattaRacesNavigation(getRegattaId()));
mobileSection.addHeader(header);
container.add(mobileSection);
}
private void initStatisticsUi(Panel container) {
statisticsUi = new StatisticsBox(false);
// FIXME only show statistics of the regatta
@@ -22,13 +22,10 @@ public class ExperimentalFeatures {
*/
public static final boolean SHOW_RACES_COMPETITION_FORMAT = false;
/**
* Provide option to show races (competition format) on mobile devices
* Provide option to show the overview for regattas in multi regatta events and a navigation
* to the races view (competition format) for single regatta and series events on mobile devices
*/
public static final boolean SHOW_RACES_ON_MOBILE = true;
/**
* Provide option to show the overview for regattas in multi regatta events on mobile devices
*/
public static final boolean SHOW_REGATTA_OVERVIEW_ON_MOBILE = false;
public static final boolean SHOW_REGATTA_OVERVIEW_AND_RACES_ON_MOBILE = false;
/**
* Provide option to show the regatta progress for single regatta and series event on mobile devices
*/