mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-10 14:20:55 +00:00
Using stage image as background of the event countdown
This commit is contained in:
1 parent
fd632073f8
commit
ce99f48006
8 files changed
+25
-12
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 254 KiB |
+2
-3
@@ -66,9 +66,8 @@
|
||||
.countdown_image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-size: 67.8em 50.46666666666667em;
|
||||
background-position: center -0.933333333333333em;
|
||||
background-image: url("images/home/countdown-thumbnail.png");
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
}
|
||||
.countdown_info {
|
||||
position: absolute;
|
||||
|
||||
+8
@@ -21,6 +21,7 @@ import com.sap.sailing.gwt.home.client.app.PlaceNavigation;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventView;
|
||||
import com.sap.sailing.gwt.home.client.place.event.EventView.Presenter;
|
||||
import com.sap.sailing.gwt.home.client.place.event.partials.countdown.CountdownResources.LocalCss;
|
||||
import com.sap.sailing.gwt.home.client.shared.stage.StageResources;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.event.EventOverviewRaceTickerStageDTO;
|
||||
import com.sap.sailing.gwt.ui.shared.dispatch.event.EventOverviewRegattaTickerStageDTO;
|
||||
@@ -43,6 +44,7 @@ public class Countdown extends Composite {
|
||||
@UiField DivElement countdownInfo;
|
||||
@UiField HeadingElement infoTitle;
|
||||
@UiField(provided = true) NavigationAnchor navigationButton;
|
||||
@UiField DivElement image;
|
||||
|
||||
public Countdown(EventView.Presenter presenter) {
|
||||
CSS.ensureInjected();
|
||||
@@ -51,6 +53,12 @@ public class Countdown extends Composite {
|
||||
}
|
||||
|
||||
public void setData(EventOverviewTickerStageDTO data) {
|
||||
String stageImageUrl = StageResources.INSTANCE.defaultStageEventTeaserImage().getSafeUri().asString();
|
||||
if(data.getStageImageUrl() != null) {
|
||||
stageImageUrl = data.getStageImageUrl();
|
||||
}
|
||||
image.getStyle().setBackgroundImage("url(\"" + stageImageUrl + "\")");
|
||||
|
||||
navigationButton.removeStyleName(MAIN_CSS.buttonred());
|
||||
navigationButton.removeStyleName(MAIN_CSS.buttonprimary());
|
||||
if (data instanceof EventOverviewRaceTickerStageDTO) {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<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.partials.countdown.CountdownResources" />
|
||||
<g:HTMLPanel addStyleNames="{local_res.css.countdown}">
|
||||
<div class="{local_res.css.countdown_image}"></div>
|
||||
<div ui:field="image" class="{local_res.css.countdown_image}"></div>
|
||||
<div class="{local_res.css.countdown_content}">
|
||||
<h3 class="{local_res.css.countdown_content_title}" ui:field="countdownTitle"></h3>
|
||||
<g:SimplePanel ui:field="tickerContainer"/>
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ public class EventOverviewRaceTickerStageDTO extends EventOverviewTickerStageDTO
|
||||
private EventOverviewRaceTickerStageDTO() {
|
||||
}
|
||||
|
||||
public EventOverviewRaceTickerStageDTO(RegattaAndRaceIdentifier identifier, String tickerInfo, Date startTime) {
|
||||
super(startTime, tickerInfo);
|
||||
public EventOverviewRaceTickerStageDTO(RegattaAndRaceIdentifier identifier, String tickerInfo, Date startTime, String stageImageUrl) {
|
||||
super(startTime, tickerInfo, stageImageUrl);
|
||||
this.regattaAndRaceIdentifier = identifier;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -12,8 +12,8 @@ public class EventOverviewRegattaTickerStageDTO extends EventOverviewTickerStage
|
||||
private EventOverviewRegattaTickerStageDTO() {
|
||||
}
|
||||
|
||||
public EventOverviewRegattaTickerStageDTO(RegattaName identifier, String tickerInfo, Date startTime) {
|
||||
super(startTime, tickerInfo);
|
||||
public EventOverviewRegattaTickerStageDTO(RegattaName identifier, String tickerInfo, Date startTime, String stageImageUrl) {
|
||||
super(startTime, tickerInfo, stageImageUrl);
|
||||
this.regattaIdentifier = identifier;
|
||||
}
|
||||
|
||||
|
||||
+6
-1
@@ -6,13 +6,15 @@ public class EventOverviewTickerStageDTO implements EventOverviewStageContentDTO
|
||||
|
||||
private Date startTime;
|
||||
private String tickerInfo;
|
||||
private String stageImageUrl;
|
||||
|
||||
protected EventOverviewTickerStageDTO() {
|
||||
}
|
||||
|
||||
public EventOverviewTickerStageDTO(Date startTime, String tickerInfo) {
|
||||
public EventOverviewTickerStageDTO(Date startTime, String tickerInfo, String stageImageUrl) {
|
||||
this.startTime = startTime;
|
||||
this.tickerInfo = tickerInfo;
|
||||
this.stageImageUrl = stageImageUrl;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
@@ -23,4 +25,7 @@ public class EventOverviewTickerStageDTO implements EventOverviewStageContentDTO
|
||||
return tickerInfo;
|
||||
}
|
||||
|
||||
public String getStageImageUrl() {
|
||||
return stageImageUrl;
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -48,6 +48,7 @@ public class GetEventOverviewStageAction implements Action<ResultWithTTL<EventOv
|
||||
|
||||
@GwtIncompatible
|
||||
public EventOverviewStageContentDTO getStageContent(Event event, EventState state, MillisecondsTimePoint now) {
|
||||
String stageImageUrl = HomeServiceUtil.getStageImageURLAsString(event);
|
||||
// if(state == EventState.RUNNING && TODO live video) {
|
||||
// return new EventOverviewVideoStageDTO();
|
||||
// }
|
||||
@@ -60,7 +61,7 @@ public class GetEventOverviewStageAction implements Action<ResultWithTTL<EventOv
|
||||
// TODO next race countdown if available
|
||||
// TODO Proper Implementation (Type race)
|
||||
// return new EventOverviewRaceTickerStageDTO(new RegattaNameAndRaceName(
|
||||
// "Regatta XY", "Race 1"), "Race 1 - Gold Fleet", new Date(new Date().getTime() + 5000));
|
||||
// "Regatta XY", "Race 1"), "Race 1 - Gold Fleet", new Date(new Date().getTime() + 5000), stageImageUrl);
|
||||
|
||||
Regatta nextRegatta = null;
|
||||
for (LeaderboardGroup lg : event.getLeaderboardGroups()) {
|
||||
@@ -78,13 +79,13 @@ public class GetEventOverviewStageAction implements Action<ResultWithTTL<EventOv
|
||||
if(!HomeServiceUtil.isSingleRegatta(event) && nextRegatta != null) {
|
||||
return new EventOverviewRegattaTickerStageDTO(
|
||||
new RegattaName(nextRegatta.getName()), nextRegatta.getName(), nextRegatta.getStartDate()
|
||||
.asDate());
|
||||
.asDate(), stageImageUrl);
|
||||
}
|
||||
}
|
||||
|
||||
if(state == EventState.UPCOMING || state == EventState.PLANNED) {
|
||||
return new EventOverviewTickerStageDTO(event.getStartDate()
|
||||
.asDate(), event.getName());
|
||||
.asDate(), event.getName(), stageImageUrl);
|
||||
}
|
||||
|
||||
List<URL> photoGalleryImageURLs = HomeServiceUtil.getPhotoGalleryImageURLs(event);
|
||||
|
||||
Reference in new issue
Block a user