From af678112a3181f064e9cb8174ab3efca95969a88 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Sat, 21 Jan 2012 22:31:56 +0000 Subject: [PATCH] complete doc on template loading git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234427 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/site/apt/template-loading.apt | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/template-loading.apt b/archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/template-loading.apt index 462a1a698..f61527ca0 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/template-loading.apt +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/template-loading.apt @@ -28,7 +28,7 @@ Html/Javascript templates loading - Templates are loaded on application loaded and added in the hidden div #html-fragments. + Templates are loaded on application loaded and added in the hidden div <<#html-fragments>>. They are loaded using requirejs and the text plugin. @@ -50,4 +50,21 @@ require(["text!archiva/templates/menu.html","text!archiva/templates/topbar.html" ); +------------------------- - Note some templates which are only simple html which only need i18n are executed immediatly the others are only inserted in #html-fragments. \ No newline at end of file +* i18n in templates + +** static templates + + Some templates which are only simple html which only need i18n are executed immediatly. + + Simply use: + ++------------------------- + $.tmpl( menu, $.i18n.map ).appendTo("#html-fragments"); + to get i18n values in your template you can use + ${register} or ${$.i18n.prop('register')} ++------------------------- + + +** dynamic templates + + The others are only inserted in #html-fragments. \ No newline at end of file