Changes for page Per Status

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

Summary

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,12 @@
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
32 +inline $showInline
33 +bibtext $showBibtex
27 27  ##
28 -## STATUS / START
35 +## HANDLE STATUS / START
36 +#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
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
55 55  ##
56 -## DATA STRUCTURES / START
114 +### query to structures
115 +## 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 / START
133 +## 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>
169 + <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
... ... @@ -154,7 +154,7 @@
154 154   #end
155 155   </ul>
156 156   #else
157 - #foreach( $item in $itemMap[$status] )
213 + #foreach( $item in $itemMap[$sort] )
158 158   #if( $showBibtex)
159 159   #if( $showInline )
160 160   ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}})))
... ... @@ -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">(#pubsort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}
224 + <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}
169 169   </div>
170 170   #end
171 171   #end
... ... @@ -180,6 +180,5 @@
180 180  </div>
181 181  ## status bottom / end
182 182  #end
183 -## DISPLAY / END
184 184  {{/html}}
185 185  {{/velocity}}{{pageDisplay sort="objectservice"/}}