Changes for page Per Status

From version 94.1
edited by Andrea Omicini
on 22/06/2023 15:13
Change comment: There is no comment for this version
To version 90.1
edited by Andrea Omicini
on 22/06/2023 13:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -29,8 +29,6 @@
29 29   #set( $showInline = false )
30 30  #end
31 31  ## HANDLE INLINE / END
32 -inline $showInline
33 -bibtext $showBibtex
34 34  ##
35 35  ## HANDLE STATUS / START
36 36  #template('apice_publications.vm')
... ... @@ -37,7 +37,6 @@
37 37  ## $oneStatus false gets a list of statuses, true just one
38 38  #set( $oneStatus = false )
39 39  #set( $showRejected = false )
40 -#set( $showPublished = false )
41 41  ## $statusList gets the list of statuses to be shown
42 42  #set( $statusList = $publicationStatuses )
43 43  ##
... ... @@ -45,18 +45,12 @@
45 45  #if( $statusPar.toLowerCase() == "all" )
46 46  ## 'all' value gets all unpublished papers including "Rejected" ones
47 47   #set( $showRejected = true )
48 -#elseif( $statusPar.toLowerCase() == "published" )
49 - #set( $oneStatus = true )
50 - #set( $statusList = ["published"] )
51 - #set( $showPublished = true )
52 -#elseif( $statusPar.toLowerCase() == "rejected" )
53 - #set( $oneStatus = true )
54 - #set( $statusList = ["rejected"] )
55 - #set( $showRejected = true )
56 -#elseif( $publicationStatuses.contains($statusPar) )
57 -## 'status' parameter is an admissible publication status value
58 - #set( $oneStatus = true )
59 - #set( $statusList = [$statusPar] )
45 +#else
46 + #if( $publicationStatuses.contains($statusPar) )
47 + ## 'status' parameter is an admissible publication status value
48 + #set( $oneStatus = true )
49 + #set( $statusList = [$statusPar] )
50 + #end
60 60  #end
61 61  ##
62 62  ## HANDLE STATUS / END
... ... @@ -117,18 +117,17 @@
117 117  #set( $itemNo = 0 )
118 118  ## cycle over statuses
119 119  #foreach( $status in $statusList )
120 - #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected )
121 - #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
122 - 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" )
123 - #set( $itemFound = $xwiki.searchDocuments($query) )
111 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end
112 + 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" )
113 + #set( $itemFound = $xwiki.searchDocuments($query) )
124 124  ## set counters
125 - #set( $itemStatusNo = $itemFound.size() )
126 - #if( $itemStatusNo > 0 )
127 - #set( $itemMap[$status] = $itemFound )
128 - #set( $itemNo = $itemNo + $itemStatusNo )
129 - #end
115 + #set( $itemStatusNo = $itemFound.size() )
116 + #if( $itemStatusNo > 0 )
117 + #set( $itemMap[$status] = $itemFound )
118 + #set( $itemNo = $itemNo + $itemStatusNo )
130 130   #end
131 131  #end
121 +$itemStatusNo
132 132  ##
133 133  ## output results
134 134  ## page subtitle
... ... @@ -137,26 +137,14 @@
137 137  $itemNo
138 138  #if( $oneStatus )
139 139   #if( $itemNo == 1 )
140 - $services.localization.render('work').toLowerCase()
141 - <span class="textsecondary">&ensp;/&ensp;</span>
142 142   $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase()
143 143   #else
144 - $services.localization.render('works').toLowerCase()
145 - <span class="textsecondary">&ensp;/&ensp;</span>
146 - $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end
132 +$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end
147 147  #else
148 148   #if( $itemNo == 1 )
149 - #if( $showPublished )
150 - $services.localization.render('work').toLowerCase()
151 - #else
152 - $services.localization.render('yetunpublished_singular').toLowerCase()
153 - #end
135 + $services.localization.render('yetunpublished_singular').toLowerCase()
154 154   #else
155 - #if( $showPublished )
156 - $services.localization.render('works').toLowerCase()
157 - #else
158 - $services.localization.render('yetunpublished').toLowerCase()
159 - #end
137 + $services.localization.render('yetunpublished').toLowerCase()
160 160   #end
161 161  #end
162 162  #if( $oneUser )
... ... @@ -206,7 +206,8 @@
206 206   #if( $showInline && !$showBibtex )
207 207   <ul>
208 208   #foreach( $item in $itemMap[$status] )
209 - <li>#pubperstatus($item)</li>
187 + <li>#publinked($item)</li>
188 +## <li>#pubperstatus($item)</li>
210 210   #end
211 211   </ul>
212 212   #else