From 9abfc98f0e61b727b905b4911433f1890565bf9c Mon Sep 17 00:00:00 2001 From: Markus Kreth Date: Sun, 13 Jan 2019 22:37:11 +0100 Subject: [PATCH] Colors for different Calendars/organizerDisplayName --- .../business/EventBusiness.java | 2 -- .../vaadinclubhelper/data/ClubEvent.java | 5 ++++ .../ui/components/PersonEditDialog.java | 11 --------- .../themes/vaadin-clubhelpertheme/styles.css | 24 +++++++++++++++++++ .../vaadin-clubhelpertheme.scss | 23 +++++++++++++++++- 5 files changed, 51 insertions(+), 14 deletions(-) diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventBusiness.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventBusiness.java index ef0238d..5225f5c 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventBusiness.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/business/EventBusiness.java @@ -23,11 +23,9 @@ public class EventBusiness { private ClubEvent current; public synchronized List loadEvents() { - List list = dao.listAll(); log.trace("Returning events from database: {}", list); return list; - } public ClubEvent getCurrent() { diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java index cc5f7dd..695d525 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/data/ClubEvent.java @@ -82,6 +82,11 @@ public class ClubEvent extends BasicItem { return organizerDisplayName; } + @Override + public String getStyleName() { + return organizerDisplayName; + } + public Set getPersons() { return persons; } diff --git a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonEditDialog.java b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonEditDialog.java index 7bdfb2d..4be7e35 100644 --- a/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonEditDialog.java +++ b/src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonEditDialog.java @@ -53,7 +53,6 @@ public class PersonEditDialog extends Window { Switch sw = new Switch(g.getName()); sw.setData(g); sw.setValue(selected.contains(g)); -// sw.addValueChangeListener(ev -> groupChanged(ev)); glay.addComponent(sw); binder.forField(sw).bind(p -> p.getGroups().contains(g), (bean, fieldvalue) -> { @@ -100,14 +99,4 @@ public class PersonEditDialog extends Window { } } -// private void groupChanged(ValueChangeEvent ev) { -// GroupDef group = (GroupDef) ((Switch) ev.getComponent()).getData(); -// Set pg = person.getPersongroups(); -// if (ev.getValue()) { -// pg.add(group); -// } else { -// pg.remove(group); -// } -// } - } diff --git a/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/styles.css b/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/styles.css index cf2db0a..ccde9cc 100644 --- a/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/styles.css +++ b/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/styles.css @@ -15632,4 +15632,28 @@ div.v-layout.v-horizontal.v-widget { background: url(images/arrowLeft.png); background-size: cover; cursor: pointer; +} + +.vaadin-clubhelpertheme .mtv_allgemein { + background: #ffff00; +} + +.vaadin-clubhelpertheme .v-calendar-event-mtv_allgemein { + background: #ffff00; +} + +.vaadin-clubhelpertheme .v-calendar-event-mtv_allgemein-all-day { + background: #ffff00; +} + +.vaadin-clubhelpertheme .mtv_wettkampf { + background: #99ff33; +} + +.vaadin-clubhelpertheme .v-calendar-event-mtv_wettkampf { + background: #99ff33; +} + +.vaadin-clubhelpertheme .v-calendar-event-mtv_wettkampf-all-day { + background: #99ff33; } \ No newline at end of file diff --git a/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/vaadin-clubhelpertheme.scss b/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/vaadin-clubhelpertheme.scss index 867bdbb..bf4408c 100644 --- a/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/vaadin-clubhelpertheme.scss +++ b/src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/vaadin-clubhelpertheme.scss @@ -59,5 +59,26 @@ background-size: cover; cursor: pointer; /* Mouse pointer on hover */ } - + .mtv_allgemein { + background:#ffff00; + } + .v-calendar-event-mtv_allgemein { + background:#ffff00; + } + .v-calendar-event-mtv_allgemein-all-day { + background:#ffff00; + } + .mtv_wettkampf { + background:#99ff33; + } + .v-calendar-event-mtv_wettkampf { + background:#99ff33; + } + .v-calendar-event-mtv_wettkampf-all-day { + background:#99ff33; + } + .Schulferien { + } + .v-calendar-event-Schulferien { + } }