mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-01 08:40:52 +00:00
created a teaser page for events without defined regattas/leaderboardgroups
This commit is contained in:
1 parent
27dc1038e8
commit
54325fce26
8 files changed
+110
-18
No files matched your search
+7
@@ -6,7 +6,9 @@ import com.google.gwt.event.shared.SimpleEventBus;
|
|||||||
import com.google.gwt.place.shared.PlaceController;
|
import com.google.gwt.place.shared.PlaceController;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sap.sailing.gwt.home.client.place.event.EventView;
|
import com.sap.sailing.gwt.home.client.place.event.EventView;
|
||||||
|
import com.sap.sailing.gwt.home.client.place.event.EventWithoutRegattasView;
|
||||||
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventView;
|
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventView;
|
||||||
|
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventWithoutRegattasView;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.EventsActivity;
|
import com.sap.sailing.gwt.home.client.place.events.EventsActivity;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.EventsView;
|
import com.sap.sailing.gwt.home.client.place.events.EventsView;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.TabletAndDesktopEventsView;
|
import com.sap.sailing.gwt.home.client.place.events.TabletAndDesktopEventsView;
|
||||||
@@ -43,6 +45,11 @@ public class SmartphoneApplicationClientFactory extends AbstractApplicationClien
|
|||||||
return new TabletAndDesktopEventView(getSailingService(), event, raceGroups, leaderboardName, timerForClientServerOffset);
|
return new TabletAndDesktopEventView(getSailingService(), event, raceGroups, leaderboardName, timerForClientServerOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EventWithoutRegattasView createEventWithoutRegattasView(EventDTO event) {
|
||||||
|
return new TabletAndDesktopEventWithoutRegattasView(getSailingService(), event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventsView createEventsView(EventsActivity activity) {
|
public EventsView createEventsView(EventsActivity activity) {
|
||||||
return new TabletAndDesktopEventsView(getPlaceNavigator());
|
return new TabletAndDesktopEventsView(getPlaceNavigator());
|
||||||
|
|||||||
+7
@@ -6,7 +6,9 @@ import com.google.gwt.event.shared.SimpleEventBus;
|
|||||||
import com.google.gwt.place.shared.PlaceController;
|
import com.google.gwt.place.shared.PlaceController;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sap.sailing.gwt.home.client.place.event.EventView;
|
import com.sap.sailing.gwt.home.client.place.event.EventView;
|
||||||
|
import com.sap.sailing.gwt.home.client.place.event.EventWithoutRegattasView;
|
||||||
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventView;
|
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventView;
|
||||||
|
import com.sap.sailing.gwt.home.client.place.event.TabletAndDesktopEventWithoutRegattasView;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.EventsActivity;
|
import com.sap.sailing.gwt.home.client.place.events.EventsActivity;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.EventsView;
|
import com.sap.sailing.gwt.home.client.place.events.EventsView;
|
||||||
import com.sap.sailing.gwt.home.client.place.events.TabletAndDesktopEventsView;
|
import com.sap.sailing.gwt.home.client.place.events.TabletAndDesktopEventsView;
|
||||||
@@ -43,6 +45,11 @@ public class TabletAndDesktopApplicationClientFactory extends AbstractApplicatio
|
|||||||
return new TabletAndDesktopEventView(getSailingService(), event, raceGroups, leaderboardName, timerForClientServerOffset);
|
return new TabletAndDesktopEventView(getSailingService(), event, raceGroups, leaderboardName, timerForClientServerOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EventWithoutRegattasView createEventWithoutRegattasView(EventDTO event) {
|
||||||
|
return new TabletAndDesktopEventWithoutRegattasView(getSailingService(), event);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EventsView createEventsView(EventsActivity activity) {
|
public EventsView createEventsView(EventsActivity activity) {
|
||||||
return new TabletAndDesktopEventsView(getPlaceNavigator());
|
return new TabletAndDesktopEventsView(getPlaceNavigator());
|
||||||
|
|||||||
+23
-18
@@ -55,27 +55,32 @@ public class EventActivity extends AbstractActivity {
|
|||||||
clientFactory.getSailingService().getEventById(eventUUID, new AsyncCallback<EventDTO>() {
|
clientFactory.getSailingService().getEventById(eventUUID, new AsyncCallback<EventDTO>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final EventDTO event) {
|
public void onSuccess(final EventDTO event) {
|
||||||
|
if(event.getLeaderboardGroups().size() > 0) {
|
||||||
clientFactory.getSailingService().getRegattaStructureForEvent(event.id, new AsyncCallback<List<RaceGroupDTO>>() {
|
clientFactory.getSailingService().getRegattaStructureForEvent(event.id, new AsyncCallback<List<RaceGroupDTO>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<RaceGroupDTO> raceGroups) {
|
public void onSuccess(List<RaceGroupDTO> raceGroups) {
|
||||||
for(LeaderboardGroupDTO leaderboardGroupDTO: event.getLeaderboardGroups()) {
|
for(LeaderboardGroupDTO leaderboardGroupDTO: event.getLeaderboardGroups()) {
|
||||||
final long clientTimeWhenResponseWasReceived = System.currentTimeMillis();
|
final long clientTimeWhenResponseWasReceived = System.currentTimeMillis();
|
||||||
if (leaderboardGroupDTO.getAverageDelayToLiveInMillis() != null) {
|
if (leaderboardGroupDTO.getAverageDelayToLiveInMillis() != null) {
|
||||||
timerForClientServerOffset.setLivePlayDelayInMillis(leaderboardGroupDTO.getAverageDelayToLiveInMillis());
|
timerForClientServerOffset.setLivePlayDelayInMillis(leaderboardGroupDTO.getAverageDelayToLiveInMillis());
|
||||||
|
}
|
||||||
|
timerForClientServerOffset.adjustClientServerOffset(clientTimeWhenRequestWasSent, leaderboardGroupDTO.getCurrentServerTime(), clientTimeWhenResponseWasReceived);
|
||||||
}
|
}
|
||||||
timerForClientServerOffset.adjustClientServerOffset(clientTimeWhenRequestWasSent, leaderboardGroupDTO.getCurrentServerTime(), clientTimeWhenResponseWasReceived);
|
|
||||||
|
view = clientFactory.createEventView(event, raceGroups, eventPlace.getLeaderboardIdAsNameString(), timerForClientServerOffset);
|
||||||
|
panel.setWidget(view.asWidget());
|
||||||
}
|
}
|
||||||
|
|
||||||
view = clientFactory.createEventView(event, raceGroups, eventPlace.getLeaderboardIdAsNameString(), timerForClientServerOffset);
|
@Override
|
||||||
panel.setWidget(view.asWidget());
|
public void onFailure(Throwable caught) {
|
||||||
}
|
Window.alert("Shit happens at getRegattaStructureForEvent()");
|
||||||
|
}
|
||||||
@Override
|
});
|
||||||
public void onFailure(Throwable caught) {
|
} else {
|
||||||
Window.alert("Shit happens at getRegattaStructureForEvent()");
|
// no leaderboard groups defined yet -> show a teaser page
|
||||||
}
|
EventWithoutRegattasView view = clientFactory.createEventWithoutRegattasView(event);
|
||||||
});
|
panel.setWidget(view.asWidget());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+2
@@ -9,4 +9,6 @@ import com.sap.sse.gwt.client.player.Timer;
|
|||||||
|
|
||||||
public interface EventClientFactory extends SailingClientFactory {
|
public interface EventClientFactory extends SailingClientFactory {
|
||||||
EventView createEventView(EventDTO event, List<RaceGroupDTO> raceGroups, String leaderboardName, Timer timerForClientServerOffset);
|
EventView createEventView(EventDTO event, List<RaceGroupDTO> raceGroups, String leaderboardName, Timer timerForClientServerOffset);
|
||||||
|
|
||||||
|
EventWithoutRegattasView createEventWithoutRegattasView(EventDTO event);
|
||||||
}
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package com.sap.sailing.gwt.home.client.place.event;
|
||||||
|
|
||||||
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
public interface EventWithoutRegattasView {
|
||||||
|
Widget asWidget();
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
package com.sap.sailing.gwt.home.client.place.event;
|
||||||
|
|
||||||
|
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.home.client.place.event.header.EventHeader;
|
||||||
|
import com.sap.sailing.gwt.ui.client.SailingServiceAsync;
|
||||||
|
import com.sap.sailing.gwt.ui.shared.EventDTO;
|
||||||
|
|
||||||
|
public class TabletAndDesktopEventWithoutRegattasView extends Composite implements EventWithoutRegattasView {
|
||||||
|
private static EventViewUiBinder uiBinder = GWT.create(EventViewUiBinder.class);
|
||||||
|
|
||||||
|
interface EventViewUiBinder extends UiBinder<Widget, TabletAndDesktopEventWithoutRegattasView> {
|
||||||
|
}
|
||||||
|
|
||||||
|
@UiField(provided=true) EventHeader eventHeader;
|
||||||
|
|
||||||
|
public TabletAndDesktopEventWithoutRegattasView(SailingServiceAsync sailingService, EventDTO event) {
|
||||||
|
eventHeader = new EventHeader(event);
|
||||||
|
|
||||||
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||||
|
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||||
|
xmlns:s="urn:import:com.sap.sailing.gwt.home.client.shared"
|
||||||
|
xmlns:p="urn:import:com.sap.sailing.gwt.home.client.place.event"
|
||||||
|
xmlns:g="urn:import:com.google.gwt.user.client.ui">
|
||||||
|
<ui:with field="res" type="com.sap.sailing.gwt.home.client.HomeResources" />
|
||||||
|
<ui:style>
|
||||||
|
.infoPanel {
|
||||||
|
height: 300px;
|
||||||
|
padding-top: 2em;
|
||||||
|
}
|
||||||
|
</ui:style>
|
||||||
|
<g:HTMLPanel>
|
||||||
|
<p:header.EventHeader ui:field='eventHeader'/>
|
||||||
|
<div class="{res.mainCss.grid} {style.infoPanel}">
|
||||||
|
<div class="{res.mediaCss.columns}">
|
||||||
|
There is no information available about the regattas of this event yet.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</g:HTMLPanel>
|
||||||
|
</ui:UiBinder>
|
||||||
+18
@@ -88,6 +88,22 @@ public class EventHeader extends Composite {
|
|||||||
setDataNavigationType("normal");
|
setDataNavigationType("normal");
|
||||||
updateUI();
|
updateUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EventHeader(EventDTO event) {
|
||||||
|
this.event = event;
|
||||||
|
this.pageNavigator = null;
|
||||||
|
|
||||||
|
EventHeaderResources.INSTANCE.css().ensureInjected();
|
||||||
|
StyleInjector.injectAtEnd("@media (min-width: 50em) { "+EventHeaderResources.INSTANCE.largeCss().getText()+"}");
|
||||||
|
|
||||||
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
|
isFinishedDiv.getStyle().setDisplay(Display.NONE);
|
||||||
|
isLiveDiv.getStyle().setDisplay(Display.NONE);
|
||||||
|
|
||||||
|
setDataNavigationType("normal");
|
||||||
|
updateUI();
|
||||||
|
}
|
||||||
|
|
||||||
public void setDataNavigationType(String dataNavigationType) {
|
public void setDataNavigationType(String dataNavigationType) {
|
||||||
eventHeaderWrapperDiv.setAttribute("data-navigationtype", dataNavigationType);
|
eventHeaderWrapperDiv.setAttribute("data-navigationtype", dataNavigationType);
|
||||||
@@ -105,6 +121,8 @@ public class EventHeader extends Composite {
|
|||||||
}
|
}
|
||||||
if(event.getOfficialWebsiteURL() != null) {
|
if(event.getOfficialWebsiteURL() != null) {
|
||||||
officalWebsiteLink.setHref(event.getOfficialWebsiteURL());
|
officalWebsiteLink.setHref(event.getOfficialWebsiteURL());
|
||||||
|
} else {
|
||||||
|
officalWebsiteLink.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
String logoUrl = event.getLogoImageURL() != null ? event.getLogoImageURL() : defaultLogoUrl;
|
String logoUrl = event.getLogoImageURL() != null ? event.getLogoImageURL() : defaultLogoUrl;
|
||||||
|
|||||||
Reference in new issue
Block a user