Changes for page Per Status
From version 82.1
edited by Andrea Omicini
on 03/01/2023 00:13
on 03/01/2023 00:13
Change comment:
There is no comment for this version
To version 71.1
edited by Andrea Omicini
on 02/01/2023 16:29
on 02/01/2023 16:29
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -82,37 +82,35 @@ 82 82 #end 83 83 #end 84 84 ## 85 -## query to structures 86 -#set( $pubMap = {} ) 87 -#set( $pubNo = 0 ) 85 +{{id name="top"/}} 86 +#if( $oneUser )#if( $oneStatus ) 87 +>**{{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}}** / $userFirstName $userLastName 88 +#else 89 +>**{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}}** / $userFirstName $userLastName 90 +#end#elseif($oneStatus) 91 +>{{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}} 92 +#else 93 +>{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}} 94 +#end 95 +## 96 +#if( !$oneStatus ) 97 +(% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $status in $statusList )#if( $foreach.index > 0 ) | #end[[{{pubStatus}}$status{{/pubStatus}}>>||anchor=$status]]#end))) 98 +#end 99 +## 88 88 #foreach( $status in $statusList ) 89 89 #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2" ) 90 - #set( $where = "obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop0.name = 'author' and prop1.name = 'editor' and ( prop0.value like '$userString' or ( prop0.value = '' and prop1.value like '$userString' ) ) and prop2.name = 'status' and prop2.value = '$status'" ) 102 + #set( $where = "obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop0.name = 'author' and prop1.name = 'editor' and ( prop0.value like '$userString' or ( prop0.value = '' and prop1.value like '$userString' ) ) and prop2.name = 'status' and prop2.value = '$status'" ) 91 91 #set( $sql = $from + " where " + $where ) 92 92 #set( $pubFound = $xwiki.searchDocuments($sql) ) 93 93 #set( $pubStatusNo = $pubFound.size() ) 94 94 #if( $pubStatusNo > 0 ) 95 - #set( $pubMap[$status] = $pubFound ) 96 - #set( $pubNo = $pubNo + $pubStatusNo ) 107 + #if( !$oneStatus ) 108 +(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$sort'/}}{{pubStatus plural='true' uppercase='true'}}$status{{/pubStatus}}{{id name="$status"/}} 109 + #end 110 + #foreach( $pub in $pubFound )#if( $xwiki.exists($pub) )#set( $pubDoc = $xwiki.getDocument($pub) )#if( $pubDoc.getObject("${objectSpace}.${objectClass}") )## handling visibility at show time 111 +|{{pub inline='false' linked='title'}}$pub{{/pub}} 112 + #end#end#end 113 +(% style="#if( !$oneStatus )border-style:hidden solid solid hidden;#end border-color:$theme.borderColor; text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:gray" %)|($pubStatusNo #if( $pubStatusNo > 1 ){{pubStatus plural='true'}}$status{{/pubStatus}}#else{{pubStatus plural='false'}}$status{{/pubStatus}}#end) [[[top]>>||anchor="top"]] 97 97 #end 98 98 #end 99 -$pubMap 100 -## output results 101 -## page subtitle 102 -{{id name="top"/}} 103 ->(%%)$pubNo #if( $pubNo == 1 ){{stringEngIta eng="$objectEngSingular.toLowerCase()" ita="$objectItaSingular.toLowerCase()"/}}#{else}{{stringEngIta eng="$objectEngPlural.toLowerCase()" ita="$objectItaPlural.toLowerCase()"/}}#{end} / #if( $oneStatus ){{pubStatus uppercase='true' plural='true'}}$statusPar{{/pubStatus}}#{else}{{pubStatus uppercase='true' plural='true'}}unpublished{{/pubStatus}}#{end}#if( $oneUser ) / $userFirstName $userLastName#{end}(%%) 104 -## stop if no pubs are found 105 -#if( $pubNo == 0 || $pubMap.keySet().size() == 0 ) 106 -## redundant double check 107 - #stop 108 -#end 109 -## some pubs found 110 -## page index 111 -#if( $pubMap.keySet().size() > 1 ) 112 -## found more than one status 113 -{{id name="index"/}} 114 -(% style="font-size:smaller; text-align:right; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $status in $pubMap.keySet() )#if( !$foreach.first ) | #end[[{{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}>>||anchor="$status"]]#end))) 115 -#end 116 - 117 - 118 118 {{/velocity}}