Skip to content

Commit

Permalink
XWIKI-22433: Provide consistency in info / warning / error class usag…
Browse files Browse the repository at this point in the history
…es in templates

* Part D
* Updated the internal velocimacro to also take into account equivalents to rarely used XWikiMacro parameters.
  • Loading branch information
Sereza7 committed Dec 9, 2024
1 parent 8d2d174 commit 161d3d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,11 @@
## Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
## 02110-1301 USA, or see the FSF site: http://www.fsf.org.
## ---------------------------------------------------------------------------
##!source.syntax=xwiki/2.1
{{velocity}}
#template('job/question/macros.vm')
{{html clean=false}}
#questionHeader()
{{/html}}
#set ($jobStatus = $job.status)
#set ($question = $jobStatus.question)
#define ($warningMessageContent)
{{html clean=false}}
<p>$escapetool.xml($services.localization.render("job.question.ExtensionBreakingQuestion.${job.type}.explanation"))</p>
#set ($url = $xwiki.getURL($services.model.createDocumentReference('', 'XWiki', 'XWikiPreferences'), 'admin', 'section=XWiki.Extensions&search=&repo=installed'))
#set ($link = '<a href="' + $url + '">')
Expand All @@ -43,14 +38,9 @@
</div>
</div>
#questionButtons($jobStatus)
{{/html}}#end
#end

## We want to use the XWiki macro here because we need its parameters
{{warning cssClass='deleteWarningExtensions' title='$escapetool.xml($services.localization.render("job.question.ExtensionBreakingQuestion.${job.type}.title"))'}}
$warningMessageContent
{{/warning}}
#_genericMessage("$warningMessageContent", 'warning', 'warning', 'warning', false, 'deleteWarningExtensions', $escapetool.xml($services.localization.render("job.question.ExtensionBreakingQuestion.${job.type}.title")))

{{html clean=false}}
#questionFooter()
{{/html}}
{{/velocity}}
Original file line number Diff line number Diff line change
Expand Up @@ -955,11 +955,13 @@ $html

### This velocity macro aims at providing an element similar to a XWiki Macro-Message in places where this XWikiMacro
### cannot be used.
#macro(_genericMessage $text $classAffix $iconName $prettyNameKey $isInline)
<#if($isInline)span#{else}div#end class="box ${classAffix}message">
#macro(_genericMessage $text $classAffix $iconName $prettyNameKey $isInline $extraClass $title)
<#if($isInline)span#{else}div#end class="box ${classAffix}message $!{extraClass}">
<span class="icon-block">$services.icon.renderHTML($iconName)</span>
<span class="sr-only">$services.localization.render($prettyNameKey)</span>
#if("$!title" != "")<div><div class="box-title">$!title</div>#end
<p>$text</p>
#if("$!title" != "")</div>#end
</#if($isInline)span#{else}div#end>
#end

Expand Down

0 comments on commit 161d3d0

Please sign in to comment.