Changes for page 学校ページ テンプレート
Last modified by Super Admin on 2026/04/05 18:59
From version
44.1
edited by Super Admin
on 2026/03/13 00:18
on 2026/03/13 00:18
Change comment:
There is no comment for this version
To version
42.1
edited by Super Admin
on 2026/03/12 12:20
on 2026/03/12 12:20
Change comment:
There is no comment for this version
Summary
Details
- Page properties
-
- Content
-
... ... @@ -65,7 +65,9 @@ 65 65 #set($seitokaiYoutube = $doc.getValue('seitokaiYoutube')) 66 66 #set($seitokaiOtherSns = $doc.getValue('seitokaiOtherSns')) 67 67 68 -## --- 現在の年度を計算(4月始まり) --- 68 +## --- 年度アーカイブ --- 69 +#set($pageFiscalYear = $!doc.getValue('fiscalYear')) 70 +## 現在の年度を計算(4月始まり) 69 69 #set($nowFY = $datetool.date) 70 70 #set($currentFYMonth = $mathtool.toInteger($datetool.format('MM', $nowFY))) 71 71 #set($currentFYYear = $mathtool.toInteger($datetool.format('yyyy', $nowFY))) ... ... @@ -74,6 +74,10 @@ 74 74 #else 75 75 #set($currentFiscalYear = $mathtool.sub($currentFYYear, 1)) 76 76 #end 79 +## fiscalYear 未設定時はデフォルトとして現在の年度を使う 80 +#if(!$pageFiscalYear || $pageFiscalYear == '') 81 + #set($pageFiscalYear = $currentFiscalYear.toString()) 82 +#end 77 77 78 78 ## --- 公開範囲フィールド --- 79 79 #set($visibilityOrgChart = $!doc.getValue('visibilityOrgChart')) ... ... @@ -247,7 +247,7 @@ 247 247 <tr><th>共学・別学</th><td>$!escapetool.xml($!coeducation)</td></tr> 248 248 <tr><th>設置者</th><td>$!escapetool.xml($!establishment)</td></tr> 249 249 <tr><th>学校種</th><td>$!escapetool.xml($!schoolLevel)</td></tr> 250 - <tr><th>課程</th><td>#if($schoolSystem && !$schoolSystem.isEmpty())#foreach($ssin$schoolSystem)#if($foreach.count>1)/ #end$!escapetool.xml($ss)#end#end</td></tr>256 + <tr><th>課程</th><td>#if($schoolSystem && $schoolSystem != '' && $schoolSystem != '[]')$!escapetool.xml($!schoolSystem)#end</td></tr> 251 251 <tr><th>公式サイト</th><td>#if($website && $website != '')<a href="$!escapetool.xml($website)" target="_blank" rel="noopener">$!escapetool.xml($website)</a>#else<span class="text-placeholder">未登録</span>#end</td></tr> 252 252 </table> 253 253 #set($infoEditDate = $!doc.getValue('lastInfoEditedDate')) ... ... @@ -305,7 +305,7 @@ 305 305 306 306 ## --- ③④⑤ 日常の活動・選挙・定例活動 --- 307 307 <div class="school-section-grid"> 308 - #if($dailyActivities && !$dailyActivities.isEmpty())314 + #if($dailyActivities && $dailyActivities != '') 309 309 <div class="school-section-card"> 310 310 <h3><svg class="ico" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg> 日常の活動</h3> 311 311 <div class="card-inner"> ... ... @@ -312,7 +312,7 @@ 312 312 <p class="activity-hint">活動時間の多い順に上位3つ</p> 313 313 <div class="tag-container"> 314 314 #set($daIdx = 1) 315 - #foreach($da in $dailyActivities) 321 + #foreach($da in $dailyActivities.split(",")) 316 316 <span class="tag tag-accent">${daIdx}. $!escapetool.xml($da.trim())</span> 317 317 #set($daIdx = $daIdx + 1) 318 318 #end ... ... @@ -363,7 +363,7 @@ 363 363 #end 364 364 365 365 ## --- ⑦ 予算 --- 366 - #set($hasBudget = ($budgetProcess && !$budgetProcess.isEmpty())|| ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != ''))372 + #set($hasBudget = ($budgetProcess && $budgetProcess != '') || ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != '')) 367 367 #if($hasBudget) 368 368 ## 公開範囲チェック 369 369 #set($canViewBudget = true) ... ... @@ -374,12 +374,12 @@ 374 374 <div class="school-section-card"> 375 375 <h3><svg class="ico" viewBox="0 0 24 24"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/></svg> 予算 #if($visibilityBudget != 'public')<span class="visibility-badge visibility-${visibilityBudget}">#if($visibilityBudget == 'members')<svg class="ico" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg> 登録者限定#else<svg class="ico" viewBox="0 0 24 24"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 校内限定#end</span>#end</h3> 376 376 <div class="card-inner"> 377 - #if($budgetProcess && !$budgetProcess.isEmpty())383 + #if($budgetProcess && $budgetProcess != '') 378 378 <div class="info-row"> 379 379 <span class="info-label">作成過程の生徒関与</span> 380 380 <span class="info-value"> 381 381 <div class="selection-display"> 382 - #foreach($bp in $budgetProcess) 388 + #foreach($bp in $budgetProcess.split(",")) 383 383 <span class="selection-item">$!escapetool.xml($bp.trim())</span> 384 384 #end 385 385 </div> ... ... @@ -398,12 +398,12 @@ 398 398 <span class="info-value">$!escapetool.xml($!budgetScale)</span> 399 399 </div> 400 400 #end 401 - #if($budgetAllocation && !$budgetAllocation.isEmpty())407 + #if($budgetAllocation && $budgetAllocation != '') 402 402 <div class="info-row"> 403 403 <span class="info-label">主な予算配分</span> 404 404 <span class="info-value"> 405 405 <div class="selection-display"> 406 - #foreach($ba in $budgetAllocation) 412 + #foreach($ba in $budgetAllocation.split(",")) 407 407 <span class="selection-item">$!escapetool.xml($ba.trim())</span> 408 408 #end 409 409 </div> ... ... @@ -436,12 +436,12 @@ 436 436 <span class="info-label">見直しの有無(3年以内)</span> 437 437 <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($!ruleReviewStatus)</span></span> 438 438 </div> 439 - #if($ruleReviewContent && !$ruleReviewContent.isEmpty())445 + #if($ruleReviewContent && $ruleReviewContent != '') 440 440 <div class="info-row"> 441 441 <span class="info-label">見直しの内容</span> 442 442 <span class="info-value"> 443 443 <div class="selection-display"> 444 - #foreach($rc in $ruleReviewContent) 450 + #foreach($rc in $ruleReviewContent.split(",")) 445 445 <span class="selection-item">$!escapetool.xml($rc.trim())</span> 446 446 #end 447 447 </div> ... ... @@ -448,12 +448,12 @@ 448 448 </span> 449 449 </div> 450 450 #end 451 - #if($ruleReviewProposer && !$ruleReviewProposer.isEmpty())457 + #if($ruleReviewProposer && $ruleReviewProposer != '') 452 452 <div class="info-row"> 453 453 <span class="info-label">見直しの提案者</span> 454 454 <span class="info-value"> 455 455 <div class="selection-display"> 456 - #foreach($rp in $ruleReviewProposer) 462 + #foreach($rp in $ruleReviewProposer.split(",")) 457 457 <span class="selection-item">$!escapetool.xml($rp.trim())</span> 458 458 #end 459 459 </div> ... ... @@ -460,12 +460,12 @@ 460 460 </span> 461 461 </div> 462 462 #end 463 - #if($ruleReviewImplementer && !$ruleReviewImplementer.isEmpty())469 + #if($ruleReviewImplementer && $ruleReviewImplementer != '') 464 464 <div class="info-row"> 465 465 <span class="info-label">見直しの実施者</span> 466 466 <span class="info-value"> 467 467 <div class="selection-display"> 468 - #foreach($ri in $ruleReviewImplementer) 474 + #foreach($ri in $ruleReviewImplementer.split(",")) 469 469 <span class="selection-item">$!escapetool.xml($ri.trim())</span> 470 470 #end 471 471 </div> ... ... @@ -941,6 +941,59 @@ 941 941 {{/html}} 942 942 #end 943 943 950 +## --- 年度アーカイブ セクション --- 951 +{{html clean="false"}} 952 +<div class="school-section-card school-archive-card"> 953 + <h2 class="archive-section-title"> 954 + <svg class="ico ico-md" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg> 955 + 年度アーカイブ 956 + </h2> 957 + <div class="archive-meta"> 958 + 現在のページ: <strong>${pageFiscalYear}年度</strong> 959 + #set($lyud = $!doc.getValue('lastYearUpdateDate')) 960 + #if($lyud && $lyud != '') 961 + | 最終年度更新: $!escapetool.xml($lyud) ($!escapetool.xml($!doc.getValue('lastYearUpdateBy'))) 962 + #end 963 + </div> 964 + 965 + ## 過去アーカイブの検索 966 + #set($archiveQuery = $services.query.hql("where doc.fullName like :pattern and doc.fullName like '%Archive_%' order by doc.fullName desc").bindValue("pattern", "${doc.fullName}.Archive_%").setLimit(20)) 967 + #set($archivePages = $archiveQuery.execute()) 968 + 969 + #if($archivePages && $archivePages.size() > 0) 970 + <div class="archive-card-field-lg"> 971 + <div class="archive-list-label">過去の年度アーカイブ</div> 972 + <div class="archive-list"> 973 + #foreach($archPage in $archivePages) 974 + #set($archPageDoc = $xwiki.getDocument($archPage)) 975 + #set($archPageObj = $archPageDoc.getObject('SeitokaiCode.SchoolClass')) 976 + #if($archPageObj) 977 + #set($archPageFY = $!archPageObj.getValue('fiscalYear')) 978 + <a href="$archPageDoc.getURL('view')" class="archive-link"> 979 + <svg class="ico" viewBox="0 0 24 24"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg> 980 + ${archPageFY}年度 981 + </a> 982 + #end 983 + #end 984 + </div> 985 + </div> 986 + #else 987 + <div class="archive-empty">過去のアーカイブはまだありません</div> 988 + #end 989 + 990 + ## 新年度に移行ボタン(承認済み・管理者のみ) 991 + #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified') 992 + <div class="archive-action"> 993 + <a href="/bin/SeitokaiCode/YearArchiveAction?schoolPage=${doc.fullName}" class="btn-accent"> 994 + <svg class="ico" viewBox="0 0 24 24" stroke-width="2.5"><path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"/><polyline points="17 21 17 13 7 13 7 21"/><polyline points="7 3 7 8 15 8"/></svg> 995 + ${pageFiscalYear}年度をアーカイブして新年度に移行 996 + </a> 997 + <div class="archive-action-hint">現在の学校情報を${pageFiscalYear}年度として保存し、新しい年度に移行します。</div> 998 + </div> 999 + #end 1000 +</div> 1001 +{{/html}} 1002 + 944 944 ## --- 年度タブ切り替え JavaScript --- 945 945 {{html clean="false"}} 946 946 <script> ... ... @@ -963,6 +963,9 @@ 963 963 var defaultTab = document.querySelector('.activity-fy-tab.active'); 964 964 if (defaultTab) { defaultTab.click(); } 965 965 // 保存成功時のトースト通知 1025 + if (window.location.search.indexOf('archived=1') !== -1) { 1026 + showToast('年度アーカイブを作成しました', 'success'); 1027 + } 966 966 if (window.location.search.indexOf('saved=1') !== -1) { 967 967 showToast('学校情報を保存しました', 'success'); 968 968 // URLパラメータをクリーンアップ(リロード時に再表示されないよう)