mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-25 05:23:51 +00:00
Fixed event count in events list year headers
This commit is contained in:
1 parent
117f188f3b
commit
adb84fbb8b
3 files changed
+8
-2
No files matched your search
+1
-1
@@ -53,7 +53,7 @@ public class EventsOverviewRecentYear extends Composite {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
this.year.setInnerText(String.valueOf(yearDTO.getYear()));
|
||||
this.eventsCount.setInnerText(i18n.eventsCount(events.size()));
|
||||
this.eventsCount.setInnerText(i18n.eventsCount(yearDTO.getEventCount()));
|
||||
if(yearDTO.getSailorCount() > 0) {
|
||||
sailorsCount.setInnerText(i18n.competitorsCount(yearDTO.getSailorCount()));
|
||||
} else {
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class EventsOverviewRecentYear extends Composite {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
this.year.setInnerText(String.valueOf(yearDTO.getYear()));
|
||||
this.eventsCount.setInnerText(i18n.eventsCount(events.size()));
|
||||
this.eventsCount.setInnerText(i18n.eventsCount(yearDTO.getEventCount()));
|
||||
boolean first = true;
|
||||
for (EventListEventDTO eventDTO : events) {
|
||||
PlaceNavigation<EventDefaultPlace> eventNavigation = navigator.getEventNavigation(eventDTO.getId()
|
||||
|
||||
+6
@@ -7,6 +7,7 @@ import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
public class EventListYearDTO implements IsSerializable {
|
||||
private int year;
|
||||
private int eventCount;
|
||||
private int countryCount;
|
||||
private int sailorCount;
|
||||
private int trackedRacesCount;
|
||||
@@ -29,6 +30,7 @@ public class EventListYearDTO implements IsSerializable {
|
||||
}
|
||||
|
||||
protected void addEvent(EventListEventDTO event) {
|
||||
eventCount += event.getEventSeries() == null ? 1 : event.getEventSeries().getEventsCount();
|
||||
for(int i = 0; i < events.size(); i++) {
|
||||
if(events.get(i).getStartDate().compareTo(event.getStartDate()) < 0) {
|
||||
events.add(i, event);
|
||||
@@ -37,6 +39,10 @@ public class EventListYearDTO implements IsSerializable {
|
||||
}
|
||||
events.add(event);
|
||||
}
|
||||
|
||||
public int getEventCount() {
|
||||
return eventCount;
|
||||
}
|
||||
|
||||
public int getCountryCount() {
|
||||
return countryCount;
|
||||
|
||||
Reference in new issue
Block a user