Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

Commit

Permalink
Added configuration option for training mode banner
Browse files Browse the repository at this point in the history
Fixes #42
  • Loading branch information
jashort committed Aug 25, 2016
1 parent 491136d commit 75b4bf7
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 14 deletions.
15 changes: 14 additions & 1 deletion docs/installation/application.properties
Expand Up @@ -24,8 +24,14 @@ spring.datasource.jmx-enabled=true
spring.jpa.hibernate.ddl-auto=update


###############################################################################
# Server
#
# Server port number (default 8080)
server.port = 8080

# Vaadin config
vaadin.servlet.productionMode=true
#vaadin.servlet.productionMode=true # Disable debugging, set this in production
vaadin.servlet.heartbeatInterval=60
vaadin.servlet.closeIdleSessions=false

Expand All @@ -49,3 +55,10 @@ kumoreg.printing.badgeFormat=lite
# If true (default), require attendees to have a phone or email,
# otherwise permit them to be empty/null.
kumoreg.validation.attendee.requirePhoneOrEmail=false

# If true, "Training" will be displayed in the left menu background
# to provide visual cues that you're not in production. No other changes are made;
# changes will still be saved to the configured database, for example.
# Enable this on the training server. Make sure to configure a different database than
# the production server.
kumoreg.trainingMode=false
19 changes: 9 additions & 10 deletions src/main/java/org/kumoricon/KumoRegUI.java
Expand Up @@ -33,6 +33,8 @@ public class KumoRegUI extends UI {
@Value("${info.build.buildDate}")
private String buildDate;

@Value("${kumoreg.trainingMode}")
private boolean trainingMode;

@Autowired
private SiteLogo logo;
Expand Down Expand Up @@ -61,20 +63,17 @@ protected void init(VaadinRequest request) {
leftPanel.setWidth(200, Unit.PIXELS);
leftPanel.setHeight("100%");
leftPanel.addStyleName("kumoLeftMenu");

leftPanel.addComponent(logo);

if (trainingMode) {
addStyleName("kumoTrainingMode");
}


if (getLoggedInUser() != null) { buildMenu(); }
root.addComponent(leftPanel);

// final CssLayout navigationBar = new CssLayout();
// navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
// navigationBar.addComponent(createNavigationButton("Home",
// HomeView.VIEW_NAME));
// navigationBar.addComponent(createNavigationButton("UI Scoped View",
// UIScopedView.VIEW_NAME));
// navigationBar.addComponent(createNavigationButton("View Scoped View",
// ViewScopedView.VIEW_NAME));
// root.addComponent(navigationBar);

final Panel viewContainer = new Panel();
viewContainer.setSizeFull();
root.addComponent(viewContainer);
Expand Down
Expand Up @@ -4,7 +4,7 @@
"name": "kumoreg.printing.enablePrintingFromServer",
"type": "java.lang.Boolean",
"description": "Print badges via printers installed locally on the server."
} ,
},
{
"name": "kumoreg.printing.badgeFormat",
"type": "java.lang.String",
Expand All @@ -14,6 +14,11 @@
"name": "kumoreg.validation.attendee.requirePhoneOrEmail",
"type": "java.lang.Boolean",
"description": "Whether to require attendees to have either a phone or an email (default true)."
},
{
"name": "kumoreg.trainingMode",
"type": "java.lang.String",
"description": "Display training mode banner in menu."
}
]
}
17 changes: 15 additions & 2 deletions src/main/resources/application.properties
Expand Up @@ -24,6 +24,12 @@ spring.datasource.jmx-enabled=true
spring.jpa.hibernate.ddl-auto=update


###############################################################################
# Server
#
# Server port number (default 8080)
server.port = 8080

# Vaadin config
#vaadin.servlet.productionMode=true # Disable debugging, set this in production
vaadin.servlet.heartbeatInterval=60
Expand Down Expand Up @@ -53,8 +59,15 @@ info.build.buildDate=@maven.build.timestamp@
kumoreg.printing.enablePrintingFromServer=false

# Which badge format to use? Valid formats are "lite" and "full"
kumoreg.printing.badgeFormat=lite
kumoreg.printing.badgeFormat=full

# If true (default), require attendees to have a phone or email,
# otherwise permit them to be empty/null.
kumoreg.validation.attendee.requirePhoneOrEmail=false
kumoreg.validation.attendee.requirePhoneOrEmail=true

# If true, "Training" will be displayed in the left menu background
# to provide visual cues that you're not in production. No other changes are made;
# changes will still be saved to the configured database, for example.
# Enable this on the training server. Make sure to configure a different database than
# the production server.
kumoreg.trainingMode=false
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/main/webapp/VAADIN/themes/kumo/styles.scss
Expand Up @@ -21,4 +21,9 @@
// Used for tables that can be sorted but individual items can't be clicked on
.kumoHeaderOnlyHandPointer .v-grid-header {
cursor: pointer;
}

// Modifies the left hand menu when in training mode
.kumoTrainingMode {
background: url("img/trainingbackground.png");
}

0 comments on commit 75b4bf7

Please sign in to comment.