mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 14:57:12 +00:00
Preparing for slow transition, partially relying on old object model
This commit is contained in:
1 parent
df4760f854
commit
ee53a2cdc2
27 files changed
+988
-152
No files matched your search
+4
-4
@@ -6,9 +6,9 @@ import com.sap.sailing.gwt.common.client.controls.tabbar.TabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventClientFactory;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.EventView.PlaceCallback;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventReferenceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventType;
|
||||
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.RegattaReferenceDTO;
|
||||
|
||||
public abstract class EventActivity<PLACE extends AbstractEventPlace> extends AbstractActivity implements EventView.Presenter {
|
||||
@@ -43,8 +43,8 @@ public abstract class EventActivity<PLACE extends AbstractEventPlace> extends Ab
|
||||
|
||||
@Override
|
||||
public void forPlaceSelection(PlaceCallback callback) {
|
||||
EventMetadataDTO event = ctx.getEventDTO();
|
||||
if(event.getType() == EventType.SERIES_EVENT) {
|
||||
EventViewDTO event = ctx.getEventDTO();
|
||||
if (event.getType() == EventType.SERIES_EVENT) {
|
||||
for(EventReferenceDTO seriesEvent : event.getEventsOfSeries()) {
|
||||
RegattaOverviewPlace place = new RegattaOverviewPlace(new EventContext().withId(seriesEvent.getId().toString()));
|
||||
callback.forPlace(place, seriesEvent.getDisplayName());
|
||||
|
||||
+5
-5
@@ -11,8 +11,8 @@ import com.sap.sailing.gwt.home.client.place.event2.multiregatta.tabs.Multiregat
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.AbstractEventRegattaPlace;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.EventRegattaActivity;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventType;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventType;
|
||||
import com.sap.sse.gwt.client.mvp.AbstractActivityProxy;
|
||||
|
||||
public class EventActivityProxy extends AbstractActivityProxy {
|
||||
@@ -34,9 +34,9 @@ public class EventActivityProxy extends AbstractActivityProxy {
|
||||
} else {
|
||||
final UUID eventUUID = UUID.fromString(ctx.getEventId());
|
||||
|
||||
clientFactory.getSailingService().getEventMetadataById(eventUUID, new AsyncCallback<EventMetadataDTO>() {
|
||||
clientFactory.getSailingService().getEventViewById(eventUUID, new AsyncCallback<EventViewDTO>() {
|
||||
@Override
|
||||
public void onSuccess(final EventMetadataDTO event) {
|
||||
public void onSuccess(final EventViewDTO event) {
|
||||
if (event != null) {
|
||||
ctx.updateContext(event);
|
||||
afterLoad();
|
||||
@@ -82,7 +82,7 @@ public class EventActivityProxy extends AbstractActivityProxy {
|
||||
}
|
||||
|
||||
private AbstractEventPlace getRealPlace() {
|
||||
EventMetadataDTO event = ctx.getEventDTO();
|
||||
EventViewDTO event = ctx.getEventDTO();
|
||||
if(event.getType() == EventType.SERIES_EVENT) {
|
||||
return new RegattaOverviewPlace(ctx);
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2;
|
||||
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
|
||||
/**
|
||||
* Common context used by the different tabs in the event place.
|
||||
@@ -16,13 +16,13 @@ public class EventContext {
|
||||
/**
|
||||
* Common state required by all tabs/ places in event
|
||||
*/
|
||||
private EventMetadataDTO eventDTO;
|
||||
private EventViewDTO eventDTO;
|
||||
|
||||
|
||||
public EventContext() {
|
||||
}
|
||||
|
||||
public EventContext(EventMetadataDTO dto) {
|
||||
public EventContext(EventViewDTO dto) {
|
||||
updateContext(dto);
|
||||
}
|
||||
|
||||
@@ -48,17 +48,17 @@ public class EventContext {
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
public EventContext updateContext(EventMetadataDTO dto) {
|
||||
public EventContext updateContext(EventViewDTO dto) {
|
||||
this.eventDTO = dto;
|
||||
if (eventDTO == null) {
|
||||
withId(null);
|
||||
} else {
|
||||
withId(dto.getId().toString());
|
||||
withId(dto.id.toString());
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public EventMetadataDTO getEventDTO() {
|
||||
public EventViewDTO getEventDTO() {
|
||||
return eventDTO;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -30,8 +30,8 @@ import com.sap.sailing.gwt.home.client.place.event2.EventView.PlaceCallback;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.EventView.Presenter;
|
||||
import com.sap.sailing.gwt.home.client.shared.EventDatesFormatterUtil;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventState;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventState;
|
||||
|
||||
public class EventHeader extends Composite {
|
||||
private static EventHeaderUiBinder uiBinder = GWT.create(EventHeaderUiBinder.class);
|
||||
@@ -62,7 +62,7 @@ public class EventHeader extends Composite {
|
||||
|
||||
@UiField FlowPanel dropdownContent;
|
||||
|
||||
private EventMetadataDTO event;
|
||||
private EventViewDTO event;
|
||||
|
||||
private Presenter presenter;
|
||||
|
||||
@@ -87,7 +87,7 @@ public class EventHeader extends Composite {
|
||||
eventLogo.setAlt(event.getName());
|
||||
|
||||
eventDate.setInnerHTML(EventDatesFormatterUtil.formatDateRangeWithYear(event.startDate, event.endDate));
|
||||
String venue = event.getVenue();
|
||||
String venue = event.getVenue().getName();
|
||||
if(event.getVenueCountry() != null && !event.getVenueCountry().isEmpty()) {
|
||||
venue += ", " + event.getVenueCountry();
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregat
|
||||
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.EventMultiregattaView.Presenter;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.multiregatta.MultiregattaTabView;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.RegattaReferenceDTO;
|
||||
|
||||
/**
|
||||
@@ -45,7 +45,7 @@ public class MultiregattaRegattasTabView extends Composite implements Multiregat
|
||||
|
||||
initWidget(ourUiBinder.createAndBindUi(this));
|
||||
|
||||
EventMetadataDTO event = myPlace.getCtx().getEventDTO();
|
||||
EventViewDTO event = myPlace.getCtx().getEventDTO();
|
||||
for (final RegattaReferenceDTO regatta : event.getRegattas()) {
|
||||
PushButton button = new PushButton();
|
||||
button.setText(regatta.getDisplayName());
|
||||
|
||||
+3
-3
@@ -5,8 +5,8 @@ import com.google.gwt.user.client.ui.AcceptsOneWidget;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventClientFactory;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.EventActivity;
|
||||
import com.sap.sailing.gwt.home.client.place.event2.regatta.tabs.RegattaOverviewPlace;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventType;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventType;
|
||||
|
||||
public class EventRegattaActivity extends EventActivity<AbstractEventRegattaPlace> implements EventRegattaView.Presenter {
|
||||
|
||||
@@ -25,7 +25,7 @@ public class EventRegattaActivity extends EventActivity<AbstractEventRegattaPlac
|
||||
|
||||
@Override
|
||||
public boolean needsSelectionInHeader() {
|
||||
EventMetadataDTO event = ctx.getEventDTO();
|
||||
EventViewDTO event = ctx.getEventDTO();
|
||||
return (event.getType() == EventType.SERIES_EVENT || event.getType() == EventType.MULTI_REGATTA);
|
||||
}
|
||||
|
||||
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
.regatta {
|
||||
font-size: 15px;
|
||||
/* @alternate */ font-size: 1rem;
|
||||
border-bottom: 1px solid #d9d9d9;
|
||||
padding: 1.333333333333333em 0;
|
||||
}
|
||||
.regatta[data-rendermode='compact'] {
|
||||
border-top: 1px solid #ccc;
|
||||
padding-left: 4em;
|
||||
padding-right: 4em;
|
||||
}
|
||||
.regatta[data-rendermode='compact'] .regatta_intro_details_itemhideoncompact {
|
||||
display: none;
|
||||
}
|
||||
.regatta[data-rendermode='link']:hover,
|
||||
.regatta[data-rendermode='link']:focus {
|
||||
background-color: #fcfcfc;
|
||||
}
|
||||
.regatta[data-rendermode='link']:nth-child(odd) {
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.regatta[data-rendermode='link']:nth-child(odd):hover,
|
||||
.regatta[data-rendermode='link']:nth-child(odd):focus {
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
.regatta_intro {
|
||||
display: block;
|
||||
padding-left: 10.333333333333334em;
|
||||
min-height: 9.333333333333334em;
|
||||
position: relative;
|
||||
}
|
||||
.regatta_intro:hover,
|
||||
.regatta_intro:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
.regatta_intro_image {
|
||||
border: 1px solid #ccc;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
.regatta_intro_header {
|
||||
margin-bottom: 0.666666666666667em;
|
||||
padding-top: 0.333333333333333em;
|
||||
padding-bottom: 0.666666666666667em;
|
||||
border-bottom: 1px solid #ccc;
|
||||
position: relative;
|
||||
}
|
||||
.regatta_intro_header_name {
|
||||
display: inline-block;
|
||||
font-size: 1.333333333333333em;
|
||||
margin: 0;
|
||||
margin-right: 0.266666666666667em;
|
||||
}
|
||||
.regatta_intro_header_namelink:hover,
|
||||
.regatta_intro_header_namelink:focus {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.regatta_intro_header_details {
|
||||
text-align: right;
|
||||
}
|
||||
.regatta_intro_header_details_item {
|
||||
display: inline-block;
|
||||
padding: 0.2em 1em 0.2em 0;
|
||||
margin-right: 1em;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
.regatta_intro_header_details_item:last-child {
|
||||
padding-right: 0;
|
||||
margin-right: 0;
|
||||
border-right-width: 0;
|
||||
}
|
||||
.regatta_intro_header_details_item_value {
|
||||
color: #008fcc;
|
||||
font-weight: 700;
|
||||
}
|
||||
.regatta_intro_header_details_label {
|
||||
vertical-align: middle;
|
||||
margin-top: -0.2em;
|
||||
}
|
||||
.regatta_intro_phases {
|
||||
position: relative;
|
||||
padding-right: 10em;
|
||||
border-bottom: 1px solid #ccc;
|
||||
padding-bottom: 0.666666666666667em;
|
||||
}
|
||||
.regatta_intro_phases_phase {
|
||||
display: block;
|
||||
margin-right: 1.333333333333333em;
|
||||
padding: 0.133333333333333em 1.333333333333333em 0.133333333333333em 0;
|
||||
min-height: 2.666666666666667em;
|
||||
|
||||
}
|
||||
@media (min-width: 50em) {
|
||||
.regatta_intro_phases_phase {
|
||||
display: inline-block;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
.regatta_intro_phases_phase_name {
|
||||
font-size: 0.866666666666667em;
|
||||
}
|
||||
.regatta_intro_phases_phase_races {
|
||||
display: inline-block;
|
||||
}
|
||||
.regatta_intro_phases_phase_races_race {
|
||||
display: inline-block;
|
||||
background-color: #ccc;
|
||||
height: 0.666666666666667em;
|
||||
width: 1.333333333333333em;
|
||||
margin-right: 3px;
|
||||
}
|
||||
.regatta_intro_phases_phase_races_race[data-status='live'] {
|
||||
background-color: #f00;
|
||||
}
|
||||
.regatta_intro_phases_phase_races_race[data-status='finished'] {
|
||||
background-color: #f0ab00;
|
||||
}
|
||||
.regatta_intro_phases_leaderboardlink {
|
||||
text-transform: uppercase;
|
||||
z-index: 2;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
background-color: #008FCC;
|
||||
color: white;
|
||||
}
|
||||
.regatta_intro_phases_leaderboardlink:hover {
|
||||
background-color: #0177ab;
|
||||
}
|
||||
|
||||
.regatta_intro_scheduled {
|
||||
padding-top: 0.8em;
|
||||
}
|
||||
.regatta_intro_results {
|
||||
padding-top: 0.6em;
|
||||
}
|
||||
.regatta_intro_results_competitor {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
display: inline-block;
|
||||
max-width: 32%;
|
||||
padding: 0.2em 1.333333333333333em;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
.regatta_intro_results_competitor:first-child {
|
||||
padding-left: 0;
|
||||
}
|
||||
.regatta_intro_results_competitor:last-child {
|
||||
padding-right: 0;
|
||||
border-right-width: 0;
|
||||
}
|
||||
.regatta_intro_results_competitor_name {
|
||||
font-weight: 700;
|
||||
color: #008fcc;
|
||||
}
|
||||
.regatta_intro_fleets {
|
||||
width: 100%;
|
||||
}
|
||||
.regatta_intro_fleets_fleet {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
.regatta_intro_fleets_fleet:last-child {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.regatta_intro_fleets_fleet_item {
|
||||
margin: 0.4em 0;
|
||||
padding: 0.4em 1.333333333333333em;
|
||||
border-left: 1px solid #ccc;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.regatta_intro_fleets_fleet_itemfirst {
|
||||
margin-left: 0;
|
||||
padding-left: 0;
|
||||
border-left-width: 0;
|
||||
}
|
||||
.regatta_intro_fleets_fleet_item_value {
|
||||
font-weight: 700;
|
||||
color: #008fcc;
|
||||
}
|
||||
.regatta_intro_fleets_fleet_item_flag {
|
||||
width: 2em;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.regatta_intro_fleets_fleet_live {
|
||||
text-align: right;
|
||||
width: 100%;
|
||||
}
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.HeadingElement;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.dom.client.Style.Display;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.uibinder.client.UiHandler;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
import com.google.gwt.user.client.ui.impl.HyperlinkImpl;
|
||||
import com.sap.sailing.gwt.common.client.BoatClassImageResolver;
|
||||
import com.sap.sailing.gwt.common.client.BoatClassImageResources;
|
||||
import com.sap.sailing.gwt.home.client.app.HomePlacesNavigator;
|
||||
import com.sap.sailing.gwt.home.client.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventPlace;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventPlaceNavigator;
|
||||
import com.sap.sailing.gwt.home.client.place.regatta.RegattaPlace;
|
||||
import com.sap.sailing.gwt.home.client.place.regatta.RegattaPlace.RegattaNavigationTabs;
|
||||
import com.sap.sailing.gwt.home.client.shared.LongNamesUtil;
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceGroupSeriesDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
|
||||
public class Regatta extends Composite {
|
||||
private static RegattaUiBinder uiBinder = GWT.create(RegattaUiBinder.class);
|
||||
|
||||
interface RegattaUiBinder extends UiBinder<Widget, Regatta> {
|
||||
}
|
||||
|
||||
private static final HyperlinkImpl HYPERLINK_IMPL = GWT.create(HyperlinkImpl.class);
|
||||
|
||||
private final EventDTO event;
|
||||
private final Timer timerForClientServerOffset;
|
||||
private RaceGroupDTO raceGroup;
|
||||
private final List<RegattaPhase> phasesElements;
|
||||
private LeaderboardGroupDTO leaderboardGroup;
|
||||
private final boolean isSingleView;
|
||||
|
||||
@UiField DivElement regattaDiv;
|
||||
@UiField HeadingElement regattaNameHeading;
|
||||
@UiField DivElement leaderboardGroupName;
|
||||
@UiField DivElement leaderboardGroupNameDiv;
|
||||
// @UiField SpanElement scheduledStart;
|
||||
@UiField DivElement regattaPhasesPanel;
|
||||
@UiField DivElement regattaPhasesInfoDiv;
|
||||
|
||||
@UiField SpanElement competitorsCount;
|
||||
@UiField DivElement competitorsCountDiv;
|
||||
@UiField SpanElement racesCount;
|
||||
@UiField SpanElement trackedRacesCount;
|
||||
@UiField DivElement isLiveDiv;
|
||||
// @UiField TableElement isLiveDiv2;
|
||||
// @UiField DivElement isFinishedDiv;
|
||||
// @UiField DivElement isFinishedDiv2;
|
||||
// @UiField DivElement isScheduledDiv;
|
||||
// @UiField AnchorElement leaderboardLink;
|
||||
// @UiField DivElement liveRaceInfosPerFleetPanel;
|
||||
// @UiField(provided=true) RegattaCompetitor competitorWithRank1;
|
||||
// @UiField(provided=true) RegattaCompetitor competitorWithRank2;
|
||||
// @UiField(provided=true) RegattaCompetitor competitorWithRank3;
|
||||
|
||||
@UiField Anchor regattaDetailsLink;
|
||||
@UiField Anchor leaderboardLink;
|
||||
|
||||
@UiField Image boatClassImage;
|
||||
|
||||
private PlaceNavigation<RegattaPlace> leaderboardNavigation;
|
||||
private PlaceNavigation<EventPlace> regattaNavigation;
|
||||
private final HomePlacesNavigator placesNavigator;
|
||||
private final EventPlaceNavigator eventPlaceNavigator;
|
||||
|
||||
public Regatta(EventDTO event, Timer timerForClientServerOffset, boolean isSingleView,
|
||||
HomePlacesNavigator placesNavigator, EventPlaceNavigator eventPlaceNavigator) {
|
||||
this.event = event;
|
||||
this.timerForClientServerOffset = timerForClientServerOffset;
|
||||
this.isSingleView = isSingleView;
|
||||
this.placesNavigator = placesNavigator;
|
||||
this.eventPlaceNavigator = eventPlaceNavigator;
|
||||
|
||||
phasesElements = new ArrayList<RegattaPhase>();
|
||||
|
||||
RegattaResources.INSTANCE.css().ensureInjected();
|
||||
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
public void setData(LeaderboardGroupDTO leaderboardGroup, boolean hasMultipleLeaderboardGroups, StrippedLeaderboardDTO leaderboard,
|
||||
RaceGroupDTO raceGroup) {
|
||||
this.raceGroup = raceGroup;
|
||||
this.leaderboardGroup = leaderboardGroup;
|
||||
|
||||
if(isSingleView) {
|
||||
regattaDetailsLink.setVisible(false);
|
||||
leaderboardNavigation = placesNavigator.getRegattaAnalyticsNavigation(event.id.toString(), RegattaNavigationTabs.Leaderboard,
|
||||
leaderboard.name, event.getBaseURL(), event.isOnRemoteServer());
|
||||
leaderboardLink.setHref(leaderboardNavigation.getTargetUrl());
|
||||
} else {
|
||||
leaderboardLink.setVisible(false);
|
||||
regattaNavigation = placesNavigator.getRegattaNavigation(event.id.toString(), leaderboard.name, event.getBaseURL(), event.isOnRemoteServer());
|
||||
regattaDetailsLink.setHref(regattaNavigation.getTargetUrl());
|
||||
}
|
||||
|
||||
boolean hasLiveRace = leaderboard.hasLiveRace(timerForClientServerOffset.getLiveTimePointInMillis());
|
||||
if(!hasLiveRace) {
|
||||
isLiveDiv.getStyle().setDisplay(Display.NONE);
|
||||
}
|
||||
|
||||
// boolean isFinished... TODO
|
||||
if(raceGroup.boatClass != null) {
|
||||
boatClassImage.setResource(BoatClassImageResolver.getBoatClassIconResource(raceGroup.boatClass));
|
||||
} else {
|
||||
boatClassImage.setResource(BoatClassImageResources.INSTANCE.genericBoatClass());
|
||||
}
|
||||
|
||||
String regattaDisplayName = leaderboard.displayName != null ? leaderboard.displayName : leaderboard.name;
|
||||
regattaNameHeading.setInnerText(regattaDisplayName);
|
||||
if(hasMultipleLeaderboardGroups && leaderboardGroup.getName() != null) {
|
||||
leaderboardGroupName.setInnerText(LongNamesUtil.shortenLeaderboardGroupName(event.getName(), leaderboardGroup.getName()));
|
||||
leaderboardGroupName.setAttribute("data-labeltype", "group1");
|
||||
} else {
|
||||
leaderboardGroupNameDiv.getStyle().setDisplay(Display.NONE);
|
||||
}
|
||||
|
||||
if(leaderboard.competitorsCount > 0) {
|
||||
competitorsCount.setInnerText(String.valueOf(leaderboard.competitorsCount));
|
||||
} else {
|
||||
competitorsCountDiv.getStyle().setDisplay(Display.NONE);
|
||||
}
|
||||
setRegattaProgress(leaderboard);
|
||||
}
|
||||
|
||||
private void setRegattaProgress(StrippedLeaderboardDTO leaderboard) {
|
||||
// clear first
|
||||
regattaPhasesPanel.removeAllChildren();
|
||||
phasesElements.clear();
|
||||
|
||||
if(raceGroup != null) {
|
||||
if(raceGroup.getSeries().size() == 0) {
|
||||
regattaPhasesInfoDiv.getStyle().setDisplay(Display.NONE);
|
||||
} else {
|
||||
for(RaceGroupSeriesDTO series: raceGroup.getSeries()) {
|
||||
RegattaPhase regattaPhase = new RegattaPhase(series, leaderboardGroup,
|
||||
leaderboard, raceGroup, eventPlaceNavigator, timerForClientServerOffset);
|
||||
regattaPhasesPanel.appendChild(regattaPhase.getElement());
|
||||
phasesElements.add(regattaPhase);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
racesCount.setInnerText(String.valueOf(leaderboard.getRacesCount()));
|
||||
trackedRacesCount.setInnerText(String.valueOf(leaderboard.getTrackedRacesCount()));
|
||||
}
|
||||
|
||||
@UiHandler("regattaDetailsLink")
|
||||
void regattaDetailsLinkClicked(ClickEvent e) {
|
||||
handleClickEvent(e, regattaNavigation);
|
||||
}
|
||||
|
||||
@UiHandler("leaderboardLink")
|
||||
void leaderboardLinkClicked(ClickEvent e) {
|
||||
handleClickEvent(e, leaderboardNavigation);
|
||||
}
|
||||
|
||||
private void handleClickEvent(ClickEvent e, PlaceNavigation<?> placeNavigation) {
|
||||
if (HYPERLINK_IMPL.handleAsClick((Event) e.getNativeEvent())) {
|
||||
placesNavigator.goToPlace(placeNavigation);
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.place.event">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages"/>
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.client.place.event.regatta.RegattaResources" />
|
||||
<g:HTMLPanel>
|
||||
<!-- A view, introducing a regatta-->
|
||||
<div ui:field="regattaDiv" class="{local_res.css.regatta}" data-labeltype="">
|
||||
<div class="{res.mediaCss.grid}">
|
||||
<div class="{res.mediaCss.small12} {res.mediaCss.columns}">
|
||||
<div class="{local_res.css.regatta_intro}">
|
||||
<div>
|
||||
<g:Image ui:field="boatClassImage" height="140" width="140" styleName="{local_res.css.regatta_intro_image}"></g:Image>
|
||||
</div>
|
||||
<div class="{local_res.css.regatta_intro_header}">
|
||||
<div class="{res.mediaCss.grid}">
|
||||
<div class="{res.mediaCss.small4} {res.mediaCss.columns}">
|
||||
<h3 ui:field="regattaNameHeading" class="{local_res.css.regatta_intro_header_name}"></h3>
|
||||
<div ui:field="isLiveDiv" data-labeltype="live" class="{res.mainCss.label}"><ui:text from='{i18n.live}'/></div>
|
||||
<!-- not used as long as we don't have start and end date of regatta
|
||||
<div ui:field="isFinishedDiv" data-labeltype="finished" class="{res.mainCss.label}"><ui:text from='{i18n.finished}'/></div>
|
||||
-->
|
||||
</div>
|
||||
<div class="{res.mediaCss.small8} {res.mediaCss.columns}">
|
||||
<div class="{local_res.css.regatta_intro_header_details}">
|
||||
<div ui:field="competitorsCountDiv" class="{local_res.css.regatta_intro_header_details_item}"><ui:text from='{i18n.regattaCompetitors}'/> <span class="{local_res.css.regatta_intro_header_details_item_value}"><span ui:field="competitorsCount" /></span></div>
|
||||
<div class="{local_res.css.regatta_intro_header_details_item}"><ui:text from='{i18n.regattaRaces}'/> <span class="{local_res.css.regatta_intro_header_details_item_value}"><span ui:field="racesCount" /></span></div>
|
||||
<div class="{local_res.css.regatta_intro_header_details_item}"><ui:text from='{i18n.regattaTracked}'/> <span class="{local_res.css.regatta_intro_header_details_item_value}"><span ui:field="trackedRacesCount" /></span></div>
|
||||
<div ui:field="leaderboardGroupNameDiv" class="{local_res.css.regatta_intro_header_details_item}">
|
||||
<div ui:field="leaderboardGroupName" data-labeltype="" class="{local_res.css.regatta_intro_header_details_label} {res.mainCss.label}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div ui:field="regattaPhasesInfoDiv" class="{local_res.css.regatta_intro_phases}">
|
||||
<div ui:field="regattaPhasesPanel" />
|
||||
<g:Anchor ui:field="regattaDetailsLink" styleName="{local_res.css.regatta_intro_phases_leaderboardlink} {res.mainCss.button}"><ui:text from='{i18n.regattaDetails}'/></g:Anchor>
|
||||
<g:Anchor ui:field="leaderboardLink" styleName="{local_res.css.regatta_intro_phases_leaderboardlink} {res.mainCss.button}"><ui:text from='{i18n.leaderboard}'/></g:Anchor>
|
||||
</div>
|
||||
<!--
|
||||
<div ui:field="isScheduledDiv" class="{local_res.css.regatta_intro_scheduled}">
|
||||
<ui:text from='{i18n.regattaRegattaStarts}'/>: <span ui:field="scheduledStart" />
|
||||
</div>
|
||||
<div ui:field="isFinishedDiv2" class="{local_res.css.regatta_intro_results}">
|
||||
<s:regatta.RegattaCompetitor ui:field="competitorWithRank1" />
|
||||
<s:regatta.RegattaCompetitor ui:field="competitorWithRank2" />
|
||||
<s:regatta.RegattaCompetitor ui:field="competitorWithRank3" />
|
||||
</div>
|
||||
<table ui:field="isLiveDiv2" class="{local_res.css.regatta_intro_fleets}">
|
||||
<div ui:field="liveRaceInfosPerFleetPanel" />
|
||||
</table>
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.AnchorElement;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.dom.client.SpanElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.DOM;
|
||||
import com.google.gwt.user.client.Event;
|
||||
import com.google.gwt.user.client.EventListener;
|
||||
import com.google.gwt.user.client.ui.UIObject;
|
||||
import com.sap.sailing.domain.common.LeaderboardNameConstants;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventPlaceNavigator;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.RaceGroupSeriesDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.StrippedLeaderboardDTO;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
|
||||
public class RegattaPhase extends UIObject {
|
||||
private static RegattaPhaseUiBinder uiBinder = GWT.create(RegattaPhaseUiBinder.class);
|
||||
|
||||
interface RegattaPhaseUiBinder extends UiBinder<DivElement, RegattaPhase> {
|
||||
}
|
||||
|
||||
@UiField SpanElement phaseName;
|
||||
@UiField DivElement phaseRacesDiv;
|
||||
@UiField AnchorElement phaseRacesAnchor;
|
||||
|
||||
public RegattaPhase(RaceGroupSeriesDTO series, final LeaderboardGroupDTO leaderboardGroup,
|
||||
final StrippedLeaderboardDTO leaderboard, final RaceGroupDTO raceGroup, final EventPlaceNavigator pageNavigator, Timer timerForClientServerOffset) {
|
||||
RegattaResources.INSTANCE.css().ensureInjected();
|
||||
setElement(uiBinder.createAndBindUi(this));
|
||||
|
||||
if(LeaderboardNameConstants.DEFAULT_SERIES_NAME.equals(series.getName())) {
|
||||
phaseName.setInnerText("Races");
|
||||
} else {
|
||||
phaseName.setInnerText(series.getName());
|
||||
}
|
||||
|
||||
for(RaceColumnDTO raceColumn: series.getRaceColumns()) {
|
||||
// the raceColumn from the RaceGroupSeriesDTO does not contain all required information for the race state.
|
||||
// therefore we take it from the LeaderboardDTO
|
||||
// TODO: try to have only one RaceColumnDTO
|
||||
RaceColumnDTO raceColumn2 = leaderboard.getRaceColumnByName(raceColumn.getName());
|
||||
RegattaPhaseRace race = new RegattaPhaseRace(raceColumn2, timerForClientServerOffset);
|
||||
phaseRacesDiv.appendChild(race.getElement());
|
||||
|
||||
Event.sinkEvents(phaseRacesAnchor, Event.ONCLICK);
|
||||
Event.setEventListener(phaseRacesAnchor, new EventListener() {
|
||||
@Override
|
||||
public void onBrowserEvent(Event browserEvent) {
|
||||
switch (DOM.eventGetType(browserEvent)) {
|
||||
case Event.ONCLICK:
|
||||
pageNavigator.goToRegattaRaces(leaderboardGroup, leaderboard, raceGroup);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public RegattaPhase() {
|
||||
RegattaResources.INSTANCE.css().ensureInjected();
|
||||
setElement(uiBinder.createAndBindUi(this));
|
||||
|
||||
phaseName.setInnerText("No series defined yet.");
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages"/>
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.client.place.event.regatta.RegattaResources" />
|
||||
<div class="{local_res.css.regatta_intro_phases_phase}">
|
||||
<div class="{local_res.css.regatta_intro_phases_phase_name}"><span ui:field="phaseName" /></div>
|
||||
<a ui:field="phaseRacesAnchor" href="javascript:;">
|
||||
<div ui:field="phaseRacesDiv" class="{local_res.css.regatta_intro_phases_phase_races}" />
|
||||
</a>
|
||||
</div>
|
||||
</ui:UiBinder>
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.dom.client.DivElement;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.ui.UIObject;
|
||||
import com.sap.sailing.domain.common.dto.RaceColumnDTO;
|
||||
import com.sap.sse.gwt.client.player.Timer;
|
||||
|
||||
public class RegattaPhaseRace extends UIObject {
|
||||
private static RegattaPhaseRaceUiBinder uiBinder = GWT.create(RegattaPhaseRaceUiBinder.class);
|
||||
|
||||
interface RegattaPhaseRaceUiBinder extends UiBinder<DivElement, RegattaPhaseRace> {
|
||||
}
|
||||
|
||||
@UiField DivElement raceStatus;
|
||||
|
||||
private enum DataStatusEnum {
|
||||
FINISHED ("finished"), LIVE("live"), SCHEDULED("scheduled");
|
||||
|
||||
private final String attributeValue;
|
||||
private static final String ATTRIBUTE_NAME = "data-status";
|
||||
|
||||
DataStatusEnum(String attributeValue) {
|
||||
this.attributeValue = attributeValue;
|
||||
}
|
||||
}
|
||||
|
||||
public RegattaPhaseRace(RaceColumnDTO raceColumn, Timer timerForClientServerOffset) {
|
||||
RegattaResources.INSTANCE.css().ensureInjected();
|
||||
setElement(uiBinder.createAndBindUi(this));
|
||||
|
||||
DataStatusEnum dataStatus;
|
||||
if(raceColumn.hasLiveRaces(timerForClientServerOffset.getLiveTimePointInMillis())) {
|
||||
dataStatus = DataStatusEnum.LIVE;
|
||||
} else if (raceColumn.hasTrackedRaces()) {
|
||||
dataStatus = DataStatusEnum.FINISHED;
|
||||
} else {
|
||||
dataStatus = DataStatusEnum.SCHEDULED;
|
||||
}
|
||||
raceStatus.setAttribute(DataStatusEnum.ATTRIBUTE_NAME, dataStatus.attributeValue);
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared">
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.common.client.i18n.TextMessages"/>
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.client.place.event.regatta.RegattaResources" />
|
||||
<div ui:field="raceStatus" class="{local_res.css.regatta_intro_phases_phase_races_race}"></div>
|
||||
</ui:UiBinder>
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
import com.google.gwt.resources.client.CssResource.Shared;
|
||||
|
||||
public interface RegattaResources extends ClientBundle {
|
||||
public static final RegattaResources INSTANCE = GWT.create(RegattaResources.class);
|
||||
|
||||
@Source("Regatta.gss")
|
||||
LocalCss css();
|
||||
|
||||
@Shared
|
||||
public interface LocalCss extends CssResource {
|
||||
String regatta();
|
||||
String regatta_intro_details_itemhideoncompact();
|
||||
String regatta_intro();
|
||||
String regatta_intro_image();
|
||||
String regatta_intro_header();
|
||||
String regatta_intro_header_name();
|
||||
String regatta_intro_header_namelink();
|
||||
String regatta_intro_header_details();
|
||||
String regatta_intro_header_details_item();
|
||||
String regatta_intro_header_details_item_value();
|
||||
String regatta_intro_header_details_label();
|
||||
String regatta_intro_phases();
|
||||
String regatta_intro_phases_phase();
|
||||
String regatta_intro_phases_phase_name();
|
||||
String regatta_intro_phases_phase_races();
|
||||
String regatta_intro_phases_phase_races_race();
|
||||
String regatta_intro_phases_leaderboardlink();
|
||||
String regatta_intro_scheduled();
|
||||
String regatta_intro_results();
|
||||
String regatta_intro_results_competitor();
|
||||
String regatta_intro_results_competitor_name();
|
||||
String regatta_intro_fleets();
|
||||
String regatta_intro_fleets_fleet();
|
||||
String regatta_intro_fleets_fleet_item();
|
||||
String regatta_intro_fleets_fleet_itemfirst();
|
||||
String regatta_intro_fleets_fleet_item_value();
|
||||
String regatta_intro_fleets_fleet_item_flag();
|
||||
String regatta_intro_fleets_fleet_live();
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* The header of a regatta of an event
|
||||
*/
|
||||
.regattaheader {
|
||||
font-size: 1rem;
|
||||
margin-top: 2em;
|
||||
padding: 0.666666666666667em;
|
||||
overflow: hidden;
|
||||
border-radius: 0.333333333333333em;
|
||||
border: 1px solid #dedede;
|
||||
background-color: #f2f2f2;
|
||||
}
|
||||
.regattaheaderlink {
|
||||
display: block;
|
||||
margin-top: 0;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
color: #0a0a0a;
|
||||
}
|
||||
.regattaheader_logo {
|
||||
float: left;
|
||||
width: 4em;
|
||||
height: 3.333333333333333em;
|
||||
margin-right: 0.666666666666667em;
|
||||
text-align: center;
|
||||
line-height: 3.333333333333333em;
|
||||
border-right: 1px solid #ccc;
|
||||
padding-right: 0.666666666666667em;
|
||||
}
|
||||
.regattaheader_logo img {
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.regattaheader_content {
|
||||
float: left;
|
||||
width: 80%;
|
||||
overflow: hidden;
|
||||
}
|
||||
.regattaheader_content_title {
|
||||
font-size: 1.466666666666667em;
|
||||
font-weight: 700;
|
||||
height: 1.363636363636364em;
|
||||
line-height: 1.363636363636364em;
|
||||
}
|
||||
.regattaheader_content_details {
|
||||
height: 1.333333333333333em;
|
||||
}
|
||||
.regattaheader_content_details_item {
|
||||
float: left;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
padding: 0 0.666666666666667em;
|
||||
border-right: 1px solid #ccc;
|
||||
}
|
||||
.regattaheader_content_details_item:first-of-type {
|
||||
padding-left: 0;
|
||||
}
|
||||
.regattaheader_content_details_item:last-of-type {
|
||||
border: none;
|
||||
padding-right: 0;
|
||||
}
|
||||
.regattaheader_arrow {
|
||||
float: right;
|
||||
width: 5%;
|
||||
line-height: 3.333333333333333em;
|
||||
text-align: right;
|
||||
}
|
||||
.regattaheader_arrow:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
margin-left: 0.333333333333333em;
|
||||
width: 0.8em;
|
||||
height: 1.333333333333333em;
|
||||
background-image: url("../images/home/breadcrumb-arrow.png");
|
||||
background-size: contain;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui.regattaHeader;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
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.Widget;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.RegattaReferenceDTO;
|
||||
|
||||
public class RegattaHeader extends Composite {
|
||||
private static EventHeaderUiBinder uiBinder = GWT.create(EventHeaderUiBinder.class);
|
||||
|
||||
interface EventHeaderUiBinder extends UiBinder<Widget, RegattaHeader> {
|
||||
}
|
||||
|
||||
@UiField StringMessages i18n;
|
||||
|
||||
|
||||
public RegattaHeader(RegattaReferenceDTO regattaRefDTO) {
|
||||
|
||||
RegattaHeaderResources.INSTANCE.css().ensureInjected();
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder
|
||||
xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.place.event2.ui"
|
||||
>
|
||||
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.client.place.event2.ui.regattaHeader.RegattaHeaderResources" />
|
||||
<g:HTMLPanel>
|
||||
<!-- The regatta header contains basic regatta information-->
|
||||
<div>
|
||||
<div class="{res.mediaCss.grid}">
|
||||
<div class="{res.mediaCss.small12} {res.mediaCss.columns}">
|
||||
<!-- IF isLink -->
|
||||
<a href="<!-- linkToRegattaEvenPage -->" class="{local_res.css.regattaheader} {local_res.css.regattaheaderlink}">
|
||||
<s:regattaHeader.RegattaHeaderBody ui:field='regatta'></s:regattaHeader.RegattaHeaderBody>
|
||||
</a>
|
||||
<!-- IFEND isLink -->
|
||||
<!-- IF isLink == false -->
|
||||
<div class="{local_res.css.regattaheader}">
|
||||
<div class="{local_res.css.regattaheader_arrow}"></div>
|
||||
</div>
|
||||
<!-- IFEND isLink == false -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<ui:UiBinder
|
||||
xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.place.event2.ui"
|
||||
>
|
||||
|
||||
<ui:with field="i18n" type="com.sap.sailing.gwt.ui.client.StringMessages" />
|
||||
<ui:with field="res" type="com.sap.sailing.gwt.common.client.SharedResources" />
|
||||
<ui:with field="local_res" type="com.sap.sailing.gwt.home.client.place.event2.ui.regattaHeader.RegattaHeaderResources" />
|
||||
|
||||
<g:HTMLPanel>
|
||||
<div class="{local_res.css.regattaheader_logo}">
|
||||
<img src="<!-- regatta.image -->" />
|
||||
</div>
|
||||
<div class="{local_res.css.regattaheader_content}">
|
||||
<div class="{local_res.css.regattaheader_content_title}">
|
||||
<!-- regatta.name -->
|
||||
<!-- IF regatta.isLive -->
|
||||
<div data-labeltype="live" class="{res.mainCss.label}">
|
||||
<ui:text from='{i18n.playModeLive}' />
|
||||
</div>
|
||||
<!-- IFEND regatta.isLive -->
|
||||
<!-- IF regatta.isFinished -->
|
||||
<div data-labeltype="finished" class="{res.mainCss.label}">
|
||||
<ui:text from='{i18n.raceIsFinished}' />
|
||||
</div>
|
||||
<!-- IFEND regatta.isFinished -->
|
||||
<!-- IF regatta.isProgress -->
|
||||
<div data-labeltype="progress" class="{res.mainCss.label}">
|
||||
<ui:text from='{i18n.isProgress}' />
|
||||
</div>
|
||||
<!-- IFEND regatta.isProgress -->
|
||||
<!-- IF regatta.isUpcoming -->
|
||||
<div data-labeltype="upcoming" class="{res.mainCss.label}">
|
||||
<ui:text from='{i18n.isUpcoming}' />
|
||||
</div>
|
||||
<!-- IFEND regatta.isUpcoming -->
|
||||
</div>
|
||||
<div class="{local_res.css.regattaheader_content_details}">
|
||||
<div class="{local_res.css.regattaheader_content_details_item}">
|
||||
<!-- regatta.competitorsCount -->
|
||||
<ui:text from='{i18n.competitors}' />
|
||||
</div>
|
||||
<div class="{local_res.css.regattaheader_content_details_item}">
|
||||
<!-- regatta.racesCount -->
|
||||
<ui:text from='{i18n.regattaHeaderRacesCount}' />
|
||||
</div>
|
||||
<div class="{local_res.css.regattaheader_content_details_item}">
|
||||
<!-- regatta.trackedCount -->
|
||||
<ui:text from='{i18n.tracked}' />
|
||||
</div>
|
||||
<div class="{local_res.css.regattaheader_content_details_item}">
|
||||
<!-- regatta.category -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.sap.sailing.gwt.home.client.place.event2.ui.regattaHeader;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.resources.client.ClientBundle;
|
||||
import com.google.gwt.resources.client.CssResource;
|
||||
|
||||
public interface RegattaHeaderResources extends ClientBundle {
|
||||
public static final RegattaHeaderResources INSTANCE = GWT.create(RegattaHeaderResources.class);
|
||||
|
||||
@Source("RegattaHeader.css")
|
||||
LocalCss css();
|
||||
|
||||
public interface LocalCss extends CssResource {
|
||||
String regattaheader();
|
||||
String regattaheaderlink();
|
||||
String regattaheader_logo();
|
||||
String regattaheader_content();
|
||||
String regattaheader_content_title();
|
||||
String regattaheader_content_details();
|
||||
String regattaheader_content_details_item();
|
||||
String regattaheader_arrow();
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -84,7 +84,7 @@ import com.sap.sailing.gwt.ui.shared.TrackFileImportDeviceIdentifierDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.VenueDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sse.common.NoCorrespondingServiceRegisteredException;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.Util.Pair;
|
||||
@@ -575,6 +575,6 @@ public interface SailingService extends RemoteService, FileStorageManagementGwtS
|
||||
List<DeviceMappingDTO> getDeviceMappingsFromLogHierarchy(String leaderboardName, String raceColumnName,
|
||||
String fleetName) throws TransformationException;
|
||||
|
||||
EventMetadataDTO getEventMetadataById(UUID id);
|
||||
EventViewDTO getEventViewById(UUID id);
|
||||
|
||||
}
|
||||
+2
-2
@@ -74,7 +74,7 @@ import com.sap.sailing.gwt.ui.shared.TrackFileImportDeviceIdentifierDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.VenueDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sse.common.Util;
|
||||
import com.sap.sse.common.search.KeywordQuery;
|
||||
import com.sap.sse.gwt.client.BuildVersionRetriever;
|
||||
@@ -685,6 +685,6 @@ public interface SailingServiceAsync extends BuildVersionRetriever, FileStorageM
|
||||
void createRegattaStructure(Iterable<RegattaDTO> regattaNames,
|
||||
EventDTO newEvent, AsyncCallback<Void> asyncCallback);
|
||||
|
||||
void getEventMetadataById(UUID id, AsyncCallback<EventMetadataDTO> callback);
|
||||
void getEventViewById(UUID id, AsyncCallback<EventViewDTO> callback);
|
||||
|
||||
}
|
||||
+9
-10
@@ -330,10 +330,10 @@ import com.sap.sailing.gwt.ui.shared.WaypointDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindInfoForRaceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.WindTrackInfoDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventMetadataDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventReferenceDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventState;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventType;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventState;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO.EventType;
|
||||
import com.sap.sailing.gwt.ui.shared.eventview.RegattaReferenceDTO;
|
||||
import com.sap.sailing.manage2sail.EventResultDescriptor;
|
||||
import com.sap.sailing.manage2sail.Manage2SailEventResultsParserImpl;
|
||||
@@ -5493,7 +5493,7 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
}
|
||||
|
||||
@Override
|
||||
public EventMetadataDTO getEventMetadataById(UUID id) {
|
||||
public EventViewDTO getEventViewById(UUID id) {
|
||||
EventDTO o;
|
||||
try {
|
||||
o = getEventById(id, false);
|
||||
@@ -5501,15 +5501,14 @@ public class SailingServiceImpl extends ProxiedRemoteServiceServlet implements S
|
||||
throw new RuntimeException("We can do better than MalformedURLException");
|
||||
}
|
||||
|
||||
EventMetadataDTO dto = new EventMetadataDTO();
|
||||
dto.setId(id);
|
||||
dto.setStartDate(o.startDate);
|
||||
dto.setEndDate(o.endDate);
|
||||
EventViewDTO dto = new EventViewDTO();
|
||||
dto.id = id;
|
||||
dto.startDate = o.startDate;
|
||||
dto.endDate = o.endDate;
|
||||
dto.setLogoImageURL(o.getLogoImageURL());
|
||||
dto.setName(o.getName());
|
||||
dto.setOfficialWebsiteURL(o.getOfficialWebsiteURL());
|
||||
dto.setVenue(o.venue.getName());
|
||||
dto.setVenueCountry(null);
|
||||
dto.venue = o.venue;
|
||||
|
||||
dto.setState(EventState.FINISHED);
|
||||
if (o.isFakeSeries()) {
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ public class EventDTO extends EventBaseDTO {
|
||||
this(new ArrayList<LeaderboardGroupDTO>());
|
||||
}
|
||||
|
||||
private EventDTO(List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
protected EventDTO(List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
super(leaderboardGroups);
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
initCurrentServerTime();
|
||||
@@ -26,7 +26,7 @@ public class EventDTO extends EventBaseDTO {
|
||||
this(name, new ArrayList<LeaderboardGroupDTO>());
|
||||
}
|
||||
|
||||
private EventDTO(String name, List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
protected EventDTO(String name, List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
super(name, leaderboardGroups);
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
initCurrentServerTime();
|
||||
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.shared.eventview;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
public class EventMetadataDTO implements IsSerializable {
|
||||
private UUID id;
|
||||
private String name;
|
||||
private EventState state;
|
||||
private EventType type;
|
||||
|
||||
private String venue;
|
||||
private String venueCountry;
|
||||
public Date startDate;
|
||||
public Date endDate;
|
||||
|
||||
private String logoImageURL;
|
||||
private String officialWebsiteURL;
|
||||
|
||||
private List<RegattaReferenceDTO> regattas = new ArrayList<>();
|
||||
private List<EventReferenceDTO> eventsOfSeries = new ArrayList<>();
|
||||
public UUID getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public EventState getState() {
|
||||
return state;
|
||||
}
|
||||
public void setState(EventState state) {
|
||||
this.state = state;
|
||||
}
|
||||
public String getVenue() {
|
||||
return venue;
|
||||
}
|
||||
public void setVenue(String venue) {
|
||||
this.venue = venue;
|
||||
}
|
||||
public String getVenueCountry() {
|
||||
return venueCountry;
|
||||
}
|
||||
public void setVenueCountry(String venueCountry) {
|
||||
this.venueCountry = venueCountry;
|
||||
}
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
public String getLogoImageURL() {
|
||||
return logoImageURL;
|
||||
}
|
||||
public void setLogoImageURL(String logoImageURL) {
|
||||
this.logoImageURL = logoImageURL;
|
||||
}
|
||||
public String getOfficialWebsiteURL() {
|
||||
return officialWebsiteURL;
|
||||
}
|
||||
public void setOfficialWebsiteURL(String officialWebsiteURL) {
|
||||
this.officialWebsiteURL = officialWebsiteURL;
|
||||
}
|
||||
public List<RegattaReferenceDTO> getRegattas() {
|
||||
return regattas;
|
||||
}
|
||||
public void setRegattas(List<RegattaReferenceDTO> regattas) {
|
||||
this.regattas = regattas;
|
||||
}
|
||||
public List<EventReferenceDTO> getEventsOfSeries() {
|
||||
return eventsOfSeries;
|
||||
}
|
||||
public void setEventsOfSeries(List<EventReferenceDTO> eventsOfSeries) {
|
||||
this.eventsOfSeries = eventsOfSeries;
|
||||
}
|
||||
public EventType getType() {
|
||||
return type;
|
||||
}
|
||||
public void setType(EventType type) {
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.shared.eventview;
|
||||
|
||||
public enum EventState {
|
||||
UPCOMMING,
|
||||
RUNNING,
|
||||
FINISHED
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
package com.sap.sailing.gwt.ui.shared.eventview;
|
||||
|
||||
public enum EventType {
|
||||
SINGLE_REGATTA,
|
||||
MULTI_REGATTA,
|
||||
SERIES_EVENT
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package com.sap.sailing.gwt.ui.shared.eventview;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.LeaderboardGroupDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.VenueDTO;
|
||||
|
||||
public class EventViewDTO extends EventDTO {
|
||||
private static final long serialVersionUID = -7100030301376959817L;
|
||||
|
||||
public enum EventType {
|
||||
SINGLE_REGATTA, MULTI_REGATTA, SERIES_EVENT
|
||||
}
|
||||
|
||||
public enum EventState {
|
||||
UPCOMMING, RUNNING, FINISHED
|
||||
}
|
||||
|
||||
private List<RegattaReferenceDTO> regattas = new ArrayList<>();
|
||||
private List<EventReferenceDTO> eventsOfSeries = new ArrayList<>();
|
||||
|
||||
private Date currentServerTime;
|
||||
|
||||
private List<LeaderboardGroupDTO> leaderboardGroups; // keeps the more specific type accessible in a type-safe way
|
||||
|
||||
// TODO: frank, please implement
|
||||
private EventType type;
|
||||
private EventState state;
|
||||
|
||||
public EventViewDTO() {
|
||||
this(new ArrayList<LeaderboardGroupDTO>());
|
||||
}
|
||||
|
||||
private EventViewDTO(List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
super(leaderboardGroups);
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
initCurrentServerTime();
|
||||
}
|
||||
|
||||
public EventViewDTO(String name) {
|
||||
this(name, new ArrayList<LeaderboardGroupDTO>());
|
||||
}
|
||||
|
||||
private EventViewDTO(String name, List<LeaderboardGroupDTO> leaderboardGroups) {
|
||||
super(name, leaderboardGroups);
|
||||
this.leaderboardGroups = leaderboardGroups;
|
||||
initCurrentServerTime();
|
||||
|
||||
}
|
||||
|
||||
public boolean isFakeSeries() {
|
||||
return leaderboardGroups.size() == 1 && leaderboardGroups.get(0).hasOverallLeaderboard();
|
||||
}
|
||||
|
||||
public boolean isRunning() {
|
||||
return getCurrentServerTime().after(startDate) && getCurrentServerTime().before(endDate);
|
||||
}
|
||||
|
||||
public boolean isFinished() {
|
||||
return getCurrentServerTime().after(endDate);
|
||||
}
|
||||
|
||||
private void initCurrentServerTime() {
|
||||
currentServerTime = new Date();
|
||||
}
|
||||
|
||||
public Date getCurrentServerTime() {
|
||||
return currentServerTime;
|
||||
}
|
||||
|
||||
public void addLeaderboardGroup(LeaderboardGroupDTO leaderboardGroup) {
|
||||
leaderboardGroups.add(leaderboardGroup);
|
||||
}
|
||||
|
||||
public List<LeaderboardGroupDTO> getLeaderboardGroups() {
|
||||
return leaderboardGroups;
|
||||
}
|
||||
|
||||
public EventType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(EventType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public EventState getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(EventState state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public List<RegattaReferenceDTO> getRegattas() {
|
||||
return regattas;
|
||||
}
|
||||
|
||||
public List<EventReferenceDTO> getEventsOfSeries() {
|
||||
return eventsOfSeries;
|
||||
}
|
||||
|
||||
public VenueDTO getVenue() {
|
||||
return venue;
|
||||
}
|
||||
|
||||
public String getVenueCountry() {
|
||||
// FIXME: We need a country?
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user