Changes for page Per Status
From version 98.1
edited by Andrea Omicini
on 25/06/2023 13:49
on 25/06/2023 13:49
Change comment:
There is no comment for this version
To 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
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,9 +1,18 @@ 1 1 {{velocity}} 2 -{{html clean="false" wiki="true"}} 3 -#template('apice_boolean.vm') 4 -## BIBTEX / START 2 +{{html wiki="true" clean="false"}} 3 +## GET PARAMETERS / START 4 +## inline display 5 +#set( $inlinePar = $request.inline.trim().toLowerCase() ) 5 5 ## show BibTeX 6 6 #set( $bibtexPar = $request.bibtex.trim().toLowerCase() ) 8 +## who 9 +#set( $userNamePar = $request.user.trim() ) 10 +#set( $firstNamePar = $request.name.trim() ) 11 +#set( $lastNamePar = $request.surname.trim() ) 12 +## GET PARAMETERS / END 13 +## 14 +#template('apice_boolean.vm') 15 +## HANDLE BIBTEX / START 7 7 ## default: false 8 8 #set( $showBibtex = false ) 9 9 ## check $bibtexPar ... ... @@ -10,11 +10,9 @@ 10 10 #if( $bibtexPar != "" && $trueStringList.contains($bibtexPar.toLowerCase()) ) 11 11 #set( $showBibtex = true ) 12 12 #end 13 -## BIBTEX / END 22 +## HANDLE BIBTEX / END 14 14 ## 15 -## INLINE / START 16 -## inline display 17 -#set( $inlinePar = $request.inline.trim().toLowerCase() ) 24 +## HANDLE INLINE / START 18 18 ## default: true 19 19 #set( $showInline = true ) 20 20 ## check $inlinePar ... ... @@ -21,11 +21,10 @@ 21 21 #if( $inlinePar != "" && $falseStringList.contains($inlinePar) ) 22 22 #set( $showInline = false ) 23 23 #end 24 -## INLINE / END 25 -#template('apice_publications.vm') 26 -#template('apice_user_param.vm') 31 +## HANDLE INLINE / END 27 27 ## 28 -## STATUS / START 33 +## HANDLE STATUS / START 34 +#template('apice_publications.vm') 29 29 ## $oneStatus false gets a list of statuses, true just one 30 30 #set( $oneStatus = false ) 31 31 #set( $showRejected = false ) ... ... @@ -51,9 +51,60 @@ 51 51 #set( $statusList = [$statusPar] ) 52 52 #end 53 53 ## 54 -## STATUS / END 60 +## HANDLE STATUS / END 61 +## HANDLE WHO / START 62 +#template('apice_macros.vm') 63 +#isuserspace() 64 +#if( $isUserSpace ) 65 + #userspace() 66 +## from a personal page 67 + #set( $apiceUser = true ) 68 + #set( $oneUser = true ) 69 +#elseif( $userNamePar ) 70 +## from the URL, "user=$userNamePar" parameter 71 + #if( $userNamePar.contains('XWiki.') ) 72 + #set( $userName = "$userNamePar" ) 73 + #else 74 + #set( $userName = "XWiki.$userNamePar" ) 75 + #end 76 + #if( !$xwiki.exists( $userName ) ) 77 + #if( $services.localization.currentLocale == 'it' ) 78 +{{warning}}L'utente “$userNamePar” non esiste{{/warning}} 79 + #else 80 +{{warning}}User “$userNamePar” does not exist{{/warning}} 81 + #end 82 + #stop 83 + #end 84 + #set( $apiceUser = true ) 85 + #set( $oneUser = true) 86 + #set( $userdoc = $xwiki.getDocument($userName) ) 87 + #set( $userFirstName = $userdoc.display("first_name") ) 88 + #set( $userLastName = $userdoc.display("last_name") ) 89 +#elseif( $firstNamePar && $lastNamePar ) 90 +## from the URL, "name=Firstname&surname=Lastname" parameter 91 + #set( $apiceUser = false ) 92 + #set( $oneUser = true ) 93 + #set( $userFirstName = $firstNamePar ) 94 + #set( $userLastName = $lastNamePar ) 95 +#else 96 + #set( $apiceUser = false ) 97 + #set( $oneUser = false ) 98 + #set( $userFirstName = "" ) 99 + #set( $userLastName = "" ) 100 +#end 101 +#if( $oneUser ) 102 + #if( $apiceUser ) 103 + #set( $userString = "%$userName%" ) 104 + #else 105 + #set( $userString = "%$userFirstName $userLastName%" ) 106 + #end 107 +#else 108 + #set( $userString = "%%" ) 109 +#end 110 +## HANDLE WHO / END 55 55 ## 56 -## DATA STRUCTURES / START 112 +### query to structures 113 +## map & counter initialisation 57 57 #set( $itemMap = {} ) 58 58 #set( $itemNo = 0 ) 59 59 ## cycle over statuses ... ... @@ -70,9 +70,8 @@ 70 70 #end 71 71 #end 72 72 #end 73 -## DATA STRUCTURES / END 74 74 ## 75 -## DISPLAY/ START131 +## output results 76 76 ## page subtitle 77 77 <div style="display: flex"> 78 78 <div class="mainheader"> ... ... @@ -108,11 +108,9 @@ 108 108 </div> 109 109 <div style="flex-grow: 1"> 110 110 </div> 111 - <div> 167 + <div"> 112 112 <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> 113 -#if( $showPublished ) 114 114 <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> 115 -#end 116 116 </div> 117 117 </div> 118 118 ## stop if no pubs are found ... ... @@ -165,7 +165,7 @@ 165 165 <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 166 166 #pubauthed($item)<br/> 167 167 #pubtitle($item)<br/> 168 - <span class="textsecondary">(#pubs ort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}222 + <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 169 169 </div> 170 170 #end 171 171 #end ... ... @@ -176,10 +176,9 @@ 176 176 ## status bottom / start 177 177 <div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 178 178 #set( $itemStatusNo = $itemMap[$status].size() ) 179 -$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end • #anchorlinks()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"]] 180 180 </div> 181 181 ## status bottom / end 182 182 #end 183 -## DISPLAY / END 184 184 {{/html}} 185 185 {{/velocity}}{{pageDisplay sort="objectservice"/}}