Modifiche per il documento In evidenza
Dalla versione 12.1
modificato da Andrea Omicini
il 20/07/2023 09:30
il 20/07/2023 09:30
Cambia il commento:
Nessun commento per questa versione
Alla versione 9.1
modificato da Andrea Omicini
il 30/03/2022 18:04
il 30/03/2022 18:04
Cambia il commento:
Nessun commento per questa versione
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Titolo
-
... ... @@ -1,1 +1,0 @@ 1 -$services.localization.render('spotlight') - Lingua predefinita
-
... ... @@ -1,0 +1,1 @@ 1 +en - Content
-
... ... @@ -1,74 +1,50 @@ 1 -{{velocity}} 2 -{{html clean="false" wiki="true"}} 3 -#template('apice_macros.vm') 4 -#objectspace() 5 -#nolangpar() 6 -#template('apice_course_macros.vm') 7 -#isuserspace() 8 -#if( $isUserSpace ) 9 - #setobjectsubspace("Courses","Personal") 10 - #userspace() 11 -## user space variables 12 - #set( $query = ", BaseObject as objPersonalCourse, LargeStringProperty as propUser 13 - where objPersonalCourse.name = doc.fullName and objPersonalCourse.className = '${objectSpace}.Class' and propUser.id.id = objPersonalCourse.id and propUser.name = 'user' and propUser.value = '$userName' " ) 14 - #set( $personalCourseDocs = $xwiki.searchDocuments($query) ) 15 - #includeInContext("${userSpace}.Environment") 16 -## #if( $personalCourseDocs.size() > 0 ) 17 -## #set( $personalCourseDoc = $xwiki.getDocument($personalCourseDocs[0]) ) 18 -## #else 19 -## #stop 20 -## #end 21 -## #if( $personalCourseDoc.spotNo && $personalCourseDoc.spotNo != "" ) 22 -## #set( $spotCourseNo = $personalCourseDoc.spotNo ) 23 -## #end 24 -## USER SPOTLIGHT / START 25 - #if( $personalCourseDoc.getValue('spotList').size() > 0 ) 26 - <table width="100%"><tr class='borderhalfbottom'> 27 - #foreach( $item in $personalCourseDoc.getValue('spotList') ) 28 - #if( $foreach.count <= $maxCourseSpot ) 29 - <td>{{course linked='title'}}$item{{/course}}</span></td> 1 += {{italiano}}Spotlight{{/italiano}}{{english}}Spotlight{{/english}} = 2 + 3 +{{include reference="Courses.Environment" excludeFirstHeading="true"/}}{{velocity}} 4 +#set( $courseMenu = true ) 5 +## $spotCourseNo has to be an integer 6 +#if( $spotCourseNo ) 7 + #set( $spotCourseNo = $util.parseInt($spotCourseNo) ) 8 +#end 9 +## user or general spotlight? 10 +#if( !$userName || $userName == "" || !$userSpace || $userSpace == "" || !$userFullname || $userFullname == "" ) 11 +#### START GENERAL SHOWCASE 12 + #if( $spotCourseNo && $spotCourseNo > 0 ) 13 + #set ($sql = ", BaseObject as obj, StringProperty as prop where obj.name = doc.fullName and obj.className = 'Courses.CourseClass' and obj.name <> 'Courses.CourseTemplate' and prop.id.id = obj.id and prop.name = 'ay' order by prop.value desc") 14 + #set( $courseFound = $xwiki.searchDocuments($sql) ) 15 + #set( $courseFoundNo = $courseFound.size() ) 16 + #if( $courseFoundNo > 0 ) 17 + #if( $courseFoundNo > $spotCourseNo ) 18 + #set( $n = $spotCourseNo - 1 ) 19 + #else 20 + #set( $n = $courseFoundNo - 1 ) 30 30 #end 22 +(% style='border-style:hidden solid solid hidden; border-color:$theme.borderColor' %)#foreach( $i in [0..$n] )|{{course linked='title'}}$courseFound.get($i){{/course}}#end(%%) 31 31 #end 32 - </tr></table> 24 + #end 25 +#### END GENERAL SPOTLIGHT 26 +#else 27 +#### START USER SPOTLIGHT 28 +## 29 + #if( $spotCourses && $spotCourses != [] ) 30 +(% style='border-style:hidden solid solid hidden; border-color:$theme.borderColor' %)#foreach( $course in $spotCourses )#if( ( $xwiki.exists("Courses.$course") || $xwiki.exists("Courses.${course}.WebHome") ) && ($velocityCount <= $maxCourseSpot) )|{{course linked='title'}}$course{{/course}}#end#end(%%) 33 33 #elseif( $spotCourseNo && $spotCourseNo > 0 ) 34 34 #if( $spotCourseNo > $maxCourseSpot ) 35 35 #set( $spotCourseNo = $maxCourseSpot ) 36 36 #end 37 - #set( $query = ", BaseObject as objCourse, StringProperty as propYear, LargeStringProperty as propUser 38 - where objCourse.name = doc.fullName and objCourse.className = '${mainSpace}.Class' and propYear.id.id = objCourse.id and propYear.name = 'ay' and propUser.id.id = objCourse.id and propUser.name = 'professor' and propUser.value like '%$userName%' order by propYear.value desc " ) 39 - #set( $itemFound = $xwiki.searchDocuments($query) ) 40 - #set( $itemFoundNo = $itemFound.size() ) 41 - #if( $itemFoundNo > 0 ) 42 - <table width="100%"><tr class='borderhalfbottom'> 43 - #foreach( $item in $itemFound ) 44 - #if( $foreach.count > $spotCourseNo ) 45 - #break 46 - #end 47 - <td>{{course linked='title'}}$item{{/course}}</span></td> 35 + #set ($sql = ", BaseObject as obj, StringProperty as prop0, LargeStringProperty as prop1 36 + where obj.name = doc.fullName and obj.className = 'Courses.CourseClass' and obj.name <> 'Courses.CourseTemplate' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop0.name = 'ay' and prop1.name = 'professor' and prop1.value like '%$userName%' order by prop0.value desc") 37 + #set( $courseFound = $xwiki.searchDocuments($sql) ) 38 + #set( $courseFoundNo = $courseFound.size() ) 39 + #if( $courseFoundNo > 0 ) 40 + #if( $courseFoundNo > $spotCourseNo ) 41 + #set( $n = $spotCourseNo - 1 ) 42 + #else 43 + #set( $n = $courseFoundNo - 1 ) 48 48 #end 49 - </tr></table>45 +(% style='border-style:hidden solid solid hidden; border-color:$theme.borderColor' %)#foreach( $i in [0..$n] )|{{course linked='title'}}$courseFound.get($i){{/course}}#end(%%) 50 50 #end 51 51 #end 52 52 #### END USER SPOTLIGHT 53 -#else 54 -#### START GENERAL SPOTLIGHT 55 - #if( $spotCourseNo && $spotCourseNo > 0 ) 56 - #set( $query = ", BaseObject as objCourse, StringProperty as propYear 57 - where objCourse.name = doc.fullName and objCourse.className = '${mainSpace}.Class' and objCourse.name <> '${objectPool}.Template' and propYear.id.id = objCourse.id and propYear.name = 'ay' order by propYear.value desc" ) 58 - #set( $itemFound = $xwiki.searchDocuments($query) ) 59 - #set( $itemFoundNo = $itemFound.size() ) 60 - #if( $itemFoundNo > 0 ) 61 - <table width="100%"><tr class='borderhalfbottom'> 62 - #foreach( $item in $itemFound ) 63 - #if( $foreach.count > $spotCourseNo ) 64 - #break 65 - #end 66 - <td>{{course linked='title'}}$item{{/course}}</td> 67 - #end 68 - </tr></table> 69 - #end 70 - #end 71 -#### END GENERAL SPOTLIGHT 72 72 #end 73 -{{/html}} 74 -{{/velocity}}{{pageDisplay sort="objectservice"/}} 50 +{{/velocity}}