From bd1f76dba80b4ee74906e30dc932d7e409ef8a33 Mon Sep 17 00:00:00 2001 From: Jesse Morgan Date: Mon, 23 Jun 2014 20:47:42 -0700 Subject: Adding a domain label to the header. The page header now displays the domain label if the domain is not prod. This is useful for quickly identifying if you are modifying prod data. --- src/com/p4square/fmfacade/FMFacade.java | 15 ++++++++++++--- src/com/p4square/fmfacade/FreeMarkerPageResource.java | 1 + src/templates/pages/index.html.ftl | 3 +++ src/templates/templates/header.ftl | 3 +++ web/style.css | 5 +++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/com/p4square/fmfacade/FMFacade.java b/src/com/p4square/fmfacade/FMFacade.java index 54e4098..0e552b0 100644 --- a/src/com/p4square/fmfacade/FMFacade.java +++ b/src/com/p4square/fmfacade/FMFacade.java @@ -18,8 +18,10 @@ import freemarker.template.Template; import org.apache.log4j.Logger; +import com.p4square.grow.config.Config; + /** - * + * * @author Jesse Morgan */ public class FMFacade extends Application { @@ -32,11 +34,18 @@ public class FMFacade extends Application { mFMConfig.setObjectWrapper(new DefaultObjectWrapper()); } + /** + * @return a Config object. + */ + public Config getConfig() { + return null; + } + @Override public synchronized Restlet createInboundRoot() { return createRouter(); } - + /** * Retrieve a template. * @@ -75,7 +84,7 @@ public class FMFacade extends Application { component.getServers().add(Protocol.HTTP, 8085); component.getClients().add(Protocol.HTTP); component.getDefaultHost().attach(new FMFacade()); - + // Setup shutdown hook Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { diff --git a/src/com/p4square/fmfacade/FreeMarkerPageResource.java b/src/com/p4square/fmfacade/FreeMarkerPageResource.java index 46b0ec5..c6cf81e 100644 --- a/src/com/p4square/fmfacade/FreeMarkerPageResource.java +++ b/src/com/p4square/fmfacade/FreeMarkerPageResource.java @@ -76,6 +76,7 @@ public class FreeMarkerPageResource extends ServerResource { root.put("attributes", getRequestAttributes()); root.put("query", getQuery().getValuesMap()); + root.put("config", mFMF.getConfig()); if (getClientInfo().isAuthenticated()) { final User user = getClientInfo().getUser(); diff --git a/src/templates/pages/index.html.ftl b/src/templates/pages/index.html.ftl index 1b59509..59a5e38 100644 --- a/src/templates/pages/index.html.ftl +++ b/src/templates/pages/index.html.ftl @@ -16,6 +16,9 @@

+ <#if config.getDomain() != "prod"> + ${config.getDomain()} +

<#include "/templates/nav.ftl"> diff --git a/src/templates/templates/header.ftl b/src/templates/templates/header.ftl index 8d568bf..0911bbc 100644 --- a/src/templates/templates/header.ftl +++ b/src/templates/templates/header.ftl @@ -4,6 +4,9 @@ Grow Process <#else> Grow Process + + <#if config.getDomain() != "prod"> + ${config.getDomain()} Foursqaure Church diff --git a/web/style.css b/web/style.css index 42ffdd7..e7c5bee 100644 --- a/web/style.css +++ b/web/style.css @@ -5,6 +5,11 @@ html, body { height: 100%; } +.versiontag { + font-size: 150%; + font-style: italic; +} + .hidden { display: none; } -- cgit v1.2.3