Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
112.1
edited by Super Admin
on 2026/03/25 01:50
on 2026/03/25 01:50
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
-
... ... @@ -1004,13 +1004,13 @@ 1004 1004 1005 1005 <div class="activity-toolbar"> 1006 1006 <div class="activity-fy-tabs"> 1007 - <button class="activity-fy-tab active" onclick="switchActivityFY('$currentFYStr', this)">$currentFYStr 年度</button>1007 + <button class="activity-fy-tab" onclick="switchActivityFY('$currentFYStr', this)">$currentFYStr 年度</button> 1008 1008 #foreach($fy in $fySet) 1009 1009 #if($fy != $currentFYStr) 1010 1010 <button class="activity-fy-tab" onclick="switchActivityFY('$fy', this)">$fy 年度</button> 1011 1011 #end 1012 1012 #end 1013 - <button class="activity-fy-tab" onclick="switchActivityFY('all', this)">全期間</button> 1013 + <button class="activity-fy-tab active" onclick="switchActivityFY('all', this)">全期間</button> 1014 1014 </div> 1015 1015 <div class="activity-toolbar-right"> 1016 1016 <button class="btn-view-toggle" id="btnViewToggle" onclick="toggleCompactView()" title="タイトルのみ表示"> ... ... @@ -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) ... ... @@ -1594,7 +1594,7 @@ 1594 1594 fyTabs.forEach(function(t) { tabContainer.appendChild(t); }); 1595 1595 if (allTab) { tabContainer.appendChild(allTab); } 1596 1596 } 1597 - // デフォルトで 現在の年度を表示1622 + // デフォルトで全期間を表示 1598 1598 var defaultTab = document.querySelector('.activity-fy-tab.active'); 1599 1599 if (defaultTab) { defaultTab.click(); } 1600 1600 // 保存成功時のトースト通知