Changes for page Per Status

From version 91.1
edited by Andrea Omicini
on 22/06/2023 13:09
Change comment: There is no comment for this version
To version 96.4
edited by Andrea Omicini
on 22/06/2023 20:14
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -53,8 +53,8 @@
53 53   #set( $showRejected = true )
54 54  #elseif( $publicationStatuses.contains($statusPar) )
55 55  ## 'status' parameter is an admissible publication status value
56 - #set( $oneStatus = true )
57 - #set( $statusList = [$statusPar] )
56 + #set( $oneStatus = true )
57 + #set( $statusList = [$statusPar] )
58 58  #end
59 59  ##
60 60  ## HANDLE STATUS / END
... ... @@ -116,14 +116,15 @@
116 116  ## cycle over statuses
117 117  #foreach( $status in $statusList )
118 118   #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected )
119 - #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
120 - where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" )
121 - #set( $itemFound = $xwiki.searchDocuments($query) )
119 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
120 + where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" )
121 + #set( $itemFound = $xwiki.searchDocuments($query) )
122 122  ## set counters
123 - #set( $itemStatusNo = $itemFound.size() )
124 - #if( $itemStatusNo > 0 )
125 - #set( $itemMap[$status] = $itemFound )
126 - #set( $itemNo = $itemNo + $itemStatusNo )
123 + #set( $itemStatusNo = $itemFound.size() )
124 + #if( $itemStatusNo > 0 )
125 + #set( $itemMap[$status] = $itemFound )
126 + #set( $itemNo = $itemNo + $itemStatusNo )
127 + #end
127 127   #end
128 128  #end
129 129  ##
... ... @@ -134,14 +134,26 @@
134 134  $itemNo
135 135  #if( $oneStatus )
136 136   #if( $itemNo == 1 )
138 + $services.localization.render('work').toLowerCase()
139 + <span class="textsecondary">&ensp;/&ensp;</span>
137 137   $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase()
138 138   #else
139 -$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end
142 + $services.localization.render('works').toLowerCase()
143 + <span class="textsecondary">&ensp;/&ensp;</span>
144 + $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end
140 140  #else
141 141   #if( $itemNo == 1 )
142 - $services.localization.render('yetunpublished_singular').toLowerCase()
147 + #if( $showPublished )
148 + $services.localization.render('work').toLowerCase()
149 + #else
150 + $services.localization.render('yetunpublished_singular').toLowerCase()
151 + #end
143 143   #else
144 - $services.localization.render('yetunpublished').toLowerCase()
153 + #if( $showPublished )
154 + $services.localization.render('works').toLowerCase()
155 + #else
156 + $services.localization.render('yetunpublished').toLowerCase()
157 + #end
145 145   #end
146 146  #end
147 147  #if( $oneUser )
... ... @@ -151,9 +151,11 @@
151 151   </div>
152 152   <div style="flex-grow: 1">
153 153   </div>
154 - <div">
167 + <div>
155 155   <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )#if( $showInline )formatted#{else}plain#end#else#if( $showInline )long#{else}short#end#end</a>
169 +#if( $showPublished )
156 156   <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a>
171 +#end
157 157   </div>
158 158  </div>
159 159  ## stop if no pubs are found
... ... @@ -191,12 +191,11 @@
191 191   #if( $showInline && !$showBibtex )
192 192   <ul>
193 193   #foreach( $item in $itemMap[$status] )
194 - <li>#publinked($item)</li>
195 -## <li>#pubperstatus($item)</li>
209 + <li>#pubperstatus($item)</li>
196 196   #end
197 197   </ul>
198 198   #else
199 - #foreach( $item in $itemMap[$sort] )
213 + #foreach( $item in $itemMap[$status] )
200 200   #if( $showBibtex)
201 201   #if( $showInline )
202 202   ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}})))
... ... @@ -207,7 +207,7 @@
207 207   <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em">
208 208   #pubauthed($item)<br/>
209 209   #pubtitle($item)<br/>
210 - <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}
224 + <span class="textsecondary">(#pubsort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}
211 211   </div>
212 212   #end
213 213   #end