#if("$!request.get('count')" != '')
#set($numEntries = $xwiki.parseInt($request.get('count')))
#end
#if("$!numEntries" == '')
#set($numEntries = 50)
#end
#if("$!request.get('more')" == 'true')
#set($numEntries = $numEntries + 50)
#end
#set($defaultParams = "xpage=$!{request.get('xpage')}")
#set($defaultParams = "${defaultParams}&conf=$!{request.get('conf')}")
#set($defaultParams = "${defaultParams}&xredirect=$!{request.get('xredirect')}")
#set($defaultParams = "${defaultParams}&count=$!{numEntries}")
#set($diff = $request.get('diff'))
#if(!$diff)
#set($diff = "0")
#end
#set($hasSpaceRestriction = ("$!request.space" != ''))

 What's New##
#if($hasSpaceRestriction)
 in ${request.space}-Space
#end
 ($numEntries)
#set($params = "${defaultParams}&diff=$!{diff}&space=$!{doc.getSpace()}&more=true")

show 50 more
#if($hasSpaceRestriction)
#set($params = "${defaultParams}&diff=$!{diff}")

show all spaces
#else
#set($params = "${defaultParams}&diff=$!{diff}&space=$!{doc.getSpace()}")

show only $!{doc.getSpace()}-space
#end
#if($diff == "0")
#set($params = "${defaultParams}&space=$!{request.space}&diff=1")

show the changes

 </p
#end

The following documents have been recently created or modified:
#set ($list = $services.celementsweb.getLastChangedDocuments($numEntries , "$!{request.space}"))
#if(("$!list" != '' ) && ($list.size() > 0))

#if(!$hasSpaceRestriction)
 Space
#end
 Link Name
 doc lang
 last changed by
 last changed at

#set($oddEven = "even")
#foreach ($row in $list)
  #set($docFullName = '')
  #set($docLanguage = '')
  #foreach ($field in $row)
    #if ($velocityCount == 1)
      #set($docFullName = $field)
    #elseif ($velocityCount == 2)
      #set($docLanguage = $field)
    #end
  #end
#set($bentryDocRef = $services.model.resolveDocument(${docFullName}))
#if ($xwiki.hasAccessLevel("view", "${context.database}:${docFullName}"))
#set($defDoc = $xwiki.getDocument($bentryDocRef))
#if("$!docLanguage" != '')
#set($bentrydoc = $defDoc.getTranslatedDocument($docLanguage))
#else
#set($bentrydoc = $defDoc)
#set($docLanguage = $defDoc.defaultLanguage)
#end

#if("$!oddEven" == "even")
  #set($oddEven = "odd")
#else
  #set($oddEven = "even")
#end

#if(!$hasSpaceRestriction)
 ${bentrydoc.space}
#end
 $bentrydoc.name
 $docLanguage
 ${xwiki.getUserName($bentrydoc.author)}
 $xwiki.formatDate($bentrydoc.date,"MMMM dd, yyyy HH:mm:ss")
#if ($diff == "1")
 #set($deltas= $bentrydoc.getLastChanges())
#foreach($delta in $deltas)
#set($chunk = $delta.revised)
#if ($chunk.size()>0)

#if (($type == "source")||($type == "xml"))

$xwiki.renderChunk($chunk, true, $tdoc)

#else
$xwiki.renderChunk($chunk, $tdoc)
#end

#end
#set($chunk = $delta.original)
#if ($chunk.size()>0)

#if (($type == "source")||($type == "xml"))

$xwiki.renderChunk($chunk, true, $tdoc)

#else
$xwiki.renderChunk($chunk, $tdoc)
#end

#end
#end
#end  ## if diff == 1

#end  ## if hasAccessLevel
#end  ## foreach row in list

#else
No Changes found.
#end

