Changes for page Per Status

From version 76.1
edited by Andrea Omicini
on 03/01/2023 00:02
Change comment: There is no comment for this version
To version 71.1
edited by Andrea Omicini
on 02/01/2023 16:29
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -81,26 +81,36 @@
81 81   #set( $statusList = [$statusPar] )
82 82   #end
83 83  #end
84 -$statusList
85 85  ##
86 -## query to structures
87 -#set( $pubMap = {} )
88 -#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 +##
89 89  #foreach( $status in $statusList )
90 -$status
91 91   #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2" )
92 92   #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'" )
93 93   #set( $sql = $from + " where " + $where )
94 94   #set( $pubFound = $xwiki.searchDocuments($sql) )
95 95   #set( $pubStatusNo = $pubFound.size() )
96 -$pubFound
97 -$pubFound.size()
98 98   #if( $pubStatusNo > 0 )
99 - #set( $pubMap[$status] = $pubFound )
100 - #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"]]
101 101   #end
102 102  #end
103 -$pubMap
104 -
105 -
106 106  {{/velocity}}