Changes for page Per Status
From version 95.1
edited by Andrea Omicini
on 22/06/2023 15:15
on 22/06/2023 15:15
Change comment:
There is no comment for this version
To version 86.9
edited by Andrea Omicini
on 22/06/2023 12:52
on 22/06/2023 12:52
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -31,11 +31,9 @@ 31 31 ## HANDLE INLINE / END 32 32 ## 33 33 ## HANDLE STATUS / START 34 -#template('apice_publications.vm') 35 35 ## $oneStatus false gets a list of statuses, true just one 36 36 #set( $oneStatus = false ) 37 37 #set( $showRejected = false ) 38 -#set( $showPublished = false ) 39 39 ## $statusList gets the list of statuses to be shown 40 40 #set( $statusList = $publicationStatuses ) 41 41 ## ... ... @@ -43,18 +43,12 @@ 43 43 #if( $statusPar.toLowerCase() == "all" ) 44 44 ## 'all' value gets all unpublished papers including "Rejected" ones 45 45 #set( $showRejected = true ) 46 -#elseif( $statusPar.toLowerCase() == "published" ) 47 - #set( $oneStatus = true ) 48 - #set( $statusList = ["published"] ) 49 - #set( $showPublished = true ) 50 -#elseif( $statusPar.toLowerCase() == "rejected" ) 51 - #set( $oneStatus = true ) 52 - #set( $statusList = ["rejected"] ) 53 - #set( $showRejected = true ) 54 -#elseif( $publicationStatuses.contains($statusPar) ) 55 -## 'status' parameter is an admissible publication status value 56 - #set( $oneStatus = true ) 57 - #set( $statusList = [$statusPar] ) 44 +#else 45 + #if( $publicationStatuses.contains($statusPar) ) 46 + ## 'status' parameter is an admissible publication status value 47 + #set( $oneStatus = true ) 48 + #set( $statusList = [$statusPar] ) 49 + #end 58 58 #end 59 59 ## 60 60 ## HANDLE STATUS / END ... ... @@ -113,18 +113,16 @@ 113 113 ## map & counter initialisation 114 114 #set( $itemMap = {} ) 115 115 #set( $itemNo = 0 ) 116 -## cycle over st atuses108 +## cycle over sorts 117 117 #foreach( $status in $statusList ) 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) ) 110 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end 111 + 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" ) 112 + #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 ) 127 - #end 114 + #set( $itemStatusNo = $itemFound.size() ) 115 + #if( $itemStatusNo > 0 ) 116 + #set( $itemMap[$status] = $itemFound ) 117 + #set( $itemNo = $itemNo + $itemStatusNo ) 128 128 #end 129 129 #end 130 130 ## ... ... @@ -135,26 +135,14 @@ 135 135 $itemNo 136 136 #if( $oneStatus ) 137 137 #if( $itemNo == 1 ) 138 - $services.localization.render('work').toLowerCase() 139 - <span class="textsecondary"> / </span> 140 140 $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase() 141 141 #else 142 - $services.localization.render('works').toLowerCase() 143 - <span class="textsecondary"> / </span> 144 - $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 130 +$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 145 145 #else 146 146 #if( $itemNo == 1 ) 147 - #if( $showPublished ) 148 - $services.localization.render('work').toLowerCase() 149 - #else 150 - $services.localization.render('yetunpublished_singular').toLowerCase() 151 - #end 133 + $services.localization.render('yetunpublished_singular').toLowerCase() 152 152 #else 153 - #if( $showPublished ) 154 - $services.localization.render('works').toLowerCase() 155 - #else 156 - $services.localization.render('yetunpublished').toLowerCase() 157 - #end 135 + $services.localization.render('yetunpublished').toLowerCase() 158 158 #end 159 159 #end 160 160 #if( $oneUser ) ... ... @@ -165,73 +165,34 @@ 165 165 <div style="flex-grow: 1"> 166 166 </div> 167 167 <div"> 168 - <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneSt atus)&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 - <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneSt atus)&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a>146 + <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneSort )&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> 147 + <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneSort )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a> 170 170 </div> 171 171 </div> 150 + 151 + 152 +{{id name="top"/}} 153 +>(%%)$pubNo #if( $pubNo == 1 ){{stringEngIta eng="$objectEngSingular.toLowerCase()" ita="$objectItaSingular.toLowerCase()"/}}#{else}{{stringEngIta eng="$objectEngPlural.toLowerCase()" ita="$objectItaPlural.toLowerCase()"/}}#{end} / #if( $oneStatus ){{pubStatus uppercase='false' plural='true'}}$statusPar{{/pubStatus}}#{else}{{pubStatus uppercase='false' plural='true'}}unpublished{{/pubStatus}}#{end}#if( $oneUser ) / $userFirstName $userLastName#{end}(%%) 172 172 ## stop if no pubs are found 173 -#if( $ itemNo == 0 || $itemMap.keySet().size() == 0 )155 +#if( $pubNo == 0 || $pubMap.keySet().size() == 0 ) 174 174 ## redundant double check 175 175 #stop 176 176 #end 177 177 ## some pubs found 178 178 ## page index 179 -#if( $ itemMap.keySet().size() > 1 )161 +#if( $pubMap.keySet().size() > 1 ) 180 180 ## found more than one status 181 -<div class="mainselectbar" id="index"> 182 - #foreach( $status in $itemMap.keySet() ) 183 - #if( !$foreach.first ) 184 -  •  185 - #end 186 - [[$services.localization.render("${objectSpace}.${objectClass}_status_${status}_short_plural").toLowerCase()>>||anchor="$status"]] 187 - #end 188 -</div> 163 +{{id name="index"/}} 164 +(% 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))) 189 189 #end 190 -## 191 -#template('apice_publication_macros.vm') 192 -## 193 -#foreach( $status in $itemMap.keySet() ) 194 -## status top / start 195 -<div class="mainselectseparator"> 196 - <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")> 197 - $services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase() 198 - </a> 199 -</div> 200 -## status top / end 201 -## 202 -## status display / start 203 -<div> 204 - #if( $showInline && !$showBibtex ) 205 - <ul> 206 - #foreach( $item in $itemMap[$status] ) 207 - <li>#pubperstatus($item)</li> 208 - #end 209 - </ul> 210 - #else 211 - #foreach( $item in $itemMap[$status] ) 212 - #if( $showBibtex) 213 - #if( $showInline ) 214 - ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}}))) 215 - #else 216 - ((({{code language="bibtex"}}$xwiki.getDocument($item).getValue('bibtex'){{/code}}))) 217 - #end 218 - #else 219 - <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 220 - #pubauthed($item)<br/> 221 - #pubtitle($item)<br/> 222 - <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 223 - </div> 224 - #end 225 - #end 166 +## pubs displayed per year 167 +#foreach( $status in $pubMap.keySet() ) 168 +(% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$status'/}}[[{{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}>>$doc.name||queryString='status=$status#if( $oneUser )#if( $apiceUser )&user=$userName#{else}&name=$userFirstName&surname=$userLastName#end#end']] 169 + #foreach( $pub in $pubMap[$status] ) 170 +(% style="border-style:hidden hidden hidden hidden" %)|{{pub inline='false' linked='title'}}$pub{{/pub}} 226 226 #end 227 -</div> 228 -## status display / end 229 -## 230 -## status bottom / start 231 -<div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 232 - #set( $itemStatusNo = $itemMap[$status].size() ) 233 -$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end • [[{{stringEngIta eng='top' ita='in cima'/}}>>||anchor="top"]] • [[{{stringEngIta eng='index' ita='indice'/}}>>||anchor="index"]] • [[{{stringEngIta eng='bottom' ita='in fondo'/}}>>||anchor="bottom"]] 234 -</div> 172 + #set( $pubStatusNo = $pubMap[$status].size() ) 173 +(% style="border-style:hidden solid solid hidden; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-size:smaller" %)|($pubStatusNo #if( $pubStatusNo == 1 ){{stringEngIta eng='publication' ita='pubblicazione'/}} {{pubStatus uppercase='false' plural='false'}}$status{{/pubStatus}}#{else}{{stringEngIta eng='publications' ita='pubblicazioni'/}} {{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}#end) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]] 235 235 ## status bottom / end 236 236 #end 237 237 {{/html}}