Commits

Anonymous committed ad3f994

Migrate default layout to a skin

Comments (0)

Files changed (5)

chempound-webapp/src/main/java/net/chempound/webapp/plugin/DefaultSkinRegistry.java

     @Inject
     public DefaultSkinRegistry(final FreemarkerService freemarkerService) {
         this.freemarkerService = freemarkerService;
+        register("default", new Skin("default", DefaultSkinRegistry.class, "/net/chempound/skin/default/resources/", "/net/chempound/skin/default/templates/"));
     }
 
     @Override

chempound-webapp/src/main/resources/net/chempound/skin/default/resources/default.css

+a {
+    text-decoration: none;
+}
+a:hover {
+    text-decoration: underline;
+}
+
+.content {
+    max-width: 980px;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+html, body {
+    margin: 0;
+    padding: 0;
+    background-color: #464646;
+}
+h1 {
+    margin: 0;
+}
+
+body {
+    font-family: Verdana, Arial, Helvetica, sans-serif;
+}
+
+html header {
+    background-color: #464646;
+    color: #ffffff;
+    height: 80px;
+}
+html header h1 {
+    margin: 0;
+    padding: 15px;
+    font-size: 24pt;
+}
+
+article {
+    background-color: #ffffff;
+    color: #444444;
+    padding: 1em 1em 2em 1em;
+    clear: both;
+}
+article h1 {
+    font-size: 18pt;
+    padding: 10px 10px 30px 10px;
+}
+
+footer {
+    clear: both;
+}
+
+dl.bib dt {
+    clear: left;
+    float: left;
+    font-weight: bold;
+    width: 140px;
+    margin: 0;
+    padding: 5px;
+}
+dl.bib dd {
+    float: left;
+    width: 360px;
+    margin: 0;
+    padding: 5px;
+}
+
+ul.files {
+    padding: 0;
+}
+ul.files li {
+    background-color: #c0ffc0;
+    width: 420px;
+    padding: 4px 8px;
+    margin: 2px;
+    list-style: none;
+}
+
+.clear {
+    clear: both;
+}
+
+article h2 {
+    font-size: 16pt;
+    padding-top: 1em;
+}
+
+nav {
+    background-color: #888888;
+    font-weight: bold;
+	margin: 0;
+	padding: 0;
+}
+
+nav a.first {
+    border: none;
+}
+
+nav ul {
+    float: left;
+    list-style: none outside none;
+    line-height: 1.5em;
+	margin: 0;
+	padding: 0.2em 1em;
+}
+
+nav ul li {
+    float: left;
+    display: block;
+}
+
+nav ul li a {
+    display: block;
+    color: #222266;
+    padding: 4px 10px;
+    border-left: 2px solid black;
+}
+
+
+
+div.right {
+    float: right;
+    width: 400px;
+    height: 400px;
+    background: #d0d0d0;
+    padding: 0;
+    margin: 0;
+}
+
+div#image {
+    height: 400px;
+    background: #e0e0e0;
+}
+
+article div.result h2 {
+    font-size: 13pt;
+    margin: 0;
+    padding: 4px;
+}
+
+div.result {
+    background: #f0f0f0;
+    margin: 3px;
+}
+div.result {
+
+}
+div.result div.dataType {
+    padding: 4px;
+    font-size: 10pt;
+}
+
+div.result img.thumbnail {
+    float: left;
+    padding: 4px;
+    border: none;
+}
+
+div.sparql-results table {
+    background: white;
+}
+
+div.resource {
+    background: #c0f0c0;
+    margin: 3px;
+}
+
+div.resource h2, div.resource p {
+    margin: 4px;
+    padding: 2px;
+}
+
+    dl.identifier dt {
+        clear: left;
+        float: left;
+        font-weight: bold;
+        width: 100px;
+        margin: 0;
+        padding: 5px;
+    }
+    dl.identifier dd {
+        float: left;
+        width: 800px;
+        margin: 0;
+        padding: 5px;
+        word-wrap: break-word;
+    }
+    dl.identifier dt {
+        color: #808080;
+        font-size: small;
+    }
+
+    dl.identifier dd {
+        color: #a0a0a0;
+        font-size: small;
+    }
+
+a img {
+    border: none;
+    vertical-align: middle;
+}
+
+
+div.license h3 {
+    font-size: 13pt;
+}
+
+div.license p {
+    font-size: 10pt;
+}
+
+
+p.uri {
+    color: #606060;
+    font-size: small;
+    margin-top: 0;
+    margin-bottom: 0;
+    padding-top: 6px;
+    padding-botton: 12px;
+}
+
+p.uri b {
+    color: #808080;
+}
+
+p.uri a {
+    color: inherit;
+}
+
+
+div.search p label {
+    text-align: right;
+    float: left;
+    width: 250px;
+}
+div.search p input {
+    margin-left: 12px;
+    width: 350px;
+}
+
+
+table.sparql-results {
+    border-width: 1px;
+    border-spacing: 2px;
+    border-style: outset;
+    border-color: gray;
+    border-collapse: collapse;
+    background-color: white;
+}
+table.sparql-results th {
+    border-width: 1px;
+    padding: 2px;
+    border-style: outset;
+    border-color: gray;
+    background-color: white;
+    /*-moz-border-radius: ;*/
+}
+table.sparql-results td {
+    border-width: 1px;
+    padding: 2px;
+    border-style: outset;
+    border-color: gray;
+    background-color: white;
+    /*-moz-border-radius: ;*/
+}

chempound-webapp/src/main/resources/net/chempound/skin/default/templates/default.ftl

+<!DOCTYPE html>
+<html>
+<head>
+    <title>${title}</title>
+<#list STYLESHEETS as stylesheet>
+    <link rel="stylesheet" href="${stylesheet}"/>
+</#list>
+<#if stylesheets?has_content>
+    <#list stylesheets as stylesheet>
+        <link rel="stylesheet" href="${stylesheet}"/>
+    </#list>
+</#if>
+<#if headers?has_content>
+    <#list headers as header>
+        <#assign headerTemplate = header?interpret>
+        <@headerTemplate />
+    </#list>
+</#if>
+    <link rel="stylesheet" href="${URI_BASE}/skin/default/default.css"/>
+</head>
+
+<body>
+
+<header>
+    <div class="content">
+        <h1>${@.data.title}</h1>
+    </div>
+</header>
+
+<nav>
+    <div class="content">
+        <ul>
+            <li><a href="${URI_BASE}/" class="first">Home</a></li>
+            <li><a href="${URI_BASE}/content/">Browse</a></li>
+            <li><a href="${URI_BASE}/search/">Search</a></li>
+            <li><a href="${URI_BASE}/sparql/">SPARQL</a></li>
+            <li><a href="${URI_BASE}/feeds/">Feeds</a></li>
+        </ul>
+        <div class="clear"></div>
+    </div>
+</nav>
+
+<article>
+    <div class="content">
+
+    ${content}
+
+    <!-- content ends -->
+    </div>
+</article>
+
+<footer>
+    <p></p>
+</footer>
+
+<#if @.data.googleAnalyticsId??>
+<!-- change the UA-XXXXX-X to be your site's ID -->
+<script>
+    var _gaq = [['_setAccount', '${@.data.googleAnalyticsId}'], ['_trackPageview']];
+    (function(d, t) {
+        var g = d.createElement(t),
+                s = d.getElementsByTagName(t)[0];
+        g.async = true;
+        g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+        s.parentNode.insertBefore(g, s);
+    })(document, 'script');
+</script>
+</#if>
+
+</body>
+</html>

chempound-webapp/src/main/resources/net/chempound/templates/include/default-skin.ftl

-<!DOCTYPE html>
-<html>
-<head>
-    <title>${title}</title>
-<#list STYLESHEETS as stylesheet>
-    <link rel="stylesheet" href="${stylesheet}"/>
-</#list>
-<#if stylesheets?has_content>
-    <#list stylesheets as stylesheet>
-        <link rel="stylesheet" href="${stylesheet}"/>
-    </#list>
-</#if>
-<#if headers?has_content>
-    <#list headers as header>
-        <#assign headerTemplate = header?interpret>
-        <@headerTemplate />
-    </#list>
-</#if>
-</head>
-
-<body>
-
-<header>
-    <div class="content">
-        <h1>${@.data.title}</h1>
-    </div>
-</header>
-
-<nav>
-    <div class="content">
-        <ul>
-            <li><a href="${URI_BASE}/" class="first">Home</a></li>
-            <li><a href="${URI_BASE}/content/">Browse</a></li>
-            <li><a href="${URI_BASE}/search/">Search</a></li>
-            <li><a href="${URI_BASE}/sparql/">SPARQL</a></li>
-            <li><a href="${URI_BASE}/feeds/">Feeds</a></li>
-        </ul>
-        <div class="clear"></div>
-    </div>
-</nav>
-
-<article>
-    <div class="content">
-
-    ${content}
-
-    <!-- content ends -->
-    </div>
-</article>
-
-<footer>
-    <p></p>
-</footer>
-
-<#if @.data.googleAnalyticsId??>
-<!-- change the UA-XXXXX-X to be your site's ID -->
-<script>
-    var _gaq = [['_setAccount', '${@.data.googleAnalyticsId}'], ['_trackPageview']];
-    (function(d, t) {
-        var g = d.createElement(t),
-                s = d.getElementsByTagName(t)[0];
-        g.async = true;
-        g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        s.parentNode.insertBefore(g, s);
-    })(document, 'script');
-</script>
-</#if>
-
-</body>
-</html>

chempound-webapp/src/main/resources/net/chempound/templates/include/layout.ftl

 title="Chempound Repository"
 >
 <#local content><#nested/></#local>
-<#include "default-skin.ftl"/>
+<#include "/skins/default/default.ftl"/>
 </#macro>