Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
113.1
edited by Super Admin
on 2026/03/27 03:42
on 2026/03/27 03:42
Change comment:
There is no comment for this version
To version
114.1
edited by Super Admin
on 2026/03/27 03:45
on 2026/03/27 03:45
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1049,22 +1049,47 @@ 1049 1049 1050 1050 {{/html}} 1051 1051 1052 -## 特色ある活動を先頭に表示するため、並び替え用リストを作成 1053 -#set($featuredActivities = []) 1054 -#set($normalActivities = []) 1055 -#if($activities && $activities.size() > 0) 1052 +## 活動を「年度降順 + 特色あり先頭」で並び替え 1053 +## Step1: fySet から年度を降順ソート($sorttool を使用) 1054 +#set($fyNums = []) 1055 +#foreach($fy in $fySet) 1056 + #if($fy && $fy != '' && $fy != 'unknown') 1057 + #set($discard = $fyNums.add($fy)) 1058 + #end 1059 +#end 1060 +#set($fySorted = $sorttool.sort($fyNums)) 1061 +#if(!$fySorted)#set($fySorted = $fyNums)#end 1062 +#set($fyDesc = []) 1063 +#foreach($fy in $fySorted) 1064 + #set($discard = $fyDesc.add(0, $fy)) 1065 +#end 1066 +#if($fySet.contains('unknown')) 1067 + #set($discard = $fyDesc.add('unknown')) 1068 +#end 1069 +## Step2: 年度降順で featured → normal の順にインデックスを収集 1070 +#set($orderedActivityIndices = []) 1071 +#foreach($curFY in $fyDesc) 1072 + ## 同年度の特色あり活動を先頭に 1073 + #set($actIdx2 = 0) 1056 1056 #foreach($act in $activities) 1057 - #set($isFeatured = $!act.getValue('featured')) 1058 - #if($isFeatured == '1') 1059 - #set($discard = $featuredActivities.add($foreach.index)) 1060 - #else 1061 - #set($discard = $normalActivities.add($foreach.index)) 1075 + #set($aFY2 = $!act.getValue('fiscalYear')) 1076 + #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end 1077 + #if($aFY2 == $curFY && $act.getValue('featured') == '1') 1078 + #set($discard = $orderedActivityIndices.add($actIdx2)) 1062 1062 #end 1080 + #set($actIdx2 = $actIdx2 + 1) 1063 1063 #end 1082 + ## 同年度の通常活動 1083 + #set($actIdx2 = 0) 1084 + #foreach($act in $activities) 1085 + #set($aFY2 = $!act.getValue('fiscalYear')) 1086 + #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end 1087 + #if($aFY2 == $curFY && $act.getValue('featured') != '1') 1088 + #set($discard = $orderedActivityIndices.add($actIdx2)) 1089 + #end 1090 + #set($actIdx2 = $actIdx2 + 1) 1091 + #end 1064 1064 #end 1065 -#set($orderedActivityIndices = []) 1066 -#set($discard = $orderedActivityIndices.addAll($featuredActivities)) 1067 -#set($discard = $orderedActivityIndices.addAll($normalActivities)) 1068 1068 1069 1069 #if($activities && $activities.size() > 0) 1070 1070 #foreach($actIdx in $orderedActivityIndices)