Changes for page Macros

Last modified by Jip-jan Alunkel on April 15, 18:09

From version 2.327
edited by Jip-jan Alunkel
on August 31, 16:35
Change comment: Update document after refactoring.
To version 2.329
edited by Jip-jan Alunkel
on August 31, 20:21
Change comment: Update document after refactoring.

Summary

Details

Page properties
Content
... ... @@ -143,7 +143,7 @@
143 143   <p>
144 144   <label for="input${foreach.count}">$entry
145 145   <span class="input-wrap">
146 - <input type="text" class="form-control full" id="input${foreach.count}" placeholder="$services.localization.render('global.multiword.enter', ["${entry.toLowerCase()}"])" aria-invalid="false">
146 + <input type="text" class="form-control full" id="input${foreach.count}" placeholder="$services.localization.render('global.multiword.enter', ["${entry.toLowerCase()}"])" required="required">
147 147   </span>
148 148   </label>
149 149   </p>
... ... @@ -334,11 +334,11 @@
334 334   <div class="clearfix">
335 335   <p class="alert alert-warning alert-button-float-right">
336 336   <span class="alert-button pull-right">
337 -#if ($xcontext.user != 'XWiki.XWikiGuest')
337 + #if ($xcontext.user != 'XWiki.XWikiGuest')
338 338   <input type="submit" class="btn btn-primary" id="${O_submit.id}" name="${O_submit.id}" value="${O_submit.button-text}" />
339 -#else
339 + #else
340 340   <a data-toggle="modal" data-target="#displayLogin" href="#" class="btn btn-primary">$services.localization.render('login')</a>
341 -#end
341 + #end
342 342   </span>
343 343   <span class="alert-text">
344 344   ${O_submit.help-block}
... ... @@ -346,4 +346,21 @@
346 346   </p>
347 347   </div>
348 348  #end
349 +#macro(getUser)
350 + #set($user = '')
351 + #if($xcontext.getUser() != 'XWiki.XWikiGuest')
352 + #set($userDoc = $xwiki.getDocument($xcontext.getUser()))
353 + #set($userObj = $userDoc.getObject('XWiki.XWikiUsers'))
354 + #set($userLn = "$userObj.getValue('last_name')")
355 + #set($userFn = $userObj.getValue('first_name'))
356 + #set($glue = ", ")
357 + #if($userLn == "" || $userFn == "")
358 + #set($glue = "")
359 + #end
360 + #set($user = "$userLn${glue}$userFn")
361 + #if($user == "")
362 + #set($user = "$xcontext.getUser().split('\.')[1]${glue}noname")
363 + #end
364 + #end
365 +#end
349 349  {{/velocity}}