Codice sorgente Wiki di Per stato
author | version | line-number | content |
---|---|---|---|
86.6 | 1 | {{velocity}} | |
97.1 | 2 | {{html clean="false" wiki="true"}} | |
100.1 | 3 | #template('apice_macros.vm') | |
4 | #setobjectspace("Publications") | ||
97.1 | 5 | ## BIBTEX / START | |
86.6 | 6 | ## show BibTeX | |
7 | #set( $bibtexPar = $request.bibtex.trim().toLowerCase() ) | ||
8 | ## default: false | ||
9 | #set( $showBibtex = false ) | ||
10 | ## check $bibtexPar | ||
11 | #if( $bibtexPar != "" && $trueStringList.contains($bibtexPar.toLowerCase()) ) | ||
12 | #set( $showBibtex = true ) | ||
13 | #end | ||
97.1 | 14 | ## BIBTEX / END | |
86.6 | 15 | ## | |
97.1 | 16 | ## INLINE / START | |
17 | ## inline display | ||
18 | #set( $inlinePar = $request.inline.trim().toLowerCase() ) | ||
86.6 | 19 | ## default: true | |
20 | #set( $showInline = true ) | ||
21 | ## check $inlinePar | ||
22 | #if( $inlinePar != "" && $falseStringList.contains($inlinePar) ) | ||
23 | #set( $showInline = false ) | ||
24 | #end | ||
97.1 | 25 | ## INLINE / END | |
26 | #template('apice_user_param.vm') | ||
86.6 | 27 | ## | |
97.1 | 28 | ## STATUS / START | |
86.6 | 29 | ## $oneStatus false gets a list of statuses, true just one | |
30 | #set( $oneStatus = false ) | ||
31 | #set( $showRejected = false ) | ||
91.1 | 32 | #set( $showPublished = false ) | |
86.6 | 33 | ## $statusList gets the list of statuses to be shown | |
34 | #set( $statusList = $publicationStatuses ) | ||
35 | ## | ||
69.2 | 36 | #set( $statusPar = $request.status.trim() ) | |
86.6 | 37 | #if( $statusPar.toLowerCase() == "all" ) | |
38 | ## 'all' value gets all unpublished papers including "Rejected" ones | ||
39 | #set( $showRejected = true ) | ||
91.1 | 40 | #elseif( $statusPar.toLowerCase() == "published" ) | |
41 | #set( $oneStatus = true ) | ||
42 | #set( $statusList = ["published"] ) | ||
43 | #set( $showPublished = true ) | ||
44 | #elseif( $statusPar.toLowerCase() == "rejected" ) | ||
45 | #set( $oneStatus = true ) | ||
46 | #set( $statusList = ["rejected"] ) | ||
47 | #set( $showRejected = true ) | ||
48 | #elseif( $publicationStatuses.contains($statusPar) ) | ||
49 | ## 'status' parameter is an admissible publication status value | ||
92.1 | 50 | #set( $oneStatus = true ) | |
51 | #set( $statusList = [$statusPar] ) | ||
86.6 | 52 | #end | |
6.2 | 53 | ## | |
97.1 | 54 | ## STATUS / END | |
6.2 | 55 | ## | |
97.1 | 56 | ## DATA STRUCTURES / START | |
86.6 | 57 | #set( $itemMap = {} ) | |
58 | #set( $itemNo = 0 ) | ||
88.1 | 59 | ## cycle over statuses | |
61.1 | 60 | #foreach( $status in $statusList ) | |
91.1 | 61 | #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected ) | |
92.1 | 62 | #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end | |
101.1 | 63 | where obj.name = doc.fullName and obj.className = '${mainSpace}.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" ) | |
92.1 | 64 | #set( $itemFound = $xwiki.searchDocuments($query) ) | |
86.8 | 65 | ## set counters | |
92.1 | 66 | #set( $itemStatusNo = $itemFound.size() ) | |
67 | #if( $itemStatusNo > 0 ) | ||
68 | #set( $itemMap[$status] = $itemFound ) | ||
69 | #set( $itemNo = $itemNo + $itemStatusNo ) | ||
70 | #end | ||
61.1 | 71 | #end | |
6.14 | 72 | #end | |
97.1 | 73 | ## DATA STRUCTURES / END | |
86.8 | 74 | ## | |
97.1 | 75 | ## DISPLAY / START | |
77.1 | 76 | ## page subtitle | |
86.9 | 77 | <div style="display: flex"> | |
78 | <div class="mainheader"> | ||
79 | $itemNo | ||
80 | #if( $oneStatus ) | ||
81 | #if( $itemNo == 1 ) | ||
93.1 | 82 | $services.localization.render('work').toLowerCase() | |
83 | <span class="textsecondary"> / </span> | ||
101.2 | 84 | $services.localization.render("${mainSpace}.Class_status_${statusList[0]}").toLowerCase() | |
86.9 | 85 | #else | |
93.1 | 86 | $services.localization.render('works').toLowerCase() | |
87 | <span class="textsecondary"> / </span> | ||
101.2 | 88 | $services.localization.render("${mainSpace}.Class_status_${statusList[0]}_plural").toLowerCase() #end | |
86.9 | 89 | #else | |
90 | #if( $itemNo == 1 ) | ||
93.1 | 91 | #if( $showPublished ) | |
92 | $services.localization.render('work').toLowerCase() | ||
93 | #else | ||
94 | $services.localization.render('yetunpublished_singular').toLowerCase() | ||
95 | #end | ||
86.9 | 96 | #else | |
93.1 | 97 | #if( $showPublished ) | |
98 | $services.localization.render('works').toLowerCase() | ||
99 | #else | ||
100 | $services.localization.render('yetunpublished').toLowerCase() | ||
101 | #end | ||
86.9 | 102 | #end | |
103 | #end | ||
104 | #if( $oneUser ) | ||
105 | <span class="textsecondary"> / </span> | ||
106 | $userFirstName $userLastName | ||
107 | #end | ||
108 | </div> | ||
109 | <div style="flex-grow: 1"> | ||
110 | </div> | ||
96.1 | 111 | <div> | |
88.1 | 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> | |
96.4 | 113 | #if( $showPublished ) | |
88.1 | 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> | |
96.4 | 115 | #end | |
86.9 | 116 | </div> | |
117 | </div> | ||
77.1 | 118 | ## stop if no pubs are found | |
86.10 | 119 | #if( $itemNo == 0 || $itemMap.keySet().size() == 0 ) | |
77.1 | 120 | ## redundant double check | |
121 | #stop | ||
122 | #end | ||
123 | ## some pubs found | ||
124 | ## page index | ||
86.11 | 125 | #if( $itemMap.keySet().size() > 1 ) | |
88.1 | 126 | ## found more than one status | |
86.11 | 127 | <div class="mainselectbar" id="index"> | |
128 | #foreach( $status in $itemMap.keySet() ) | ||
129 | #if( !$foreach.first ) | ||
130 |  •  | ||
131 | #end | ||
101.2 | 132 | [[$services.localization.render("${mainSpace}.Class_status_${status}_short_plural").toLowerCase()>>||anchor="$status"]] | |
86.11 | 133 | #end | |
134 | </div> | ||
77.1 | 135 | #end | |
86.11 | 136 | ## | |
87.1 | 137 | #template('apice_publication_macros.vm') | |
138 | ## | ||
88.1 | 139 | #foreach( $status in $itemMap.keySet() ) | |
87.1 | 140 | ## status top / start | |
141 | <div class="mainselectseparator"> | ||
101.2 | 142 | <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status&bibtex=$showBibtex&inline=$showInline#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")> | |
143 | $services.localization.render("${mainSpace}.Class_status_${status}_plural").toLowerCase() | ||
87.1 | 144 | </a> | |
145 | </div> | ||
146 | ## status top / end | ||
147 | ## | ||
148 | ## status display / start | ||
149 | <div> | ||
150 | #if( $showInline && !$showBibtex ) | ||
151 | <ul> | ||
88.1 | 152 | #foreach( $item in $itemMap[$status] ) | |
93.2 | 153 | <li>#pubperstatus($item)</li> | |
87.1 | 154 | #end | |
155 | </ul> | ||
156 | #else | ||
94.2 | 157 | #foreach( $item in $itemMap[$status] ) | |
87.1 | 158 | #if( $showBibtex) | |
159 | #if( $showInline ) | ||
160 | ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}}))) | ||
161 | #else | ||
162 | ((({{code language="bibtex"}}$xwiki.getDocument($item).getValue('bibtex'){{/code}}))) | ||
163 | #end | ||
164 | #else | ||
101.2 | 165 | <div style="border-style: hidden hidden hidden hidden; font-size: smaller; line-height: 1.25em; margin: .75em 0 .75em 0"> | |
166 | <div style="margin: 0 0 0 0">#pubauthed($item)</div> | ||
167 | <div style="margin: 0 0 0 0">#pubtitle($item)</div> | ||
168 | <div style="margin: 0 0 0 0"><span class="textsecondary">(#pubsort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}</div> | ||
87.1 | 169 | </div> | |
170 | #end | ||
171 | #end | ||
83.1 | 172 | #end | |
87.1 | 173 | </div> | |
174 | ## status display / end | ||
175 | ## | ||
176 | ## status bottom / start | ||
177 | <div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> | ||
178 | #set( $itemStatusNo = $itemMap[$status].size() ) | ||
101.2 | 179 | $itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${mainSpace}.Class_status_${status}").toLowerCase()#{else}$services.localization.render("${mainSpace}.Class_status_${status}_plural").toLowerCase()#end • #anchorlinks() | |
87.1 | 180 | </div> | |
86.6 | 181 | ## status bottom / end | |
83.1 | 182 | #end | |
97.1 | 183 | ## DISPLAY / END | |
86.6 | 184 | {{/html}} | |
185 | {{/velocity}}{{pageDisplay sort="objectservice"/}} |