From c0d24139dc7ee0db04a5970b75d72599ce3539d1 Mon Sep 17 00:00:00 2001 From: rjy7 Date: Fri, 29 Oct 2010 19:12:40 +0000 Subject: [PATCH] A new approach to widgets, that will allow them to be invoked directly from a page template, rather than a body template, but still add files to the template stylesheets and scripts objects. --- webapp/web/css/login.css | 2 +- webapp/web/templates/freemarker/body/home.ftl | 8 ++- .../templates/freemarker/page/page-home.ftl | 5 ++ .../freemarker/widgets/widget-login.ftl | 49 +++++++++++++++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 webapp/web/templates/freemarker/page/page-home.ftl create mode 100644 webapp/web/templates/freemarker/widgets/widget-login.ftl diff --git a/webapp/web/css/login.css b/webapp/web/css/login.css index 8c43c4fed..ff45f7884 100644 --- a/webapp/web/css/login.css +++ b/webapp/web/css/login.css @@ -8,7 +8,7 @@ text-align:left; } -.noOutterBox { +.noOuterBox { width:340px; padding:0px; border: none; diff --git a/webapp/web/templates/freemarker/body/home.ftl b/webapp/web/templates/freemarker/body/home.ftl index 4965d4a9e..538080d2d 100644 --- a/webapp/web/templates/freemarker/body/home.ftl +++ b/webapp/web/templates/freemarker/body/home.ftl @@ -1,5 +1,9 @@ <#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> -<#-- Template for home page body contents --> +<#-- Template for home page body contents. This file is deliberately empty, for use by themes that define a full +page template for the home page and do not use a separate body template. The HomePageController defines a +body template, for those themes that do not use a distinct page template for the home page, so that they +can provide the home page body content. The default empty template is defined so Freemarker doesn't throw an error +when it tries to get the template. (Or should we just let Freemarker log an error? It doesn't prevent the page +from displaying.) --> -

This is the Vitro home page.

\ No newline at end of file diff --git a/webapp/web/templates/freemarker/page/page-home.ftl b/webapp/web/templates/freemarker/page/page-home.ftl new file mode 100644 index 000000000..60e4b87bf --- /dev/null +++ b/webapp/web/templates/freemarker/page/page-home.ftl @@ -0,0 +1,5 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Page template for home page, for themes that do not use a home-page specific layout. --> + +<#include "page.ftl"> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/widgets/widget-login.ftl b/webapp/web/templates/freemarker/widgets/widget-login.ftl new file mode 100644 index 000000000..9a64d980d --- /dev/null +++ b/webapp/web/templates/freemarker/widgets/widget-login.ftl @@ -0,0 +1,49 @@ +<#-- $This file is distributed under the terms of the license in /doc/license.txt$ --> + +<#-- Login widget --> + +<#-- Question for Nick and Manolo: can we use this in Vitro, where html 5 is not being used, or should it be moved +to the wilma theme? Please do whatever's appropriate. --> + +<#macro styles> + <#if ! loginName??> + ${stylesheets.add("/css/login.css")} + + + +<#macro scripts> + <#if ! loginName??> + <#-- define any js files needed for the login widget --> + + + +<#macro markup> + <#if ! loginName??> +
+

Log in

+ +
+ +
+ +
+ +
+ +
+
+ +
+ + +
+
+

Forgot your password?

+
+ + +
+ +