Competition Format - Adjusted representation of different race states in

mobile version
This commit is contained in:
Benjamin Barth committed 2015-10-01 14:13:00 +02:00
1 parent c1356a442f
commit 1df0b9c647
4 files changed
+56 -20

No files matched your search

@@ -48,7 +48,7 @@
.regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_race_title {
position: absolute;
top: 50%;
left: 1em;
left: 1.133333333333333em;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
@@ -57,9 +57,9 @@
.regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_race_title:after {
display: none;
}
.regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_race_subtitle {
font-size: 0.866666666666667em;
}
/* .regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_race_subtitle { */
/* font-size: 0.866666666666667em; */
/* } */
.regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_race_arrow {
display: block;
}
@@ -83,25 +83,39 @@
background: #008fcc;
}
.regattacompetition_phase_fleet_raceuntracked {
/* background: #666; */
background: #f0ab00;
color: #008fcc;
background-color: #fff;
border: 0.133333333333333em solid #008fcc;
padding: .933333333333333em 0;
cursor: default;
}
.regattacompetition_phase_fleet_raceuntracked .regattacompetition_phase_fleet_race_title:after {
display: none;
}
.regattacompetition_phase_fleetfullwidth .regattacompetition_phase_fleet_raceuntracked .regattacompetition_phase_fleet_race_title {
left: 1em;
}
.regattacompetition_phase_fleet_racelive {
background: #e94a1b;
background-color: #e94a1b;
}
.regattacompetition_phase_fleet_raceplanned {
background: #f6f9fc;
color: #999;
border: 1px solid #999;
background-color: #999;
}
.regattacompetition_phase_fleet_raceplanned .regattacompetition_phase_fleet_race_title:after {
display: none;
}
.regattacompetition_phase_fleet_racelive.regattacompetition_phase_fleet_raceuntracked {
color: #e94a1b;
background-color: #fff;
border-color: #e94a1b;
}
.regattacompetition_phase_fleet_raceplanned.regattacompetition_phase_fleet_raceuntracked {
background-color: #fff;
color: #999;
border-color: #999;
}
.regattacompetition_phase_fleet_race_title {
font-size: 1.066666666666667em;
font-size: 1.222222222222222em;
font-weight: 700;
}
.regattacompetition_phase_fleet_race_title:after {
@@ -112,8 +126,7 @@
background: url("images/home/skip-forward.png") no-repeat center center;
}
.regattacompetition_phase_fleet_race_subtitle {
font-size: 0.666666666666667em;
text-transform: capitalize;
font-size: 0.7em;
}
.regattacompetition_phase_fleet_race_arrow {
display: none;
@@ -128,3 +141,16 @@
.regattacompetition_phase_fleet_raceuntracked .regattacompetition_phase_fleet_race_arrow {
display: none;
}
.regattacompetition_phase_fleet_race_state {
text-transform: uppercase;
}
.regattacompetition_phase_fleet_race_date {
}
.regattacompetition_phase_fleet_race_title,
.regattacompetition_phase_fleet_race_state,
.regattacompetition_phase_fleet_race_date {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
@@ -6,6 +6,7 @@ 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.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.common.client.DateAndTimeFormatterUtil;
import com.sap.sailing.gwt.ui.shared.race.SimpleRaceMetadataDTO;
import com.sap.sailing.gwt.ui.shared.race.SimpleRaceMetadataDTO.RaceTrackingState;
@@ -19,8 +20,10 @@ public class RegattaCompetitionFleetRace extends UIObject {
}
@UiField RegattaCompetitionResources local_res;
@UiField StringMessages i18n;
@UiField DivElement raceNameUi;
@UiField DivElement raceDateUi;
@UiField DivElement raceStateUi;
private final AnchorElement anchor;
public RegattaCompetitionFleetRace(SimpleRaceMetadataDTO race, String raceViewerUrl) {
@@ -35,16 +38,20 @@ public class RegattaCompetitionFleetRace extends UIObject {
}
private void setupRaceState(RaceTrackingState trackingState, RaceViewState viewState) {
boolean isUntrackedRace = trackingState != RaceTrackingState.TRACKED_VALID_DATA;
if (viewState == RaceViewState.RUNNING) {
anchor.addClassName(local_res.css().regattacompetition_phase_fleet_racelive());
raceStateUi.setInnerText(isUntrackedRace ? i18n.live() : i18n.actionWatch());
} else if (viewState == RaceViewState.PLANNED || viewState == RaceViewState.SCHEDULED) {
anchor.addClassName(local_res.css().regattacompetition_phase_fleet_raceplanned());
raceStateUi.setInnerText(i18n.raceIsPlanned());
} else {
// TODO: As long as there is no mobile race viewer, show all races as untracked
// raceStateUi.setInnerText(isUntrackedRace ? i18n.finished() : i18n.actionAnalyze());
raceStateUi.setInnerText(i18n.finished());
}
// TODO: As long as there is no mobile race viewer, show all races as untracked (with different background-color)
anchor.addClassName(local_res.css().regattacompetition_phase_fleet_raceuntracked());
// if (trackingState != RaceTrackingState.TRACKED_VALID_DATA) {
// anchor.addClassName(local_res.css().regattacompetition_phase_fleet_raceuntracked());
// }
setStyleName(anchor, local_res.css().regattacompetition_phase_fleet_raceuntracked(), true);
// setStyleName(anchor, local_res.css().regattacompetition_phase_fleet_raceuntracked(), isUntrackedRace);
}
}
@@ -6,8 +6,9 @@
<ui:with field="local_res" type="com.sap.sailing.gwt.home.mobile.partials.regattacompetition.RegattaCompetitionResources" />
<a class="{local_res.css.regattacompetition_phase_fleet_race}" style="display:block; text-decoration:none;">
<div class="{local_res.css.regattacompetition_phase_fleet_race_title}" ui:field="raceNameUi"></div>
<div class="{local_res.css.regattacompetition_phase_fleet_race_subtitle}" ui:field="raceDateUi">
<ui:text from="{i18n.raceIsPlanned}" />
<div class="{local_res.css.regattacompetition_phase_fleet_race_subtitle}">
<div class="{local_res.css.regattacompetition_phase_fleet_race_state}" ui:field="raceStateUi"></div>
<div class="{local_res.css.regattacompetition_phase_fleet_race_date}" ui:field="raceDateUi"></div>
</div>
<img src="images/home/skip-forward.png" class="{local_res.css.regattacompetition_phase_fleet_race_arrow}"></img>
</a>
@@ -30,5 +30,7 @@ public interface RegattaCompetitionResources extends ClientBundle {
String regattacompetition_phase_fleet_raceuntracked();
String regattacompetition_phase_fleet_racelive();
String regattacompetition_phase_fleet_raceplanned();
String regattacompetition_phase_fleet_race_state();
String regattacompetition_phase_fleet_race_date();
}
}