Skip to content

Commit 3bf6de0

Browse files
Sereza7michitux
authored andcommitted
XWIKI-15198: Skin logo doesn't change with the new Color Theme (#3281)
* Added a translation to contain the warning for users. * Added this warning * Replaced the wiki syntax with HTML syntax for the creation of the DL. Note that now when there's no property, the DL is still generated, but I verified that it's invisible both visually and semantically * Added wiki escaping before the HTML escaping since we support wiki syntax in this HTML macro now. (cherry picked from commit c3f7e05)
1 parent 3f1e1cd commit 3bf6de0

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-ui/src/main/resources/SkinsCode/Translations.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<hidden>true</hidden>
3939
<content>skin.sheet.title=Skin
4040
skin.sheet.properties=Skin Properties
41+
skin.sheet.properties.logo.warning=This logo is usually overridden by the one defined in the color theme. If you want to change the wiki logo, consider editing the current color theme instead.
4142
skin.sheet.deprecatedProperties=Deprecated properties
4243
skin.sheet.overriddenTemplates=Overridden templates
4344
skin.sheet.addTemplate=Add a new overriding template

xwiki-platform-core/xwiki-platform-skin/xwiki-platform-skin-ui/src/main/resources/SkinsCode/XWikiSkinsSheet.xml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,34 @@
7878
#set ($deprecatedProperties = [])
7979
#set ($className = 'XWiki.XWikiSkins')
8080
#set ($class = $doc.getObject($className).xWikiClass)
81+
{{html wiki='true'}}
82+
&lt;dl&gt;
8183
#foreach ($prop in $class.properties)
8284
#if ($prop.classType != 'TextArea')
83-
; {{html}}&lt;label for="${className}_$escapetool.xml($doc.getObject($className).getNumber())_$escapetool.xml($prop.name)"&gt;$escapetool.xml($prop.prettyName)&lt;/label&gt;{{/html}}
84-
: #if($prop.name == 'logo')## Avoid line break
85-
{{attachmentSelector classname="${className}" property="${services.rendering.escape($prop.name, 'xwiki/2.1')}" filter="png,jpg,gif,svg" displayImage="true"/}}## Avoid line break
86-
#else$doc.display($prop.name)#end
85+
&lt;dt&gt;
86+
&lt;label for="${className}_$escapetool.xml($services.rendering.escape($doc.getObject($className).getNumber(), 'xwiki/2.1'))_$escapetool.xml($services.rendering.escape($prop.name, 'xwiki/2.1'))"&gt;
87+
$escapetool.xml($services.rendering.escape($prop.prettyName, 'xwiki/2.1'))
88+
&lt;/label&gt;
89+
&lt;/dt&gt;
90+
&lt;dd&gt;
91+
#if($prop.name == 'logo')
92+
93+
{{warning}}
94+
{{translation key="skin.sheet.properties.logo.warning" /}}
95+
{{/warning}}
96+
97+
{{attachmentSelector classname="${className}" property="${services.rendering.escape($prop.name, 'xwiki/2.1')}" filter="png,jpg,gif,svg" displayImage="true"/}}
98+
#else
99+
$doc.display($prop.name)
100+
#end
101+
&lt;/dd&gt;
87102

88103
#else
89104
#set($discard = $deprecatedProperties.add($prop))
90105
#end
91106
#end
107+
&lt;/dl&gt;
108+
{{/html}}
92109
(% id="overrideSection" %)
93110
(((
94111
== {{translation key="skin.sheet.overriddenTemplates" /}} ==

0 commit comments

Comments
 (0)