Changes for page Supervisors

From version 69.3
edited by Andrea Omicini
on 08/11/2021 14:17
Change comment: There is no comment for this version
To version 69.2
edited by Andrea Omicini
on 08/11/2021 13:41
Change comment: Update document after refactoring.

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -#if($xcontext.language=="it")Nuvola dei tag delle tesi#{else}Thesis Tag Cloud#end
1 +Tag Cloud
Content
... ... @@ -1,77 +1,28 @@
1 -{{include reference='Theses.Environment'/}}{{include reference='Environment'/}}{{velocity}}
2 -## publication page with menus
3 -#set( $thesisMenu = true )
4 -##
5 -#set( $userSelected = false )
6 -##
1 +{{include reference = "MacroSheet" /}}{{velocity}}
7 7  #if( !$request.tag )
8 -## START NO TAG specified in the query
9 - #if( $userName && $xwiki.exists($userName) )
10 - #set( $userDoc = $xwiki.getDocument($userName) )
11 - #set( $userFirstName = $userDoc.display("first_name") )
12 - #set( $userLastName = $userDoc.display("last_name") )
13 - #set( $userSelected = true )
14 - #end
15 - #if( !$userSelected && $request.user )
16 - #if( $xwiki.exists("XWiki.$request.user") )
17 - #set( $userSelected = true )
18 - #set( $userName = "XWiki.$request.user" )
19 - #elseif( $xwiki.exists("$request.user") )
20 - #set( $userSelected = true )
21 - #set( $userName = "$request.user" )
22 - #else
23 -{{warning}}"$request.user" looks not like any known APICe user{{/warning}}
24 - #end
25 - #if( $userSelected )
26 - #set( $userDoc = $xwiki.getDocument($userName) )
27 - #set( $userFirstName = $userDoc.display("first_name") )
28 - #set( $userLastName = $userDoc.display("last_name") )
29 - #end
30 - #end
31 - #if( $userSelected )
32 -> **Tag Cloud** / {{stringEngIta eng = "Theses" ita = "Tesi" /}} / $userFirstName $userLastName
33 -
34 - #set( $from = ", BaseObject as obj0, StringProperty as prop0, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3" )
35 - #set( $where = "obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj0.id and prop1.id.id = obj0.id and prop2.id.id = obj0.id and prop3.id.id = obj0.id and prop0.name = 'status' and prop0.value = 'Completed' and prop1.name = 'supervisors' and prop2.name = 'cosupervisors' and prop3.name = 'contacts' and ( prop1.value like '%$userName%' or prop2.value like '%$userName%' or prop3.value like '%$userName%' )" )
36 - #else
3 +## no tag specified in the query
37 37  >**Tag Cloud** / {{stringEngIta eng="Theses" ita="Tesi" /}}
38 38  
39 - #set( $from = ", BaseObject as obj0, StringProperty as prop0" )
40 - #set( $where = "obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj0.id and and prop0.name = 'status' and prop0.value = 'Completed'" )
41 - #end
42 - ##
43 - #set( $tagCount = $xwiki.tag.getTagCountForQuery($from, $where) )
44 - #set( $tagInstanceNo = 0 )
45 - #set( $tagNo = 0 )
46 -(% style='text-align:center' %)(((
47 - #foreach( $thesisTag in $tagCount.keySet() )
6 +#set( $from = ", BaseObject as obj0" )
7 +#set( $where = " obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' " )
8 +#set( $tagCount = $xwiki.tag.getTagCountForQuery($from, $where) )
9 +(% style='text-align: center' %)(((
10 +#foreach( $thesisTag in $tagCount.keySet() )
48 48   #set( $thesisCount = $tagCount.get($thesisTag) )
49 - #set( $tagInstanceNo = $tagInstanceNo + $thesisCount )
50 - #set( $tagNo = $tagNo + 1 )
51 - #if( $thesisCount > 40 )#set( $tagSize = "140%" )
52 - #elseif( $thesisCount > 30 )#set( $tagSize = "135%" )
53 - #elseif( $thesisCount > 20 )#set( $tagSize = "130%" )
54 - #elseif( $thesisCount > 10 )#set( $tagSize = "125%" )
55 - #elseif( $thesisCount > 5 )#set( $tagSize = "120%" )
56 - #elseif( $thesisCount > 3 )#set( $tagSize = "110%" )
57 - #elseif( $thesisCount == 3 )#set( $tagSize = "105%" )
58 - #elseif( $thesisCount == 2 )#set( $tagSize = "100%" )
59 - #else#set( $tagSize = "90%" )
12 + #if( $thesisCount > 20 ) #set ( $tagSize = "140%" )
13 + #elseif( $thesisCount > 10 ) #set ( $tagSize = "130%" )
14 + #elseif( $thesisCount > 5 ) #set ( $tagSize = "120%" )
15 + #elseif( $thesisCount > 3 ) #set ( $tagSize = "110%" )
16 + #elseif( $thesisCount == 3 ) #set ( $tagSize = "105%" )
17 + #elseif( $thesisCount == 2 ) #set ( $tagSize = "100%" )
18 + #else#set ($tagSize = "90%" )
60 60   #end
61 - #set($urlEscapedTag = $escapetool.url($thesisTag))
62 - #set($htmlEscapedTag = $escapetool.xml($thesisTag))
63 -(% style='font-size:$tagSize' %) [[$thesisTag>>$doc||queryString='tag=$urlEscapedTag#if( $userSelected )&user=$userName#end']](% style='font-style:normal;color:$theme.textPrimaryColor';font-size:75%' %),,$thesisCount,,(%%) (%%)#end
20 + #set( $urlEscapedTag = $escapetool.url($thesisTag) )
21 + #set( $htmlEscapedTag = $escapetool.xml($thesisTag) )
22 +(% style='font-size:$tagSize' %) [[$thesisTag>>Theses.Tags||queryString="tag=$urlEscapedTag"]] (%%)#end
64 64  )))
65 -(% style="font-style:oblique;font-size:smaller;text-align:right;color:$theme.textSecondaryColor" %)(((
66 - #if( $userSelected )
67 -[ $tagInstanceNo / $tagNo {{stringEngIta eng = "tags" ita = "tag"/}} ]
68 - #else
69 -[ $tagInstanceNo / $tagNo {{stringEngIta eng = "tags" ita = "tag"/}} ]
70 - #end
71 -)))
72 -## END NO TAG specified in the query
73 73  #else
74 -## START ONE TAG specified in the query
25 +## one tag specified in the query
75 75  >Tag “**$request.tag**” / {{stringEngIta eng = "Theses" ita = "Tesi" /}}
76 76  
77 77  #set( $from = ", BaseObject as obj0, DBStringListProperty as prop0 join prop0.list item, BaseObject as obj1, DateProperty as prop1, StringProperty as prop2" )