|
|
@ -4,6 +4,7 @@ import com.vaadin.flow.component.applayout.AppLayout; |
|
|
import com.vaadin.flow.component.applayout.DrawerToggle; |
|
|
import com.vaadin.flow.component.applayout.DrawerToggle; |
|
|
import com.vaadin.flow.component.button.Button; |
|
|
import com.vaadin.flow.component.button.Button; |
|
|
import com.vaadin.flow.component.button.ButtonVariant; |
|
|
import com.vaadin.flow.component.button.ButtonVariant; |
|
|
|
|
|
import com.vaadin.flow.component.dependency.CssImport; |
|
|
import com.vaadin.flow.component.html.*; |
|
|
import com.vaadin.flow.component.html.*; |
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
import com.vaadin.flow.component.icon.VaadinIcon; |
|
|
import com.vaadin.flow.component.orderedlayout.FlexComponent; |
|
|
import com.vaadin.flow.component.orderedlayout.FlexComponent; |
|
|
@ -16,6 +17,7 @@ import com.vaadin.flow.theme.lumo.LumoUtility; |
|
|
import mx.gob.jumapacelaya.services.SecurityService; |
|
|
import mx.gob.jumapacelaya.services.SecurityService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@CssImport("./themes/sistema-mantenimiento/styles.css") |
|
|
public class MainLayout extends AppLayout { |
|
|
public class MainLayout extends AppLayout { |
|
|
|
|
|
|
|
|
private H2 viewTitle; |
|
|
private H2 viewTitle; |
|
|
@ -23,7 +25,7 @@ public class MainLayout extends AppLayout { |
|
|
|
|
|
|
|
|
public MainLayout(SecurityService securityService) { |
|
|
public MainLayout(SecurityService securityService) { |
|
|
this.securityService = securityService; |
|
|
this.securityService = securityService; |
|
|
this.getStyle().set("background-image", "url('images/bckgnd.png')"); |
|
|
|
|
|
|
|
|
this.addClassName("app-layout"); |
|
|
setPrimarySection(Section.DRAWER); |
|
|
setPrimarySection(Section.DRAWER); |
|
|
addDrawerContent(); |
|
|
addDrawerContent(); |
|
|
addHeaderContent(); |
|
|
addHeaderContent(); |
|
|
@ -32,8 +34,7 @@ public class MainLayout extends AppLayout { |
|
|
private void addHeaderContent() { |
|
|
private void addHeaderContent() { |
|
|
DrawerToggle toggle = new DrawerToggle(); |
|
|
DrawerToggle toggle = new DrawerToggle(); |
|
|
toggle.setAriaLabel("Menu toggle"); |
|
|
toggle.setAriaLabel("Menu toggle"); |
|
|
toggle.getStyle().set("border-radius", "50px"); |
|
|
|
|
|
toggle.getStyle().set("back-color", "red"); |
|
|
|
|
|
|
|
|
toggle.addClassName("drawer-toggle"); |
|
|
|
|
|
|
|
|
viewTitle = new H2(); |
|
|
viewTitle = new H2(); |
|
|
viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); |
|
|
viewTitle.addClassNames(LumoUtility.FontSize.LARGE, LumoUtility.Margin.NONE); |
|
|
@ -45,14 +46,12 @@ public class MainLayout extends AppLayout { |
|
|
Button logoutButton = new Button("Cerrar sesión", event -> { |
|
|
Button logoutButton = new Button("Cerrar sesión", event -> { |
|
|
securityService.logout(); |
|
|
securityService.logout(); |
|
|
}); |
|
|
}); |
|
|
logoutButton.getStyle().set("margin-right", "50px"); |
|
|
|
|
|
|
|
|
logoutButton.addClassName("logout-button"); |
|
|
logoutButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY ,ButtonVariant.LUMO_ERROR); |
|
|
logoutButton.addThemeVariants(ButtonVariant.LUMO_PRIMARY ,ButtonVariant.LUMO_ERROR); |
|
|
|
|
|
|
|
|
HorizontalLayout headerContent = new HorizontalLayout(); |
|
|
HorizontalLayout headerContent = new HorizontalLayout(); |
|
|
headerContent.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER); |
|
|
headerContent.setDefaultVerticalComponentAlignment(FlexComponent.Alignment.CENTER); |
|
|
headerContent.setWidthFull(); |
|
|
|
|
|
headerContent.setHeight("64px"); |
|
|
|
|
|
headerContent.getStyle().set("background-color", "#AA86E0"); |
|
|
|
|
|
|
|
|
headerContent.addClassName("header-content"); |
|
|
headerContent.add(viewTitle); |
|
|
headerContent.add(viewTitle); |
|
|
headerContent.setFlexGrow(1, viewTitle); |
|
|
headerContent.setFlexGrow(1, viewTitle); |
|
|
headerContent.add(usrNameLabel, logoutButton); |
|
|
headerContent.add(usrNameLabel, logoutButton); |
|
|
@ -67,7 +66,7 @@ public class MainLayout extends AppLayout { |
|
|
headerLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
headerLayout.setAlignItems(FlexComponent.Alignment.CENTER); |
|
|
|
|
|
|
|
|
Image imgLogo = new Image("images/1027x160.png", "Logo"); |
|
|
Image imgLogo = new Image("images/1027x160.png", "Logo"); |
|
|
imgLogo.setWidth("250px"); |
|
|
|
|
|
|
|
|
imgLogo.addClassName("drawer-logo"); |
|
|
|
|
|
|
|
|
headerLayout.add(imgLogo); |
|
|
headerLayout.add(imgLogo); |
|
|
|
|
|
|
|
|
@ -79,9 +78,9 @@ public class MainLayout extends AppLayout { |
|
|
private SideNav createNavigation() { |
|
|
private SideNav createNavigation() { |
|
|
SideNav nav = new SideNav(); |
|
|
SideNav nav = new SideNav(); |
|
|
|
|
|
|
|
|
nav.addItem(new SideNavItem("Mantenimiento", MantenimientoView.class, VaadinIcon.WRENCH.create())); |
|
|
|
|
|
nav.addItem(new SideNavItem("Plan Anual", PlanAnualView.class, VaadinIcon.CALENDAR.create())); |
|
|
nav.addItem(new SideNavItem("Plan Anual", PlanAnualView.class, VaadinIcon.CALENDAR.create())); |
|
|
nav.addItem(new SideNavItem("Listado de Actividades", ActDiariaView.class, VaadinIcon.EDIT.create())); |
|
|
nav.addItem(new SideNavItem("Listado de Actividades", ActDiariaView.class, VaadinIcon.EDIT.create())); |
|
|
|
|
|
nav.addItem(new SideNavItem("Mantenimiento", MantenimientoView.class, VaadinIcon.WRENCH.create())); |
|
|
return nav; |
|
|
return nav; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|