Login working, some styling.

master
Markus Kreth 7 years ago
parent 9da96db4d4
commit 5395430640
  1. 1
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/CalendarComponent.java
  2. 38
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/HeadComponent.java
  3. 18
      src/main/java/de/kreth/vaadin/clubhelper/vaadinclubhelper/ui/components/PersonGrid.java
  4. 5
      src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/styles.css
  5. 4
      src/main/webapp/VAADIN/themes/vaadin-clubhelpertheme/vaadin-clubhelpertheme.scss

@ -37,6 +37,7 @@ public class CalendarComponent extends CustomComponent {
calendar.setCaption("Events");
calendar.setSizeFull();
calendar.addListener(ev -> calendarEvent(ev));
head = new HeadComponent(() -> calendar.getStartDate(), () -> calendar.getEndDate(), dataProvider);
head.updateMonthText(calendar.getStartDate());

@ -21,6 +21,7 @@ import com.vaadin.contextmenu.ContextMenu;
import com.vaadin.icons.VaadinIcons;
import com.vaadin.server.StreamResource;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.BrowserFrame;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@ -50,18 +51,30 @@ public class HeadComponent extends HorizontalLayout {
private ClubEventProvider dataProvider;
private int monthItemId;
public HeadComponent(Supplier<ZonedDateTime> startTime, Supplier<ZonedDateTime> endTime,
ClubEventProvider dataProvider) {
monthName = new Label();
monthName.setId("calendar.month");
monthName.setStyleName("title_label");
monthName.setStyleName("title_caption");
monthName.setWidth(null);
Button popupButton = new Button(VaadinIcons.MENU);
popupButton.setId("calendar.menu");
popupButton.addClickListener(ev -> openPopupMenu(ev));
this.addComponent(monthName);
popupButton.setWidth(null);
this.addComponent(popupButton);
this.addComponent(monthName);
setComponentAlignment(popupButton, Alignment.MIDDLE_LEFT);
setComponentAlignment(monthName, Alignment.MIDDLE_CENTER);
setExpandRatio(monthName, 1.0f);
setSizeFull();
this.startTime = startTime;
this.endTime = endTime;
this.dataProvider = dataProvider;
@ -74,32 +87,35 @@ public class HeadComponent extends HorizontalLayout {
}
private void openPopupMenu(ClickEvent ev) {
ContextMenu contextMenu = new ContextMenu(ev.getButton(), true);
contextMenu.addItem("Export Monat", ev1 -> calendarExport(ev1));
contextMenu.addItem("Export Jahr", ev1 -> calendarExport(ev1));
contextMenu.open(210, 40);
Button button = ev.getButton();
ContextMenu contextMenu = new ContextMenu(button, true);
monthItemId = contextMenu.addItem("Export Monat", ev1 -> calendarExport(ev1)).getId();
contextMenu.addItem("Export Jahr", ev1 -> calendarExport(ev1)).getId();
contextMenu.open(50, 50);
}
private void calendarExport(MenuItem ev1) {
boolean monthOnly = ev1.getText().contains("Monat");
boolean monthOnly = ev1.getId() == monthItemId;
List<ClubEvent> items;
ZonedDateTime start;
ZonedDateTime end;
if (monthOnly) {
start = startTime.get();
ZonedDateTime end = endTime.get();
log.debug("exporting Calendar from {} to {}", start, end);
end = endTime.get();
items = dataProvider.getItems(start, end);
} else {
start = startTime.get().withDayOfYear(1);
ZonedDateTime end = start.withMonth(12).withDayOfMonth(31);
log.debug("exporting Calendar from {} to {}", start, end);
end = start.withMonth(12).withDayOfMonth(31);
items = dataProvider.getItems(start, end);
}
Map<LocalDate, StringBuilder> values = new HashMap<>();
List<LocalDate> holidays = CalendarCreator.filterHolidays(items);
log.debug("exporting Calendar from {} to {}, itemCount = {}", start, end, items.size());
for (ClubEvent ev : items) {
ZonedDateTime evStart = ev.getStart();

@ -55,6 +55,7 @@ public class PersonGrid extends CustomComponent {
private List<GroupDef> allGroups;
private PersonFilter filter;
private ClubEvent currentEvent;
private TextField textLocation;
public PersonGrid(GroupDao groupDao, PersonDao personDao) {
@ -65,6 +66,13 @@ public class PersonGrid extends CustomComponent {
textTitle.setEnabled(false);
textTitle.setSizeFull();
textLocation = new TextField();
textLocation.setId("event.location");
textLocation.setStyleName("title_label");
textLocation.setCaption("Ort");
textLocation.setEnabled(false);
textLocation.setSizeFull();
checkIncluded = new CheckBox("Nur gemeldete");
checkIncluded.setId("person.filter.checked");
checkIncluded.addValueChangeListener(ev -> onSelectedOnly(ev));
@ -106,7 +114,7 @@ public class PersonGrid extends CustomComponent {
close.setId("person.close");
VerticalLayout panel = new VerticalLayout();
panel.addComponents(textTitle, filters, grid, close);
panel.addComponents(textTitle, textLocation, filters, grid, close);
setCompositionRoot(panel);
}
@ -191,6 +199,13 @@ public class PersonGrid extends CustomComponent {
textTitle.setValue(value);
}
private void setLocation(String value) {
if (value == null) {
value = "";
}
textLocation.setValue(value);
}
public interface ClosedFunction {
void closed();
}
@ -205,6 +220,7 @@ public class PersonGrid extends CustomComponent {
setCaption(ev.getCaption());
setTitle(ev.getCaption());
setLocation(ev.getLocation());
updateSelection(ev);
} else {

@ -15603,6 +15603,11 @@ div.v-layout.v-horizontal.v-widget {
overflow: hidden;
}
.vaadin-clubhelpertheme .title_caption {
font-weight: bold;
font-size: xx-large;
}
.vaadin-clubhelpertheme .title_label {
font-weight: bold;
font-size: large;

@ -33,6 +33,10 @@
@include valo;
// Insert your own theme rules here
.title_caption {
font-weight: bold;
font-size: xx-large;
}
.title_label {
font-weight: bold;
font-size: large;

Loading…
Cancel
Save