summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-06-23 20:47:42 -0700
committerJesse Morgan <jesse@jesterpm.net>2014-06-23 20:47:42 -0700
commitbd1f76dba80b4ee74906e30dc932d7e409ef8a33 (patch)
tree97f24adf658c658b8dc578286ec02152ed7b3c29
parentdf554b1754ffc31d2e7a116f197f7784d75039ec (diff)
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.
-rw-r--r--src/com/p4square/fmfacade/FMFacade.java15
-rw-r--r--src/com/p4square/fmfacade/FreeMarkerPageResource.java1
-rw-r--r--src/templates/pages/index.html.ftl3
-rw-r--r--src/templates/templates/header.ftl3
-rw-r--r--web/style.css5
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 <jesse@jesterpm.net>
*/
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 @@
<header>
<h1>
<a href="http://myfoursquarechurch.com"><img src="${staticRoot}/images/foursquarelg.png"></a>
+ <#if config.getDomain() != "prod">
+ <span class="versiontag">${config.getDomain()}</span>
+ </#if>
</h1>
<#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
@@ -5,6 +5,9 @@
<#else>
<a href="${dynamicRoot}/index.html"><img src="${staticRoot}/images/logo.png"> Grow Process</a>
</#if>
+ <#if config.getDomain() != "prod">
+ <span class="versiontag">${config.getDomain()}</span>
+ </#if>
<a id="foursquarefloat" href="http://myfoursquarechurch.com"><img src="${staticRoot}/images/foursquaresm.png" alt="Foursqaure Church" /></a>
</h1>
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;
}