Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
115.1
edited by Super Admin
on 2026/03/27 05:08
on 2026/03/27 05:08
Change comment:
There is no comment for this version
To 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
Summary
Details
- Page properties
-
- Content
-
... ... @@ -1049,64 +1049,22 @@ 1049 1049 1050 1050 {{/html}} 1051 1051 1052 -## 活動を「年度降順 + 特色あり先頭」で並び替え 1053 -## Step1: fySet から年度を降順ソート(Velocity ネイティブ実装) 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 -## 最大値を順番に取り出して降順リストを構築(最大20年度まで対応) 1061 -#set($fyDesc = []) 1062 -#set($fyRemaining = []) 1063 -#foreach($fy in $fyNums) 1064 - #set($discard = $fyRemaining.add($fy)) 1065 -#end 1066 -#foreach($dummy in [1..20]) 1067 - #if($fyRemaining.isEmpty())#break#end 1068 - #set($fyMax = $fyRemaining.get(0)) 1069 - #foreach($fy in $fyRemaining) 1070 - #if($fy > $fyMax)#set($fyMax = $fy)#end 1071 - #end 1072 - #set($discard = $fyDesc.add($fyMax)) 1073 - #set($fyNextRem = []) 1074 - #set($fyMaxRemoved = false) 1075 - #foreach($fy in $fyRemaining) 1076 - #if(!$fyMaxRemoved && $fy == $fyMax) 1077 - #set($fyMaxRemoved = true) 1052 +## 特色ある活動を先頭に表示するため、並び替え用リストを作成 1053 +#set($featuredActivities = []) 1054 +#set($normalActivities = []) 1055 +#if($activities && $activities.size() > 0) 1056 + #foreach($act in $activities) 1057 + #set($isFeatured = $!act.getValue('featured')) 1058 + #if($isFeatured == '1') 1059 + #set($discard = $featuredActivities.add($foreach.index)) 1078 1078 #else 1079 - #set($discard = $ fyNextRem.add($fy))1061 + #set($discard = $normalActivities.add($foreach.index)) 1080 1080 #end 1081 1081 #end 1082 - #set($fyRemaining = $fyNextRem) 1083 1083 #end 1084 -## 年度未設定の活動は末尾に表示(fySetに'unknown'は入らないため無条件追加) 1085 -#set($discard = $fyDesc.add('unknown')) 1086 -## Step2: 年度降順で featured → normal の順にインデックスを収集 1087 1087 #set($orderedActivityIndices = []) 1088 -#foreach($curFY in $fyDesc) 1089 - ## 同年度の特色あり活動を先頭に 1090 - #set($actIdx2 = 0) 1091 - #foreach($act in $activities) 1092 - #set($aFY2 = $!act.getValue('fiscalYear')) 1093 - #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end 1094 - #if($aFY2 == $curFY && $act.getValue('featured') == '1') 1095 - #set($discard = $orderedActivityIndices.add($actIdx2)) 1096 - #end 1097 - #set($actIdx2 = $actIdx2 + 1) 1098 - #end 1099 - ## 同年度の通常活動 1100 - #set($actIdx2 = 0) 1101 - #foreach($act in $activities) 1102 - #set($aFY2 = $!act.getValue('fiscalYear')) 1103 - #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end 1104 - #if($aFY2 == $curFY && $act.getValue('featured') != '1') 1105 - #set($discard = $orderedActivityIndices.add($actIdx2)) 1106 - #end 1107 - #set($actIdx2 = $actIdx2 + 1) 1108 - #end 1109 -#end 1066 +#set($discard = $orderedActivityIndices.addAll($featuredActivities)) 1067 +#set($discard = $orderedActivityIndices.addAll($normalActivities)) 1110 1110 1111 1111 #if($activities && $activities.size() > 0) 1112 1112 #foreach($actIdx in $orderedActivityIndices)