Changes for page Per Status
From version 94.2
edited by Andrea Omicini
on 22/06/2023 15:14
on 22/06/2023 15:14
Change comment:
There is no comment for this version
To version 99.1
edited by Andrea Omicini
on 03/07/2023 00:26
on 03/07/2023 00:26
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,18 +1,9 @@ 1 1 {{velocity}} 2 -{{html wiki="true" clean="false"}} 3 -## GET PARAMETERS / START 4 -## inline display 5 -#set( $inlinePar = $request.inline.trim().toLowerCase() ) 2 +{{html clean="false" wiki="true"}} 3 +#template('apice_boolean.vm') 4 +## BIBTEX / START 6 6 ## show BibTeX 7 7 #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 16 16 ## default: false 17 17 #set( $showBibtex = false ) 18 18 ## check $bibtexPar ... ... @@ -19,9 +19,11 @@ 19 19 #if( $bibtexPar != "" && $trueStringList.contains($bibtexPar.toLowerCase()) ) 20 20 #set( $showBibtex = true ) 21 21 #end 22 -## HANDLEBIBTEX / END13 +## BIBTEX / END 23 23 ## 24 -## HANDLE INLINE / START 15 +## INLINE / START 16 +## inline display 17 +#set( $inlinePar = $request.inline.trim().toLowerCase() ) 25 25 ## default: true 26 26 #set( $showInline = true ) 27 27 ## check $inlinePar ... ... @@ -28,12 +28,11 @@ 28 28 #if( $inlinePar != "" && $falseStringList.contains($inlinePar) ) 29 29 #set( $showInline = false ) 30 30 #end 31 -## HANDLE INLINE / END 32 -inline $showInline 33 -bibtext $showBibtex 34 -## 35 -## HANDLE STATUS / START 24 +## INLINE / END 36 36 #template('apice_publications.vm') 26 +#template('apice_user_param.vm') 27 +## 28 +## STATUS / START 37 37 ## $oneStatus false gets a list of statuses, true just one 38 38 #set( $oneStatus = false ) 39 39 #set( $showRejected = false ) ... ... @@ -59,60 +59,9 @@ 59 59 #set( $statusList = [$statusPar] ) 60 60 #end 61 61 ## 62 -## HANDLE STATUS / END 63 -## HANDLE WHO / START 64 -#template('apice_macros.vm') 65 -#isuserspace() 66 -#if( $isUserSpace ) 67 - #userspace() 68 -## from a personal page 69 - #set( $apiceUser = true ) 70 - #set( $oneUser = true ) 71 -#elseif( $userNamePar ) 72 -## from the URL, "user=$userNamePar" parameter 73 - #if( $userNamePar.contains('XWiki.') ) 74 - #set( $userName = "$userNamePar" ) 75 - #else 76 - #set( $userName = "XWiki.$userNamePar" ) 77 - #end 78 - #if( !$xwiki.exists( $userName ) ) 79 - #if( $services.localization.currentLocale == 'it' ) 80 -{{warning}}L'utente “$userNamePar” non esiste{{/warning}} 81 - #else 82 -{{warning}}User “$userNamePar” does not exist{{/warning}} 83 - #end 84 - #stop 85 - #end 86 - #set( $apiceUser = true ) 87 - #set( $oneUser = true) 88 - #set( $userdoc = $xwiki.getDocument($userName) ) 89 - #set( $userFirstName = $userdoc.display("first_name") ) 90 - #set( $userLastName = $userdoc.display("last_name") ) 91 -#elseif( $firstNamePar && $lastNamePar ) 92 -## from the URL, "name=Firstname&surname=Lastname" parameter 93 - #set( $apiceUser = false ) 94 - #set( $oneUser = true ) 95 - #set( $userFirstName = $firstNamePar ) 96 - #set( $userLastName = $lastNamePar ) 97 -#else 98 - #set( $apiceUser = false ) 99 - #set( $oneUser = false ) 100 - #set( $userFirstName = "" ) 101 - #set( $userLastName = "" ) 102 -#end 103 -#if( $oneUser ) 104 - #if( $apiceUser ) 105 - #set( $userString = "%$userName%" ) 106 - #else 107 - #set( $userString = "%$userFirstName $userLastName%" ) 108 - #end 109 -#else 110 - #set( $userString = "%%" ) 111 -#end 112 -## HANDLE WHO / END 54 +## STATUS / END 113 113 ## 114 -### query to structures 115 -## map & counter initialisation 56 +## DATA STRUCTURES / START 116 116 #set( $itemMap = {} ) 117 117 #set( $itemNo = 0 ) 118 118 ## cycle over statuses ... ... @@ -119,7 +119,7 @@ 119 119 #foreach( $status in $statusList ) 120 120 #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected ) 121 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" )63 + where obj.name = doc.fullName and obj.className = '${objectSpace}.Class' and obj.name <> '${objectPool}.Template' #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 123 #set( $itemFound = $xwiki.searchDocuments($query) ) 124 124 ## set counters 125 125 #set( $itemStatusNo = $itemFound.size() ) ... ... @@ -129,8 +129,9 @@ 129 129 #end 130 130 #end 131 131 #end 73 +## DATA STRUCTURES / END 132 132 ## 133 -## outputresults75 +## DISPLAY / START 134 134 ## page subtitle 135 135 <div style="display: flex"> 136 136 <div class="mainheader"> ... ... @@ -139,11 +139,11 @@ 139 139 #if( $itemNo == 1 ) 140 140 $services.localization.render('work').toLowerCase() 141 141 <span class="textsecondary"> / </span> 142 - $services.localization.render("${objectSpace}. ${objectClass}_status_${statusList[0]}").toLowerCase()84 + $services.localization.render("${objectSpace}.Class_status_${statusList[0]}").toLowerCase() 143 143 #else 144 144 $services.localization.render('works').toLowerCase() 145 145 <span class="textsecondary"> / </span> 146 - $services.localization.render("${objectSpace}. ${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end88 + $services.localization.render("${objectSpace}.Class_status_${statusList[0]}_plural").toLowerCase() #end 147 147 #else 148 148 #if( $itemNo == 1 ) 149 149 #if( $showPublished ) ... ... @@ -166,9 +166,11 @@ 166 166 </div> 167 167 <div style="flex-grow: 1"> 168 168 </div> 169 - <div ">111 + <div> 170 170 <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 ) 171 171 <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 172 172 </div> 173 173 </div> 174 174 ## stop if no pubs are found ... ... @@ -185,7 +185,7 @@ 185 185 #if( !$foreach.first ) 186 186  •  187 187 #end 188 - [[$services.localization.render("${objectSpace}. ${objectClass}_status_${status}_short_plural").toLowerCase()>>||anchor="$status"]]132 + [[$services.localization.render("${objectSpace}.Class_status_${status}_short_plural").toLowerCase()>>||anchor="$status"]] 189 189 #end 190 190 </div> 191 191 #end ... ... @@ -196,7 +196,7 @@ 196 196 ## status top / start 197 197 <div class="mainselectseparator"> 198 198 <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")> 199 - $services.localization.render("${objectSpace}. ${objectClass}_status_${status}_plural").toLowerCase()143 + $services.localization.render("${objectSpace}.Class_status_${status}_plural").toLowerCase() 200 200 </a> 201 201 </div> 202 202 ## status top / end ... ... @@ -221,7 +221,7 @@ 221 221 <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 222 222 #pubauthed($item)<br/> 223 223 #pubtitle($item)<br/> 224 - <span class="textsecondary">(#pubst atus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}168 + <span class="textsecondary">(#pubsort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 225 225 </div> 226 226 #end 227 227 #end ... ... @@ -232,9 +232,10 @@ 232 232 ## status bottom / start 233 233 <div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 234 234 #set( $itemStatusNo = $itemMap[$status].size() ) 235 -$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}. ${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end •[[{{stringEngItaeng='top' ita='incima'/}}>>||anchor="top"]] • [[{{stringEngIta eng='index' ita='indice'/}}>>||anchor="index"]] • [[{{stringEngIta eng='bottom' ita='in fondo'/}}>>||anchor="bottom"]]179 +$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.Class_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.Class_status_${status}_plural").toLowerCase()#end • #anchorlinks() 236 236 </div> 237 237 ## status bottom / end 238 238 #end 183 +## DISPLAY / END 239 239 {{/html}} 240 240 {{/velocity}}{{pageDisplay sort="objectservice"/}}