CCM NG/ccm-core: Some small enhancements for the Vaadin prototype
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4903 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
1f1560bfa8
commit
040d6c56dd
|
|
@ -25,6 +25,7 @@ import com.vaadin.navigator.View;
|
|||
import com.vaadin.navigator.ViewChangeListener;
|
||||
import com.vaadin.server.ClassResource;
|
||||
import com.vaadin.server.VaadinServlet;
|
||||
import com.vaadin.shared.ui.MarginInfo;
|
||||
import com.vaadin.ui.Alignment;
|
||||
import com.vaadin.ui.CssLayout;
|
||||
import com.vaadin.ui.CustomComponent;
|
||||
|
|
@ -33,6 +34,7 @@ import com.vaadin.ui.Image;
|
|||
import com.vaadin.ui.Label;
|
||||
import com.vaadin.ui.TabSheet;
|
||||
import com.vaadin.ui.VerticalLayout;
|
||||
import com.vaadin.ui.themes.ValoTheme;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
import org.libreccm.l10n.GlobalizationHelper;
|
||||
import org.libreccm.security.GroupManager;
|
||||
|
|
@ -61,7 +63,6 @@ public class AdminView extends CustomComponent implements View {
|
|||
|
||||
public static final String VIEWNAME = "admin";
|
||||
|
||||
|
||||
@Inject
|
||||
private JpqlConsoleController jpqlConsoleController;
|
||||
|
||||
|
|
@ -128,52 +129,51 @@ public class AdminView extends CustomComponent implements View {
|
|||
jpqlConsole = null;
|
||||
}
|
||||
|
||||
final GridLayout header = new GridLayout(5, 1);
|
||||
header.setWidth("100%");
|
||||
header.addStyleName("libreccm-header");
|
||||
|
||||
final Label headerInfoLine = new Label("LibreCCM");
|
||||
headerInfoLine.setId("libreccm-headerinfoline");
|
||||
header.addComponent(headerInfoLine, 3, 0, 4, 0);
|
||||
header.setComponentAlignment(headerInfoLine, Alignment.TOP_RIGHT);
|
||||
|
||||
final String logoPath;
|
||||
switch (servletContext.getInitParameter("ccm.distribution")
|
||||
.toLowerCase()) {
|
||||
case "libreccm":
|
||||
logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
break;
|
||||
case "librecms":
|
||||
logoPath = "/themes/libreccm-default/images/librecms.png";
|
||||
break;
|
||||
case "aplaws":
|
||||
logoPath = "/themes/libreccm-default/images/aplaws.png";
|
||||
break;
|
||||
case "scientificcms":
|
||||
logoPath = "/themes/libreccm-default/images/scientificcms.png";
|
||||
break;
|
||||
default:
|
||||
logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
break;
|
||||
}
|
||||
|
||||
final Image logo = new Image(null, new ClassResource(logoPath));
|
||||
logo.setId("libreccm-logo");
|
||||
logo.addStyleName("libreccm-logo");
|
||||
header.addComponent(logo, 0, 0);
|
||||
header.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);
|
||||
|
||||
// final GridLayout header = new GridLayout(5, 1);
|
||||
// header.setWidth("100%");
|
||||
// header.addStyleName("libreccm-header");
|
||||
//
|
||||
// final Label headerInfoLine = new Label("LibreCCM");
|
||||
// headerInfoLine.setId("libreccm-headerinfoline");
|
||||
// header.addComponent(headerInfoLine, 3, 0, 4, 0);
|
||||
// header.setComponentAlignment(headerInfoLine, Alignment.TOP_RIGHT);
|
||||
//
|
||||
// final String logoPath;
|
||||
// switch (servletContext.getInitParameter("ccm.distribution")
|
||||
// .toLowerCase()) {
|
||||
// case "libreccm":
|
||||
// logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
// break;
|
||||
// case "librecms":
|
||||
// logoPath = "/themes/libreccm-default/images/librecms.png";
|
||||
// break;
|
||||
// case "aplaws":
|
||||
// logoPath = "/themes/libreccm-default/images/aplaws.png";
|
||||
// break;
|
||||
// case "scientificcms":
|
||||
// logoPath = "/themes/libreccm-default/images/scientificcms.png";
|
||||
// break;
|
||||
// default:
|
||||
// logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
// break;
|
||||
// }
|
||||
//
|
||||
// final Image logo = new Image(null, new ClassResource(logoPath));
|
||||
// logo.setId("libreccm-logo");
|
||||
// logo.addStyleName("libreccm-logo");
|
||||
// header.addComponent(logo, 0, 0);
|
||||
// header.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);
|
||||
final CssLayout footer = new CssLayout();
|
||||
// footer.setWidth("100%");
|
||||
footer.setHeight("5em");
|
||||
|
||||
final VerticalLayout viewLayout = new VerticalLayout();
|
||||
final VerticalLayout viewLayout = new VerticalLayout(new Header(),
|
||||
tabSheet,
|
||||
footer);
|
||||
|
||||
viewLayout.addComponent(header);
|
||||
viewLayout.addComponent(tabSheet);
|
||||
viewLayout.addComponent(footer);
|
||||
viewLayout.addStyleName("libreccm-main-margin-top");
|
||||
|
||||
setCompositionRoot(viewLayout);
|
||||
super.setCompositionRoot(viewLayout);
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* To change this license layout, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package org.libreccm.admin.ui;
|
||||
|
||||
import com.vaadin.server.ClassResource;
|
||||
import com.vaadin.server.VaadinServlet;
|
||||
import com.vaadin.ui.Alignment;
|
||||
import com.vaadin.ui.CustomComponent;
|
||||
import com.vaadin.ui.GridLayout;
|
||||
import com.vaadin.ui.Image;
|
||||
import com.vaadin.ui.Label;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public class Header extends CustomComponent {
|
||||
|
||||
private static final long serialVersionUID = -8503268025688988953L;
|
||||
|
||||
public Header() {
|
||||
super();
|
||||
|
||||
final ServletContext servletContext = VaadinServlet
|
||||
.getCurrent()
|
||||
.getServletContext();
|
||||
|
||||
final GridLayout layout = new GridLayout(5, 1);
|
||||
layout.setWidth("100%");
|
||||
layout.addStyleName("libreccm-header");
|
||||
|
||||
final Label headerInfoLine = new Label("LibreCCM");
|
||||
headerInfoLine.setId("libreccm-headerinfoline");
|
||||
layout.addComponent(headerInfoLine, 3, 0, 4, 0);
|
||||
layout.setComponentAlignment(headerInfoLine, Alignment.TOP_RIGHT);
|
||||
|
||||
final String logoPath;
|
||||
switch (servletContext.getInitParameter("ccm.distribution")
|
||||
.toLowerCase()) {
|
||||
case "libreccm":
|
||||
logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
break;
|
||||
case "librecms":
|
||||
logoPath = "/themes/libreccm-default/images/librecms.png";
|
||||
break;
|
||||
case "aplaws":
|
||||
logoPath = "/themes/libreccm-default/images/aplaws.png";
|
||||
break;
|
||||
case "scientificcms":
|
||||
logoPath = "/themes/libreccm-default/images/scientificcms.png";
|
||||
break;
|
||||
default:
|
||||
logoPath = "/themes/libreccm-default/images/libreccm.png";
|
||||
break;
|
||||
}
|
||||
|
||||
final Image logo = new Image(null, new ClassResource(logoPath));
|
||||
logo.setId("libreccm-logo");
|
||||
logo.addStyleName("libreccm-logo");
|
||||
layout.addComponent(logo, 0, 0);
|
||||
layout.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);
|
||||
|
||||
super.setCompositionRoot(layout);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -135,10 +135,10 @@ public class LoginView extends CustomComponent implements View {
|
|||
});
|
||||
|
||||
loginPanel = new Panel("Login", formLayout);
|
||||
loginPanel.setWidth("27em");
|
||||
|
||||
loginPanel.setWidth("24em");
|
||||
|
||||
final VerticalLayout viewLayout = new VerticalLayout(loginPanel);
|
||||
final VerticalLayout viewLayout = new VerticalLayout(new Header(),
|
||||
loginPanel);
|
||||
|
||||
viewLayout.setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,4 +28,9 @@
|
|||
.scientificcms {
|
||||
background-color: #ad5353;
|
||||
}
|
||||
|
||||
.libreccm-main-margin-top {
|
||||
padding-top: 18px !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1081,7 +1081,7 @@
|
|||
*/
|
||||
|
||||
.v-vaadin-version:after {
|
||||
content: "8.1.0";
|
||||
content: "8.1.1";
|
||||
}
|
||||
|
||||
.v-widget {
|
||||
|
|
@ -14782,3 +14782,7 @@ button {
|
|||
.scientificcms {
|
||||
background-color: #ad5353;
|
||||
}
|
||||
|
||||
.libreccm-main-margin-top {
|
||||
padding-top: 18px !important;
|
||||
}
|
||||
6
pom.xml
6
pom.xml
|
|
@ -255,7 +255,7 @@
|
|||
<plugin>
|
||||
<groupId>com.vaadin</groupId>
|
||||
<artifactId>vaadin-maven-plugin</artifactId>
|
||||
<version>8.1.0</version>
|
||||
<version>8.1.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
|
|
@ -409,12 +409,12 @@
|
|||
<dependency>
|
||||
<groupId>com.vaadin</groupId>
|
||||
<artifactId>vaadin-client-compiled</artifactId>
|
||||
<version>8.1.0</version>
|
||||
<version>8.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.vaadin</groupId>
|
||||
<artifactId>vaadin-themes</artifactId>
|
||||
<version>8.1.0</version>
|
||||
<version>8.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<!--
|
||||
|
|
|
|||
Loading…
Reference in New Issue