diff --git a/webapp/config/web.xml b/webapp/config/web.xml index 905cd2921..9f6272fb8 100644 --- a/webapp/config/web.xml +++ b/webapp/config/web.xml @@ -138,6 +138,12 @@ + + + edu.cornell.mannlib.vitro.webapp.servlet.setup.FreeMarkerSetup + + + + +

${title}

+ +<#if aboutText??> +
${aboutText}
+ + +<#if acknowledgeText??> +
${acknowledgeText}
+ + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/browseGroups.ftl b/webapp/web/templates/freemarker/body/browseGroups.ftl new file mode 100644 index 000000000..90fd749d0 --- /dev/null +++ b/webapp/web/templates/freemarker/body/browseGroups.ftl @@ -0,0 +1,14 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#if message??> +

${message}

+<#else> + <#list classGroups as classGroup> +

${classGroup.publicName}

+ + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/individual.ftl b/webapp/web/templates/freemarker/body/individual.ftl new file mode 100644 index 000000000..e69de29bb diff --git a/webapp/web/templates/freemarker/body/individualList.ftl b/webapp/web/templates/freemarker/body/individualList.ftl new file mode 100644 index 000000000..c9237aca5 --- /dev/null +++ b/webapp/web/templates/freemarker/body/individualList.ftl @@ -0,0 +1,35 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +
+ +
+

${title}

+ <#if subtitle??> +

${subTitle}"

+ + + +
+
\ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/copyright.ftl b/webapp/web/templates/freemarker/components/copyright.ftl new file mode 100644 index 000000000..059479118 --- /dev/null +++ b/webapp/web/templates/freemarker/components/copyright.ftl @@ -0,0 +1,12 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#if copyright??> + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/doctype.html b/webapp/web/templates/freemarker/components/doctype.html new file mode 100644 index 000000000..08aba3bbf --- /dev/null +++ b/webapp/web/templates/freemarker/components/doctype.html @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/footer.ftl b/webapp/web/templates/freemarker/components/footer.ftl new file mode 100644 index 000000000..368a97848 --- /dev/null +++ b/webapp/web/templates/freemarker/components/footer.ftl @@ -0,0 +1,28 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#import "/macros/list.ftl" as l> + + + +<#-- SCRIPT TAGS SHOULD GO HERE --> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/head.ftl b/webapp/web/templates/freemarker/components/head.ftl new file mode 100644 index 000000000..03e28da02 --- /dev/null +++ b/webapp/web/templates/freemarker/components/head.ftl @@ -0,0 +1,6 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + + + <#include "title.ftl"> + <#include "stylesheets.ftl"> + \ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/identity.ftl b/webapp/web/templates/freemarker/components/identity.ftl new file mode 100644 index 000000000..07b5778f9 --- /dev/null +++ b/webapp/web/templates/freemarker/components/identity.ftl @@ -0,0 +1,33 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#import "/macros/list.ftl" as l> + +
+ +

${siteName}

+ + <#-- RY We will need this in non-NIHVIVO versions + <#if tagline.has_content> + ${tagline} + + --> + + +
\ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/menu.ftl b/webapp/web/templates/freemarker/components/menu.ftl new file mode 100644 index 000000000..42cf05931 --- /dev/null +++ b/webapp/web/templates/freemarker/components/menu.ftl @@ -0,0 +1,13 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +
+ +
\ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/scripts.ftl b/webapp/web/templates/freemarker/components/scripts.ftl new file mode 100644 index 000000000..841b7965f --- /dev/null +++ b/webapp/web/templates/freemarker/components/scripts.ftl @@ -0,0 +1 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/search.ftl b/webapp/web/templates/freemarker/components/search.ftl new file mode 100644 index 000000000..76b204e22 --- /dev/null +++ b/webapp/web/templates/freemarker/components/search.ftl @@ -0,0 +1,19 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +
+
+ + + <#if showFlag1SearchField??> + + <#else> + + + + + +
+
\ No newline at end of file diff --git a/webapp/web/templates/freemarker/components/stylesheets.ftl b/webapp/web/templates/freemarker/components/stylesheets.ftl new file mode 100644 index 000000000..23321b49d --- /dev/null +++ b/webapp/web/templates/freemarker/components/stylesheets.ftl @@ -0,0 +1,8 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + + + + +<#list stylesheets as stylesheet> + ${stylesheet} + diff --git a/webapp/web/templates/freemarker/components/title.ftl b/webapp/web/templates/freemarker/components/title.ftl new file mode 100644 index 000000000..d17df2191 --- /dev/null +++ b/webapp/web/templates/freemarker/components/title.ftl @@ -0,0 +1,3 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +${title} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/macros/list.ftl b/webapp/web/templates/freemarker/macros/list.ftl new file mode 100644 index 000000000..1c0b6ef49 --- /dev/null +++ b/webapp/web/templates/freemarker/macros/list.ftl @@ -0,0 +1,68 @@ +<#-- + Output a sequence of
  • elements, adding classes "first" and "last" to first and last list elements, respectively. + It is helpful when the list elements are generated conditionally, to avoid complex tests for the presence/absence + of other list elements in order to assign these classes. + + Input should be a series of
  • elements separated by some delimiter. Default delimiter value is ",". + + Tolerates a delimiter following the last
  • element. + + Usage: + <@makeList> +
  • apples
  • , +
  • bananas
  • , +
  • oranges
  • + <@makeList> + + <@makeList delim="??"> +
  • apples, oranges
  • ?? +
  • bananas, lemons
  • ?? +
  • grapefruit, limes
  • + <@makeList> + + RY Consider rewriting in Java. Probably designers won't want to modify this. +--> +<#macro makeList delim=","> + <#assign text> + <#nested> + + + <#-- Strip out a list-final delimiter, else (unlike most languages) it results in an empty final array item. --> + <#assign text = text?replace("${delim}$", "", "r")> + + <#assign items = text?split(delim)> + + <#list items as item> + <#-- A FreeMarker loop variable cannot have its value modified, so we use a new variable. --> + <#assign newItem = item?trim> + + <#assign classVal = ""> + + <#-- Keep any class value already assigned --> + <#assign currentClass = newItem?matches("^
  • ]*(class=[\'\"](.*?)[\'\"])")> + <#list currentClass as m> + <#assign classVal = m?groups[2]> + <#assign newItem = newItem?replace(m?groups[1], "")> + + + <#-- Test indices, rather than comparing content, on the remote chance + that there are two list items with the same content. --> + <#-- <#if item == arr?first> --> + <#if item_index == 0> + <#assign classVal = "${classVal} first"> + + <#-- <#if item == arr?last> --> + <#if !item_has_next> + <#assign classVal = "${classVal} last"> + + + <#if classVal != ""> + <#assign classVal = classVal?replace("^ ", "", "r")> + <#-- Replace first instance only, in case the item contains nested li tags. --> + <#assign newItem = newItem?replace(" + + ${newItem} + + + +<#-----------------------------------------------------------------------------> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/page/default.ftl b/webapp/web/templates/freemarker/page/default.ftl new file mode 100644 index 000000000..9439704d3 --- /dev/null +++ b/webapp/web/templates/freemarker/page/default.ftl @@ -0,0 +1,32 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#include "/components/doctype.html"> + +<#include "/components/head.ftl"> + + +
    + + + + +
    +
    class="${contentClass}" > + ${body} +
    +
    + + <#include "/components/footer.ftl"> + +
    + +