On 01/29/2010 10:04 PM, vmassol (SVN) wrote:
Author: vmassol
Date: 2010-01-29 22:04:01 +0100 (Fri, 29 Jan 2010)
New Revision: 26554
Modified:
platform/web/trunk/standard/src/main/webapp/templates/copy.vm
Log:
XWIKI-4817: Allow to copy a document's default language + all translations in the
copy menu action
* Template part
Modified: platform/web/trunk/standard/src/main/webapp/templates/copy.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/copy.vm 2010-01-29 19:58:17 UTC
(rev 26553)
+++ platform/web/trunk/standard/src/main/webapp/templates/copy.vm 2010-01-29 21:04:01 UTC
(rev 26554)
@@ -19,7 +19,7 @@
<div
id="document-title"><h1>$msg.get('core.copy.copydoc')</h1></div>
#set($sourcedoc = "$!{request.sourcedoc}")
#set($targetdoc = "$!{request.targetdoc}")
- #if("$!request.language" != "")
That's wrong, fragile. Localized messages should not be used as select
values.
<option
value="ALL">$msg.get('core.copy.allTranslations')</option>
+
"$!{request.language}" != 'ALL'
> + #if("$!request.language" != ""&&
"$!request.language" != $msg.get("core.copy.allTranslations"))
> #set($language = $request.language)
> #end
> #set($sourcewiki = $context.database)
> @@ -48,8 +48,11 @@
> <td>$msg.get("language"):</td>
> <td>
> <select name="language">
> + ## Add a special "All Translations" combo box entry to copy all
translations.
> +<option
selected="selected">$msg.get("core.copy.allTranslations")</option>
> + ## Add all the existing translations
> #foreach ($docTranslation in $docTranslations)
> -<option #if($docTranslation ==
"$!{context.language}")selected="selected"#end>$docTranslation</option>
> +<option>$docTranslation</option>
> #end
> </select>