Changes for page Per Status
From version 91.1
edited by Andrea Omicini
on 22/06/2023 13:09
on 22/06/2023 13:09
Change comment:
There is no comment for this version
To version 86.10
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 44 +#else 45 + #if( $publicationStatuses.contains($statusPar) ) 46 + ## 'status' parameter is an admissible publication status value 56 56 #set( $oneStatus = true ) 57 57 #set( $statusList = [$statusPar] ) 49 + #end 58 58 #end 59 59 ## 60 60 ## HANDLE STATUS / END ... ... @@ -113,9 +113,8 @@ 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 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 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 121 #set( $itemFound = $xwiki.searchDocuments($query) ) ... ... @@ -152,8 +152,8 @@ 152 152 <div style="flex-grow: 1"> 153 153 </div> 154 154 <div"> 155 - <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>156 - <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> 157 157 </div> 158 158 </div> 159 159 ## stop if no pubs are found ... ... @@ -163,63 +163,19 @@ 163 163 #end 164 164 ## some pubs found 165 165 ## page index 166 -#if( $ itemMap.keySet().size() > 1 )157 +#if( $pubMap.keySet().size() > 1 ) 167 167 ## found more than one status 168 -<div class="mainselectbar" id="index"> 169 - #foreach( $status in $itemMap.keySet() ) 170 - #if( !$foreach.first ) 171 -  •  172 - #end 173 - [[$services.localization.render("${objectSpace}.${objectClass}_status_${status}_short_plural").toLowerCase()>>||anchor="$status"]] 174 - #end 175 -</div> 159 +{{id name="index"/}} 160 +(% 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))) 176 176 #end 177 -## 178 -#template('apice_publication_macros.vm') 179 -## 180 -#foreach( $status in $itemMap.keySet() ) 181 -## status top / start 182 -<div class="mainselectseparator"> 183 - <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")> 184 - $services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase() 185 - </a> 186 -</div> 187 -## status top / end 188 -## 189 -## status display / start 190 -<div> 191 - #if( $showInline && !$showBibtex ) 192 - <ul> 193 - #foreach( $item in $itemMap[$status] ) 194 - <li>#publinked($item)</li> 195 -## <li>#pubperstatus($item)</li> 196 - #end 197 - </ul> 198 - #else 199 - #foreach( $item in $itemMap[$sort] ) 200 - #if( $showBibtex) 201 - #if( $showInline ) 202 - ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}}))) 203 - #else 204 - ((({{code language="bibtex"}}$xwiki.getDocument($item).getValue('bibtex'){{/code}}))) 205 - #end 206 - #else 207 - <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 208 - #pubauthed($item)<br/> 209 - #pubtitle($item)<br/> 210 - <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 211 - </div> 212 - #end 213 - #end 162 +## pubs displayed per year 163 +#foreach( $status in $pubMap.keySet() ) 164 +(% 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']] 165 + #foreach( $pub in $pubMap[$status] ) 166 +(% style="border-style:hidden hidden hidden hidden" %)|{{pub inline='false' linked='title'}}$pub{{/pub}} 214 214 #end 215 -</div> 216 -## status display / end 217 -## 218 -## status bottom / start 219 -<div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 220 - #set( $itemStatusNo = $itemMap[$status].size() ) 221 -$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"]] 222 -</div> 168 + #set( $pubStatusNo = $pubMap[$status].size() ) 169 +(% 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"]] 223 223 ## status bottom / end 224 224 #end 225 225 {{/html}}