From 781f3d042f6565cfa4514c06f877ad087e12dce2 Mon Sep 17 00:00:00 2001 From: mb863 Date: Fri, 21 Jan 2011 03:20:01 +0000 Subject: [PATCH] NIHVIVO-1315: Refactoring individual.ftl. This was duplicated in VIVO and VITRO. --- .../body/individual/individual-vitro.ftl | 77 +++++++++++++++++++ .../freemarker/body/individual/individual.ftl | 68 +--------------- .../individual/individual-properties.ftl | 2 +- .../partials/individual/lib-properties.ftl | 18 ++--- 4 files changed, 88 insertions(+), 77 deletions(-) create mode 100644 webapp/web/templates/freemarker/body/individual/individual-vitro.ftl diff --git a/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl new file mode 100644 index 000000000..3afb92c07 --- /dev/null +++ b/webapp/web/templates/freemarker/body/individual/individual-vitro.ftl @@ -0,0 +1,77 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Default individual profile page template --> + +
+ + <#-- Image --> + <@p.imageLinks individual propertyGroups editable /> + + +
+ <#if individual.showAdminPanel> + <#include "individual-adminPanel.ftl"> + + +
+ <#if relatedSubject??> +

${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}

+

← return to ${relatedSubject.name}

+ <#else> +

+ <#-- Label --> + <#assign label = individual.nameStatement> + ${label.value} + <#-- <@p.editingLinks label label editable /> --> + + <#-- Moniker --> + <#if individual.moniker?has_content> + ${individual.moniker} + +

+ +
+ + + + <#-- Links --> + <@p.vitroLinks propertyGroups editable /> + + <#if individualProductExtension??> + ${individualProductExtension} + <#else> +
+
+ + +<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> + +<#-- Property group menu --> +<#include "individual-propertyGroupMenu.ftl"> + +<#-- Ontology properties --> +<#include "individual-properties.ftl"> + +${stylesheets.add("/css/individual/individual.css")} + +<#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) --> +${headScripts.add("/js/jquery_plugins/getURLParam.js", + "/js/jquery_plugins/colorAnimations.js", + "/js/jquery_plugins/jquery.form.js", + "/js/tiny_mce/tiny_mce.js", + "/js/controls.js", + "/js/toggle.js")} + +${scripts.add("/js/imageUpload/imageUploadUtils.js")} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/individual/individual.ftl b/webapp/web/templates/freemarker/body/individual/individual.ftl index 7190a73a1..09f3eb4d8 100644 --- a/webapp/web/templates/freemarker/body/individual/individual.ftl +++ b/webapp/web/templates/freemarker/body/individual/individual.ftl @@ -1,72 +1,6 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> <#-- Default individual profile page template --> - <#include "individual-setup.ftl"> -<#if individual.showAdminPanel> - <#include "individual-adminPanel.ftl"> - - -
-
- <#-- Image --> - <@p.imageLinks individual propertyGroups editable /> -
- -
-
- <#if relatedSubject??> -

${relatedSubject.relatingPredicateDomainPublic} for ${relatedSubject.name}

-

← return to ${relatedSubject.name}

- <#else> -

- <#-- Label --> - <#assign label = individual.nameStatement> - ${label.value} - <@p.editingLinks label label editable /> - - <#-- Moniker --> - <#if individual.moniker?has_content> - ${individual.moniker} - -

- -
- - - - <#-- Links --> - <@p.vitroLinks propertyGroups editable /> -
-
- -<#assign nameForOtherGroup = "other"> <#-- used by both individual-propertyGroupMenu.ftl and individual-properties.ftl --> - -<#-- Property group menu --> -<#include "individual-propertyGroupMenu.ftl"> - -<#-- Ontology properties --> -<#include "individual-properties.ftl"> - -${stylesheets.add("/css/individual/individual.css")} - -<#-- RY Figure out which of these scripts really need to go into the head, and which are needed at all (e.g., tinyMCE??) --> -${headScripts.add("/js/jquery_plugins/getURLParam.js", - "/js/jquery_plugins/colorAnimations.js", - "/js/jquery_plugins/jquery.form.js", - "/js/tiny_mce/tiny_mce.js", - "/js/controls.js", - "/js/toggle.js")} - -${scripts.add("/js/imageUpload/imageUploadUtils.js")} \ No newline at end of file +<#include "individual-vitro.ftl"> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl index 05c4aa67b..28ec2732a 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/individual-properties.ftl @@ -10,7 +10,7 @@
diff --git a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl index ba399bbc5..87ffeb820 100644 --- a/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl +++ b/webapp/web/templates/freemarker/body/partials/individual/lib-properties.ftl @@ -38,7 +38,7 @@ name will be used as the label. --> <#macro addLinkWithLabel property editable label="${property.name?capitalize}"> <#local addLink><@addLink property editable /> <#if addLink?has_content> -

${label} ${addLink}

+

${label} ${addLink}

@@ -46,7 +46,7 @@ name will be used as the label. --> <#if editable> <#local url = property.addUrl> <#if url?has_content> - add + add @@ -68,14 +68,14 @@ name will be used as the label. --> <#macro editLink property statement> <#local url = statement.editUrl> <#if url?has_content> - edit + edit <#macro deleteLink property statement> <#local url = statement.deleteUrl> <#if url?has_content> - delete + delete @@ -117,13 +117,13 @@ name will be used as the label. --> <#assign thumbUrl = individual.thumbUrl!> <#-- Don't assume that if the mainImage property is populated, there is a thumbnail image (though that is the general case). If there's a mainImage statement but no thumbnail image, treat it as if there is no image. --> - <#if (mainImage.statements)?has_content && thumbUrl?has_content> - ${individual.name} - <@p.editingLinks mainImage mainImage.statements[0] showEditLinks /> + <#if (mainImage.statements)?has_content && thumbUrl?has_content> + + ${individual.name} <#else> <@p.addLinkWithLabel mainImage showEditLinks "Photo" /> <#if placeholderImage?has_content> - placeholder image - + placeholder image + \ No newline at end of file