Last modified by Super Admin on 2026/04/05 18:59

From version Icon 118.1 Icon
edited by Super Admin
on 2026/04/01 17:36
Change comment: There is no comment for this version
To version Icon 71.1 Icon
edited by Super Admin
on 2026/03/18 20:48
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -7,19 +7,6 @@
7 7   #stop
8 8  #end
9 9  {{html clean="false"}}
10 -## --- OGP メタタグ(SNSシェア対応) ---
11 -#set($ogTitle = "$!{schoolName} — 生徒会Wiki")
12 -#set($ogDesc = "$!{schoolName}の生徒会活動情報。全国の高校の生徒会活動事例を集積・共有するプラットフォーム。")
13 -#set($ogUrl = "https://${request.serverName}${doc.getURL('view')}")
14 -<meta property="og:type" content="article" />
15 -<meta property="og:title" content="$escapetool.xml($ogTitle)" />
16 -<meta property="og:description" content="$escapetool.xml($ogDesc)" />
17 -<meta property="og:url" content="$escapetool.xml($ogUrl)" />
18 -<meta property="og:site_name" content="生徒会Wiki" />
19 -<meta property="og:locale" content="ja_JP" />
20 -<meta name="twitter:card" content="summary" />
21 -<meta name="twitter:title" content="$escapetool.xml($ogTitle)" />
22 -<meta name="twitter:description" content="$escapetool.xml($ogDesc)" />
23 23  ## メンテナンスバナー({{include}}ではなくインラインで記述し、<p>タグ挿入を回避)
24 24  #set($bannerDoc = $xwiki.getDocument('SeitokaiAdmin.MaintenanceBanner'))
25 25  #set($bannerObj = $bannerDoc.getObject('SeitokaiCode.MaintenanceBannerClass'))
... ... @@ -47,10 +47,8 @@
47 47  #set($schoolLevel = $doc.getValue('schoolLevel'))
48 48  #set($schoolSystem = $doc.getValue('schoolSystem'))
49 49  #set($website = $doc.getValue('website'))
50 -#set($schoolPhoto = $doc.getValue('schoolPhoto'))
51 -#set($schoolDescription = $doc.getValue('schoolDescription'))
52 52  
53 -## --- 生徒会組織 ---
38 +## --- 組織 ---
54 54  #set($orgChart = $doc.getValue('orgChart'))
55 55  #set($orgChartImage = $doc.getValue('orgChartImage'))
56 56  
... ... @@ -70,7 +70,7 @@
70 70  #set($budgetAllocation = $doc.getValue('budgetAllocation'))
71 71  #set($budgetNote = $doc.getValue('budgetNote'))
72 72  
73 -## --- 校則・生徒会会則の見直し ---
58 +## --- 校則の見直し ---
74 74  #set($ruleReviewStatus = $doc.getValue('ruleReviewStatus'))
75 75  #set($ruleReviewContent = $doc.getValue('ruleReviewContent'))
76 76  #set($ruleReviewProposer = $doc.getValue('ruleReviewProposer'))
... ... @@ -77,44 +77,6 @@
77 77  #set($ruleReviewImplementer = $doc.getValue('ruleReviewImplementer'))
78 78  #set($ruleReviewSystem = $doc.getValue('ruleReviewSystem'))
79 79  
80 -## --- 活動環境 ---
81 -#set($activityPlace = $doc.getValue('activityPlace'))
82 -#set($activityRoomEquipment = $doc.getValue('activityRoomEquipment'))
83 -#set($activityRoomImage = $doc.getValue('activityRoomImage'))
84 -#set($ictTools = $doc.getValue('ictTools'))
85 -#set($ictUsage = $doc.getValue('ictUsage'))
86 -
87 -## --- 生徒総会 ---
88 -#set($assemblyFormat = $doc.getValue('assemblyFormat'))
89 -#set($assemblyCount = $doc.getValue('assemblyCount'))
90 -#set($assemblyAgenda = $doc.getValue('assemblyAgenda'))
91 -#set($assemblyTopics = $doc.getValue('assemblyTopics'))
92 -#set($assemblyNote = $doc.getValue('assemblyNote'))
93 -
94 -## --- 広報 ---
95 -#set($publicityMethod = $doc.getValue('publicityMethod'))
96 -#set($publicityFrequency = $doc.getValue('publicityFrequency'))
97 -#set($publicityNote = $doc.getValue('publicityNote'))
98 -
99 -## --- 外部連携 ---
100 -#set($externalCooperation = $doc.getValue('externalCooperation'))
101 -#set($externalOrgName = $doc.getValue('externalOrgName'))
102 -#set($socialParticipation = $doc.getValue('socialParticipation'))
103 -
104 -## --- 年間主要行事 ---
105 -#set($eventApril = $doc.getValue('eventApril'))
106 -#set($eventMay = $doc.getValue('eventMay'))
107 -#set($eventJune = $doc.getValue('eventJune'))
108 -#set($eventJuly = $doc.getValue('eventJuly'))
109 -#set($eventAugust = $doc.getValue('eventAugust'))
110 -#set($eventSeptember = $doc.getValue('eventSeptember'))
111 -#set($eventOctober = $doc.getValue('eventOctober'))
112 -#set($eventNovember = $doc.getValue('eventNovember'))
113 -#set($eventDecember = $doc.getValue('eventDecember'))
114 -#set($eventJanuary = $doc.getValue('eventJanuary'))
115 -#set($eventFebruary = $doc.getValue('eventFebruary'))
116 -#set($eventMarch = $doc.getValue('eventMarch'))
117 -
118 118  ## --- 課題・連絡先 ---
119 119  #set($challenges = $doc.getValue('challenges'))
120 120  #set($contactInfo = $doc.getValue('contactInfo'))
... ... @@ -139,14 +139,6 @@
139 139  #set($visibilityBudget = $!doc.getValue('visibilityBudget'))
140 140  #set($visibilityRuleReview = $!doc.getValue('visibilityRuleReview'))
141 141  #set($visibilityChallenges = $!doc.getValue('visibilityChallenges'))
142 -#set($visibilityDailyActivities = $!doc.getValue('visibilityDailyActivities'))
143 -#set($visibilityElection = $!doc.getValue('visibilityElection'))
144 -#set($visibilityMeeting = $!doc.getValue('visibilityMeeting'))
145 -#set($visibilityActivityEnv = $!doc.getValue('visibilityActivityEnv'))
146 -#set($visibilityAssembly = $!doc.getValue('visibilityAssembly'))
147 -#set($visibilityPublicity = $!doc.getValue('visibilityPublicity'))
148 -#set($visibilityExternal = $!doc.getValue('visibilityExternal'))
149 -#set($visibilityAnnualEvents = $!doc.getValue('visibilityAnnualEvents'))
150 150  ## デフォルト値(未設定なら全体公開)
151 151  #if(!$visibilityOrgChart || $visibilityOrgChart == '') #set($visibilityOrgChart = 'public') #end
152 152  #if(!$visibilityBudget || $visibilityBudget == '') #set($visibilityBudget = 'public') #end
... ... @@ -158,34 +158,13 @@
158 158  #set($isGuest = $viewerUser == 'XWiki.XWikiGuest')
159 159  #set($isViewerAdmin = false)
160 160  #set($viewerSchoolCode = '')
161 -#set($viewerSecondaryGraduated = false)
162 162  #if(!$isGuest)
163 163   #set($viewerDoc = $xwiki.getDocument($viewerUser))
164 164   #set($viewerAccountType = $!viewerDoc.getValue('accountType'))
165 165   #set($viewerSchoolCode = $!viewerDoc.getValue('schoolCode'))
166 - #set($viewerSecondarySchoolCode = $!viewerDoc.getValue('secondarySchoolCode'))
167 - #set($viewerUserRole = $!viewerDoc.getValue('userRole'))
168 168   #if($viewerAccountType == 'admin')
169 169   #set($isViewerAdmin = true)
170 170   #end
171 - ## 第2所属校の在学年数超過チェック
172 - #set($viewerSecEnrollYear = $!viewerDoc.getValue('secondaryEnrollmentYear'))
173 - #if($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecEnrollYear && $viewerSecEnrollYear != '')
174 - #set($vNow = $datetool.date)
175 - #set($vCurYear = $mathtool.toInteger($datetool.format('yyyy', $vNow)))
176 - #set($vCurMonth = $mathtool.toInteger($datetool.format('MM', $vNow)))
177 - #if($vCurMonth >= 4)#set($vSchoolYear = $vCurYear)#else#set($vSchoolYear = $mathtool.sub($vCurYear, 1))#end
178 - #set($vSecEnroll = $mathtool.toInteger($viewerSecEnrollYear))
179 - #set($vSecMax = 3)
180 - #if($viewerSecondarySchoolCode.length() >= 2)
181 - #set($vSecType = $viewerSecondarySchoolCode.substring(0, 2))
182 - #if($vSecType == 'C2')#set($vSecMax = 9)#elseif($vSecType == 'D2')#set($vSecMax = 6)#end
183 - #end
184 - #set($vSecGrade = $mathtool.add($mathtool.sub($vSchoolYear, $vSecEnroll), 1))
185 - #if($vSecGrade > $vSecMax)
186 - #set($viewerSecondaryGraduated = true)
187 - #end
188 - #end
189 189  #end
190 190  
191 191  ## --- 関連校(中高一貫校)情報 ---
... ... @@ -192,31 +192,10 @@
192 192  #set($affiliatedSchoolCode = $!doc.getValue('affiliatedSchoolCode'))
193 193  #set($affiliatedSchoolName = $!doc.getValue('affiliatedSchoolName'))
194 194  #set($isAffiliated = false)
195 -#if($affiliatedSchoolCode && $affiliatedSchoolCode != '')
196 - #if($viewerSchoolCode == $affiliatedSchoolCode)
197 - #set($isAffiliated = true)
198 - #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $affiliatedSchoolCode && !$viewerSecondaryGraduated)
199 - #set($isAffiliated = true)
200 - #end
113 +#if($affiliatedSchoolCode && $affiliatedSchoolCode != '' && $viewerSchoolCode == $affiliatedSchoolCode)
114 + #set($isAffiliated = true)
201 201  #end
202 202  
203 -## --- 校内判定(卒業生を除外、secondarySchoolCodeも含む) ---
204 -#set($isSchoolMember = false)
205 -#if(!$isGuest && $viewerUserRole != 'graduate')
206 - #if($viewerSchoolCode == $schoolCode || $isAffiliated)
207 - #set($isSchoolMember = true)
208 - #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $schoolCode && !$viewerSecondaryGraduated)
209 - #set($isSchoolMember = true)
210 - #end
211 -#end
212 -## 卒業生の母校判定(投稿バッジ用)
213 -#set($isAlumniOfSchool = false)
214 -#if(!$isGuest && $viewerUserRole == 'graduate')
215 - #if($viewerSchoolCode == $schoolCode || ($affiliatedSchoolCode != '' && $viewerSchoolCode == $affiliatedSchoolCode))
216 - #set($isAlumniOfSchool = true)
217 - #end
218 -#end
219 -
220 220  ## --- 学校ページ非表示チェック ---
221 221  #set($schoolHidden = $doc.getValue('hidden'))
222 222  #if($schoolHidden == 1)
... ... @@ -250,7 +250,7 @@
250 250  
251 251  ## --- 投稿固定/解除処理 ---
252 252  #set($pinAction = $!request.action)
253 -#if(($pinAction == 'pin' || $pinAction == 'unpin') && ($viewerAccountType == 'admin' || ($viewerAccountType == 'verified' && $isSchoolMember)) && $services.csrf.isTokenValid($request.form_token))
150 +#if(($pinAction == 'pin' || $pinAction == 'unpin') && ($viewerAccountType == 'admin' || ($viewerAccountType == 'verified' && ($viewerSchoolCode == $schoolCode || $isAffiliated))) && $services.csrf.isTokenValid($request.form_token))
254 254   #set($pinPostObjStr = $!request.postObj)
255 255   #if(!$pinPostObjStr.matches('^\d+$'))
256 256   ## 不正な値 → 無視
... ... @@ -280,7 +280,7 @@
280 280  
281 281  ## --- 特色ある活動 選定/解除処理 ---
282 282  #set($featAction = $!request.action)
283 -#if(($featAction == 'feature' || $featAction == 'unfeature') && ($viewerAccountType == 'admin' || (($viewerAccountType == 'verified' || $viewerAccountType == 'referred') && $isSchoolMember)) && $services.csrf.isTokenValid($request.form_token))
180 +#if(($featAction == 'feature' || $featAction == 'unfeature') && ($viewerAccountType == 'admin' || (($viewerAccountType == 'verified' || $viewerAccountType == 'referred') && $viewerSchoolCode == $schoolCode)) && $services.csrf.isTokenValid($request.form_token))
284 284   #set($featActObjStr = $!request.actObj)
285 285   #if($featActObjStr.matches('^\d+$'))
286 286   #set($actObjNum = $mathtool.toInteger($featActObjStr))
... ... @@ -382,12 +382,12 @@
382 382  
383 383  ## --- 編集ボタン(権限があるユーザーのみ表示) ---
384 384  #set($canEditSchool = false)
385 -#if(!$isGuest && ($isViewerAdmin || $isSchoolMember || $isAlumniOfSchool))
282 +#if(!$isGuest && ($isViewerAdmin || $viewerSchoolCode == $schoolCode || $isAffiliated))
386 386   #set($canEditSchool = true)
387 387  #end
388 388  #if($canEditSchool)
389 389  <div style="text-align:right; margin-bottom:12px;">
390 - <a href="$doc.getURL('view', 'sheet=SeitokaiCode.SchoolEditForm')" class="btn-school-edit"><svg class="ico" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 情報を編集</a>
287 + <a href="$doc.getURL('view', 'sheet=SeitokaiCode.SchoolEditForm')" class="btn-school-edit"><svg class="ico" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 基本情報を編集</a>
391 391  </div>
392 392  #end
393 393  
... ... @@ -412,190 +412,62 @@
412 412  ## --- ① 学校基本情報 ---
413 413  <div class="school-info-card collapsed" id="card-basic-info">
414 414   <h2 role="button" tabindex="0" aria-expanded="false" onclick="toggleInfoCard('card-basic-info')" onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();toggleInfoCard('card-basic-info')}"><span><svg class="ico ico-md" viewBox="0 0 24 24"><path d="M4 19.5A2.5 2.5 0 016.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z"/></svg> 学校基本情報</span><span class="collapse-toggle"><span class="collapse-label-open">たたむ</span><span class="collapse-label-closed">開く</span> <span class="collapse-arrow">▼</span></span></h2>
415 - <div class="school-basic-info-layout">
416 - <div class="school-basic-info-table">
417 - <table class="wiki-table school-info-table">
418 - <tr><th>学校コード</th><td>$!escapetool.xml($!schoolCode)</td></tr>
419 - <tr><th>学校名</th><td>$!escapetool.xml($!schoolName)</td></tr>
420 - <tr><th>所在地</th><td>$!escapetool.xml($!prefecture) #if($city && $city != '')$!escapetool.xml($city)#end</td></tr>
421 - <tr><th>学級数・生徒数</th><td>#if($classCount && $classCount != '')${classCount}学級#end #if($studentCount && $studentCount != '')/ 約${studentCount}名#end</td></tr>
422 - <tr><th>共学・別学</th><td>$!escapetool.xml($!coeducation)</td></tr>
423 - <tr><th>設置者</th><td>$!escapetool.xml($!establishment)</td></tr>
424 - <tr><th>学校種</th><td>$!escapetool.xml($!schoolLevel)</td></tr>
425 - <tr><th>課程</th><td>#if($schoolSystem && !$schoolSystem.isEmpty())#foreach($ss in $schoolSystem)#if($foreach.count > 1) / #end$!escapetool.xml($ss)#end#end</td></tr>
426 - <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>
427 - </table>
428 - </div>
429 - #if($schoolPhoto && $schoolPhoto != '')
430 - <div class="school-photo-area">
431 - <img src="$doc.getAttachmentURL($schoolPhoto)" alt="$!escapetool.xml($schoolName)" class="school-photo" />
432 - </div>
433 - #end
434 - </div>
435 - #if($schoolDescription && $schoolDescription.trim() != '')
436 - <div class="free-note" style="margin-top:var(--sp-4);">$!escapetool.xml($schoolDescription)</div>
312 + <table class="wiki-table school-info-table">
313 + <tr><th>学校コード</th><td>$!escapetool.xml($!schoolCode)</td></tr>
314 + <tr><th>学校名</th><td>$!escapetool.xml($!schoolName)</td></tr>
315 + <tr><th>所在地</th><td>$!escapetool.xml($!prefecture) #if($city && $city != '')$!escapetool.xml($city)#end</td></tr>
316 + <tr><th>学級数・生徒数</th><td>#if($classCount && $classCount != '')${classCount}学級#end #if($studentCount && $studentCount != '')/ 約${studentCount}名#end</td></tr>
317 + <tr><th>共学・別学</th><td>$!escapetool.xml($!coeducation)</td></tr>
318 + <tr><th>設置者</th><td>$!escapetool.xml($!establishment)</td></tr>
319 + <tr><th>学校種</th><td>$!escapetool.xml($!schoolLevel)</td></tr>
320 + <tr><th>課程</th><td>#if($schoolSystem && !$schoolSystem.isEmpty())#foreach($ss in $schoolSystem)#if($foreach.count > 1) / #end$!escapetool.xml($ss)#end#end</td></tr>
321 + <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>
322 + </table>
323 + #set($infoEditDate = $!doc.getValue('lastInfoEditedDate'))
324 + #set($infoEditBy = $!doc.getValue('lastInfoEditedBy'))
325 + #if($infoEditDate && $infoEditDate != '')
326 + <div class="info-last-updated"><svg class="ico" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 基本情報の最終更新: $!escapetool.xml($infoEditBy) — $!escapetool.xml($infoEditDate)</div>
437 437   #end
438 -
439 439  </div>
440 440  
441 -## --- ② 生徒会情報(折りたたみカード) ---
330 +## --- ② 生徒会基本情報(折りたたみカード) ---
442 442  <div class="school-info-card" id="card-seitokai-info">
443 - <h2 role="button" tabindex="0" aria-expanded="true" onclick="toggleInfoCard('card-seitokai-info')" onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();toggleInfoCard('card-seitokai-info')}"><span><svg class="ico ico-md" viewBox="0 0 24 24"><path d="M3 21h18"/><path d="M5 21V7l7-4 7 4v14"/><path d="M9 21v-4h6v4"/></svg> 生徒会情報</span><span class="collapse-toggle"><span class="collapse-label-open">たたむ</span><span class="collapse-label-closed">開く</span> <span class="collapse-arrow">▼</span></span></h2>
332 + <h2 role="button" tabindex="0" aria-expanded="true" onclick="toggleInfoCard('card-seitokai-info')" onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();toggleInfoCard('card-seitokai-info')}"><span><svg class="ico ico-md" viewBox="0 0 24 24"><path d="M3 21h18"/><path d="M5 21V7l7-4 7 4v14"/><path d="M9 21v-4h6v4"/></svg> 生徒会基本情報</span><span class="collapse-toggle"><span class="collapse-label-open">たたむ</span><span class="collapse-label-closed">開く</span> <span class="collapse-arrow">▼</span></span></h2>
444 444   <div class="seitokai-info-body">
445 445  
446 - ## --- 生徒会組織 ---
335 + ## --- 組織 ---
447 447   #set($hasOrgContent = ($orgChart && $orgChart != '') || ($orgChartImage && $orgChartImage != ''))
448 448   #if($hasOrgContent)
449 449   #set($canViewOrgChart = true)
450 - #if($visibilityOrgChart == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewOrgChart = false)
451 - #elseif($visibilityOrgChart == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewOrgChart = false)
339 + #if($visibilityOrgChart == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode && !$isAffiliated))) #set($canViewOrgChart = false)
340 + #elseif($visibilityOrgChart == 'school_trusted' && ($isGuest || (!$isViewerAdmin && (($viewerSchoolCode != $schoolCode && !$isAffiliated) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewOrgChart = false)
452 452   #end
453 453   #if($canViewOrgChart)
454 454   <div class="seitokai-subsection">
455 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M3 21h18"/><path d="M5 21V7l7-4 7 4v14"/><path d="M9 21v-4h6v4"/><line x1="9" y1="10" x2="9" y2="10.01"/><line x1="15" y1="10" x2="15" y2="10.01"/><line x1="9" y1="14" x2="9" y2="14.01"/><line x1="15" y1="14" x2="15" y2="14.01"/></svg> 生徒会組織 #if($visibilityOrgChart != 'public')<span class="visibility-badge visibility-${visibilityOrgChart}">#if($visibilityOrgChart == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
344 + <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M3 21h18"/><path d="M5 21V7l7-4 7 4v14"/><path d="M9 21v-4h6v4"/><line x1="9" y1="10" x2="9" y2="10.01"/><line x1="15" y1="10" x2="15" y2="10.01"/><line x1="9" y1="14" x2="9" y2="14.01"/><line x1="15" y1="14" x2="15" y2="14.01"/></svg> 組織 #if($visibilityOrgChart != 'public')<span class="visibility-badge visibility-${visibilityOrgChart}">#if($visibilityOrgChart == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
456 456   <div class="seitokai-subsection-content">
457 457   #if($orgChartImage && $orgChartImage != '')
458 458   <div class="school-org-img-wrap"><img src="$doc.getAttachmentURL($orgChartImage)" alt="組織図" class="org-chart-img" /></div>
459 459   #end
460 - #if($orgChart && $orgChart != '')<div class="free-note">$!escapetool.xml($orgChart)</div>#end
349 + #if($orgChart && $orgChart != '')$!escapetool.xml($orgChart)#end
461 461   </div>
462 462   </div>
463 463   #else
464 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 生徒会組織は #if($visibilityOrgChart == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
353 + <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 組織は #if($visibilityOrgChart == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
465 465   #end
466 466   #end
467 467  
468 - ## --- 活動環境 ---
469 - #set($hasActivityEnv = ($activityPlace && !$activityPlace.isEmpty()) || ($activityRoomEquipment && $activityRoomEquipment != '') || ($activityRoomImage && $activityRoomImage != '') || ($ictTools && !$ictTools.isEmpty()) || ($ictUsage && !$ictUsage.isEmpty()))
470 - #if($hasActivityEnv)
471 - #set($canViewAE = true)
472 - #if($visibilityActivityEnv == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAE = false)
473 - #elseif($visibilityActivityEnv == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAE = false)
474 - #end
475 - #if($canViewAE)
476 - <div class="seitokai-subsection">
477 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg> 生徒会の活動環境 #if($visibilityActivityEnv != '' && $visibilityActivityEnv != 'public')<span class="visibility-badge visibility-${visibilityActivityEnv}">#if($visibilityActivityEnv == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
478 - <div class="seitokai-subsection-content">
479 - #if($activityPlace && !$activityPlace.isEmpty())
480 - <div class="info-row">
481 - <span class="info-label">普段の活動場所</span>
482 - <span class="info-value">
483 - <div class="selection-display">
484 - #foreach($ap in $activityPlace)
485 - <span class="selection-item">$!escapetool.xml($ap.trim())</span>
486 - #end
487 - </div>
488 - </span>
489 - </div>
490 - #end
491 - #if($activityRoomEquipment && $activityRoomEquipment != '')
492 - <div class="info-row">
493 - <span class="info-label">生徒会室の設備</span>
494 - <span class="info-value free-text-value">$!escapetool.xml($activityRoomEquipment)</span>
495 - </div>
496 - #end
497 - #if($activityRoomImage && $activityRoomImage != '')
498 - <div class="info-row">
499 - <span class="info-label">活動場所の写真</span>
500 - <span class="info-value"><div class="school-org-img-wrap"><img src="$doc.getAttachmentURL($activityRoomImage)" alt="活動場所の写真" class="org-chart-img" /></div></span>
501 - </div>
502 - #end
503 - #if($ictTools && !$ictTools.isEmpty())
504 - <div class="info-row">
505 - <span class="info-label">利用しているICTツール</span>
506 - <span class="info-value">
507 - #set($ictCatDisplay = [
508 - ["連絡ツール", ["メール","LINE","LINE WORKS","Discord","Slack","Microsoft Teams","Google Chat","InstagramのDM","XのDM","その他(連絡)"]],
509 - ["ドキュメント作成・共有", ["Googleドキュメント","Googleスプレッドシート","Googleスライド","Googleドライブ","Word","Excel","PowerPoint","OneDrive","SharePoint","Notion","Pages","Numbers","Keynote","Dropbox","Box","その他(ドキュメント)"]],
510 - ["タスク管理", ["Googleカレンダー","Google ToDoリスト","Trello","Asana","Excel等スプレッドシート","その他(タスク管理)"]],
511 - ["ビデオ会議ツール", ["Zoom","Google Meet","その他(ビデオ会議)"]],
512 - ["アンケート", ["Googleフォーム","Microsoft Forms","その他(アンケート)"]],
513 - ["デザイン・クリエイティブ", ["Canva","各種Adobe","CapCut","LumaFusion","AviUtl","ibisPaint","その他(デザイン)"]],
514 - ["その他", ["独自のWebシステム・自作アプリ"]]
515 - ])
516 - #foreach($catD in $ictCatDisplay)
517 - #set($catHasItems = false)
518 - #foreach($t in $catD.get(1))
519 - #if($ictTools.contains($t)) #set($catHasItems = true) #end
520 - #end
521 - #if($catHasItems)
522 - <div style="margin-bottom:6px">
523 - <span style="font-size:0.8em;font-weight:600;color:var(--text-mid)">$catD.get(0):</span>
524 - <div class="selection-display" style="margin-top:2px">
525 - #foreach($t in $catD.get(1))
526 - #if($ictTools.contains($t))
527 - <span class="selection-item">$!escapetool.xml($t)</span>
528 - #end
529 - #end
530 - </div>
531 - </div>
532 - #end
533 - #end
534 - </span>
535 - </div>
536 - #end
537 - #if($ictUsage && !$ictUsage.isEmpty())
538 - <div class="info-row">
539 - <span class="info-label">ICT活用している場面</span>
540 - <span class="info-value">
541 - <div class="selection-display">
542 - #foreach($iu in $ictUsage)
543 - <span class="selection-item">$!escapetool.xml($iu.trim())</span>
544 - #end
545 - </div>
546 - </span>
547 - </div>
548 - #end
549 - </div>
550 - </div>
551 - #else
552 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 活動環境情報は #if($visibilityActivityEnv == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
553 - #end
554 - #end
555 -
556 - ## --- 年間主要行事 ---
557 - #set($months = [["4月", $eventApril], ["5月", $eventMay], ["6月", $eventJune], ["7月", $eventJuly], ["8月", $eventAugust], ["9月", $eventSeptember], ["10月", $eventOctober], ["11月", $eventNovember], ["12月", $eventDecember], ["1月", $eventJanuary], ["2月", $eventFebruary], ["3月", $eventMarch]])
558 - #set($hasAnyEvent = false)
559 - #foreach($m in $months)
560 - #if($m.get(1) && $m.get(1) != '') #set($hasAnyEvent = true) #end
561 - #end
562 - #if($hasAnyEvent)
563 - #set($canViewAN = true)
564 - #if($visibilityAnnualEvents == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAN = false)
565 - #elseif($visibilityAnnualEvents == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAN = false)
566 - #end
567 - #if($canViewAN)
568 - <div class="seitokai-subsection">
569 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> 年間主要行事 #if($visibilityAnnualEvents != '' && $visibilityAnnualEvents != 'public')<span class="visibility-badge visibility-${visibilityAnnualEvents}">#if($visibilityAnnualEvents == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
570 - <div class="seitokai-subsection-content">
571 - <table class="wiki-table school-info-table" style="margin:0">
572 - #foreach($m in $months)
573 - #if($m.get(1) && $m.get(1) != '')
574 - <tr><td style="width:60px;font-weight:600;white-space:nowrap">$m.get(0)</td><td>$!escapetool.xml($m.get(1))</td></tr>
575 - #end
576 - #end
577 - </table>
578 - </div>
579 - </div>
580 - #else
581 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 年間主要行事情報は #if($visibilityAnnualEvents == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
582 - #end
583 - #end
584 -
585 585   ## --- 日常の活動 ---
586 586   #if($dailyActivities && !$dailyActivities.isEmpty())
587 - #set($canViewDA = true)
588 - #if($visibilityDailyActivities == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewDA = false)
589 - #elseif($visibilityDailyActivities == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewDA = false)
590 - #end
591 - #if($canViewDA)
592 592   <div class="seitokai-subsection">
593 - <h3 class="seitokai-subsection-title"><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> 日常の活動 #if($visibilityDailyActivities != '' && $visibilityDailyActivities != 'public')<span class="visibility-badge visibility-${visibilityDailyActivities}">#if($visibilityDailyActivities == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
360 + <h3 class="seitokai-subsection-title"><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>
594 594   <div class="seitokai-subsection-content">
595 - <p class="activity-hint">活動時間多い3つ</p>
362 + <p class="activity-hint">活動時間多い順に上位3つ</p>
596 596   <div class="tag-container">
364 + #set($daIdx = 1)
597 597   #foreach($da in $dailyActivities)
598 - <span class="tag tag-accent">$!escapetool.xml($da.trim())</span>
366 + <span class="tag tag-accent">${daIdx}. $!escapetool.xml($da.trim())</span>
367 + #set($daIdx = $daIdx + 1)
599 599   #end
600 600   </div>
601 601   #if($dailyActivitiesNote && $dailyActivitiesNote.trim() != '')
... ... @@ -603,104 +603,12 @@
603 603   #end
604 604   </div>
605 605   </div>
606 - #else
607 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 日常の活動情報は #if($visibilityDailyActivities == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
608 - #end
609 609   #end
610 610  
611 - ## --- 定例活動 ---
612 - #if($meetingFrequency && $meetingFrequency != '')
613 - #set($canViewMT = true)
614 - #if($visibilityMeeting == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewMT = false)
615 - #elseif($visibilityMeeting == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewMT = false)
616 - #end
617 - #if($canViewMT)
618 - <div class="seitokai-subsection">
619 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> 定例活動 #if($visibilityMeeting != '' && $visibilityMeeting != 'public')<span class="visibility-badge visibility-${visibilityMeeting}">#if($visibilityMeeting == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
620 - <div class="seitokai-subsection-content">
621 - <div class="info-row">
622 - <span class="info-label">役員定例会の頻度</span>
623 - <span class="info-value">$!escapetool.xml($!meetingFrequency)</span>
624 - </div>
625 - #if($regularActivitiesNote && $regularActivitiesNote.trim() != '')
626 - <div class="free-note">$!escapetool.xml($regularActivitiesNote)</div>
627 - #end
628 - </div>
629 - </div>
630 - #else
631 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 定例活動情報は #if($visibilityMeeting == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
632 - #end
633 - #end
634 -
635 - ## --- 生徒総会 ---
636 - #set($hasAssembly = ($assemblyFormat && $assemblyFormat != '') || ($assemblyCount && $assemblyCount > 0) || ($assemblyAgenda && !$assemblyAgenda.isEmpty()) || ($assemblyTopics && !$assemblyTopics.isEmpty()) || ($assemblyNote && $assemblyNote != ''))
637 - #if($hasAssembly)
638 - #set($canViewAS = true)
639 - #if($visibilityAssembly == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAS = false)
640 - #elseif($visibilityAssembly == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAS = false)
641 - #end
642 - #if($canViewAS)
643 - <div class="seitokai-subsection">
644 - <h3 class="seitokai-subsection-title"><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> 生徒総会 #if($visibilityAssembly != '' && $visibilityAssembly != 'public')<span class="visibility-badge visibility-${visibilityAssembly}">#if($visibilityAssembly == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
645 - <div class="seitokai-subsection-content">
646 - #if($assemblyFormat && $assemblyFormat != '')
647 - <div class="info-row">
648 - <span class="info-label">開催方式</span>
649 - <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($assemblyFormat)</span></span>
650 - </div>
651 - #end
652 - #if($assemblyCount && $assemblyCount > 0)
653 - <div class="info-row">
654 - <span class="info-label">開催回数(年)</span>
655 - <span class="info-value">$!escapetool.xml($assemblyCount)回</span>
656 - </div>
657 - #end
658 - #if($assemblyAgenda && !$assemblyAgenda.isEmpty())
659 - <div class="info-row">
660 - <span class="info-label">議案の集め方</span>
661 - <span class="info-value">
662 - <div class="selection-display">
663 - #foreach($aa in $assemblyAgenda)
664 - <span class="selection-item">$!escapetool.xml($aa.trim())</span>
665 - #end
666 - </div>
667 - </span>
668 - </div>
669 - #end
670 - #if($assemblyTopics && !$assemblyTopics.isEmpty())
671 - <div class="info-row">
672 - <span class="info-label">扱う内容</span>
673 - <span class="info-value">
674 - <div class="selection-display">
675 - #foreach($at in $assemblyTopics)
676 - <span class="selection-item">$!escapetool.xml($at.trim())</span>
677 - #end
678 - </div>
679 - </span>
680 - </div>
681 - #end
682 - #if($assemblyNote && $assemblyNote != '')
683 - <div class="info-row">
684 - <span class="info-label">自由記述</span>
685 - <span class="info-value free-text-value">$!escapetool.xml($assemblyNote)</span>
686 - </div>
687 - #end
688 - </div>
689 - </div>
690 - #else
691 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 生徒総会情報は #if($visibilityAssembly == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
692 - #end
693 - #end
694 -
695 695   ## --- 選挙 ---
696 696   #if($electionExists && $electionExists != '')
697 - #set($canViewEL = true)
698 - #if($visibilityElection == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewEL = false)
699 - #elseif($visibilityElection == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewEL = false)
700 - #end
701 - #if($canViewEL)
702 702   <div class="seitokai-subsection">
703 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 13l3 3 7-7"/></svg> 選挙 #if($visibilityElection != '' && $visibilityElection != 'public')<span class="visibility-badge visibility-${visibilityElection}">#if($visibilityElection == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
380 + <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M7 13l3 3 7-7"/></svg> 選挙</h3>
704 704   <div class="seitokai-subsection-content">
705 705   <div class="info-row">
706 706   <span class="info-label">役員選挙</span>
... ... @@ -717,74 +717,22 @@
717 717   #end
718 718   </div>
719 719   </div>
720 - #else
721 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 選挙情報は #if($visibilityElection == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
722 - #end
723 723   #end
724 724  
725 - ## --- 校則・生徒会会則の見直し ---
726 - #if($ruleReviewStatus && $ruleReviewStatus != '')
727 - #set($canViewRuleReview = true)
728 - #if($visibilityRuleReview == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewRuleReview = false)
729 - #elseif($visibilityRuleReview == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewRuleReview = false)
730 - #end
731 - #if($canViewRuleReview)
399 + ## --- 定例活動 ---
400 + #if($meetingFrequency && $meetingFrequency != '')
732 732   <div class="seitokai-subsection">
733 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M16 4h2a2 2 0 012 2v12a2 2 0 01-2 2h-2"/><path d="M8 4H6a2 2 0 00-2 2v12a2 2 0 002 2h2"/><line x1="12" y1="4" x2="12" y2="8"/><line x1="12" y1="16" x2="12" y2="20"/><line x1="8" y1="8" x2="16" y2="8"/><line x1="8" y1="16" x2="16" y2="16"/></svg> 校則・生徒会会則の見直し #if($visibilityRuleReview != 'public')<span class="visibility-badge visibility-${visibilityRuleReview}">#if($visibilityRuleReview == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
402 + <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="16" y1="2" x2="16" y2="6"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="3" y1="10" x2="21" y2="10"/></svg> 定例活動</h3>
734 734   <div class="seitokai-subsection-content">
735 735   <div class="info-row">
736 - <span class="info-label">見直し有無(3年以内)</span>
737 - <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($!ruleReviewStatus)</span></span>
405 + <span class="info-label">役員定例会頻度</span>
406 + <span class="info-value">$!escapetool.xml($!meetingFrequency)</span>
738 738   </div>
739 - #if($ruleReviewStatus != '実施なし')
740 - #if($ruleReviewContent && !$ruleReviewContent.isEmpty())
741 - <div class="info-row">
742 - <span class="info-label">見直しの内容</span>
743 - <span class="info-value">
744 - <div class="selection-display">
745 - #foreach($rc in $ruleReviewContent)
746 - <span class="selection-item">$!escapetool.xml($rc.trim())</span>
747 - #end
748 - </div>
749 - </span>
750 - </div>
408 + #if($regularActivitiesNote && $regularActivitiesNote.trim() != '')
409 + <div class="free-note">$!escapetool.xml($regularActivitiesNote)</div>
751 751   #end
752 - #if($ruleReviewProposer && !$ruleReviewProposer.isEmpty())
753 - <div class="info-row">
754 - <span class="info-label">見直しの提案者</span>
755 - <span class="info-value">
756 - <div class="selection-display">
757 - #foreach($rp in $ruleReviewProposer)
758 - <span class="selection-item">$!escapetool.xml($rp.trim())</span>
759 - #end
760 - </div>
761 - </span>
762 - </div>
763 - #end
764 - #if($ruleReviewImplementer && !$ruleReviewImplementer.isEmpty())
765 - <div class="info-row">
766 - <span class="info-label">見直しの実施者</span>
767 - <span class="info-value">
768 - <div class="selection-display">
769 - #foreach($ri in $ruleReviewImplementer)
770 - <span class="selection-item">$!escapetool.xml($ri.trim())</span>
771 - #end
772 - </div>
773 - </span>
774 - </div>
775 - #end
776 - #end
777 - #if($ruleReviewSystem && $ruleReviewSystem != '')
778 - <div class="info-row">
779 - <span class="info-label">見直しの仕組み</span>
780 - <span class="info-value">$!escapetool.xml($!ruleReviewSystem)</span>
781 - </div>
782 - #end
783 783   </div>
784 784   </div>
785 - #else
786 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 校則・生徒会会則の見直し情報は #if($visibilityRuleReview == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
787 - #end
788 788   #end
789 789  
790 790   ## --- 予算 ---
... ... @@ -791,12 +791,12 @@
791 791   #set($hasBudget = ($budgetProcess && !$budgetProcess.isEmpty()) || ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != ''))
792 792   #if($hasBudget)
793 793   #set($canViewBudget = true)
794 - #if($visibilityBudget == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewBudget = false)
795 - #elseif($visibilityBudget == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewBudget = false)
419 + #if($visibilityBudget == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode && !$isAffiliated))) #set($canViewBudget = false)
420 + #elseif($visibilityBudget == 'school_trusted' && ($isGuest || (!$isViewerAdmin && (($viewerSchoolCode != $schoolCode && !$isAffiliated) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewBudget = false)
796 796   #end
797 797   #if($canViewBudget)
798 798   <div class="seitokai-subsection">
799 - <h3 class="seitokai-subsection-title"><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 == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
424 + <h3 class="seitokai-subsection-title"><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 == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
800 800   <div class="seitokai-subsection-content">
801 801   #if($budgetProcess && !$budgetProcess.isEmpty())
802 802   <div class="info-row">
... ... @@ -803,13 +803,8 @@
803 803   <span class="info-label">作成過程の生徒関与</span>
804 804   <span class="info-value">
805 805   <div class="selection-display">
806 - #set($allBpOpts = ["各部・委員会等への予算希望額調査","予算額調整(折衝等)","生徒会予算案の作成","生徒総会での議決","生徒関与なし","その他"])
807 - #foreach($bpOpt in $allBpOpts)
808 - #if($budgetProcess.contains($bpOpt))
809 - <span class="selection-item">$!escapetool.xml($bpOpt)</span>
810 - #else
811 - <span class="selection-item selection-item-off">$!escapetool.xml($bpOpt)</span>
812 - #end
431 + #foreach($bp in $budgetProcess)
432 + <span class="selection-item">$!escapetool.xml($bp.trim())</span>
813 813   #end
814 814   </div>
815 815   </span>
... ... @@ -849,87 +849,66 @@
849 849   #end
850 850   #end
851 851  
852 - ## --- 広報 ---
853 - #set($hasPublicity = ($publicityMethod && !$publicityMethod.isEmpty()) || ($publicityFrequency && $publicityFrequency != '') || ($publicityNote && $publicityNote != ''))
854 - #if($hasPublicity)
855 - #set($canViewPB = true)
856 - #if($visibilityPublicity == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewPB = false)
857 - #elseif($visibilityPublicity == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewPB = false)
472 + ## --- 校則の見直し ---
473 + #if($ruleReviewStatus && $ruleReviewStatus != '')
474 + #set($canViewRuleReview = true)
475 + #if($visibilityRuleReview == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode && !$isAffiliated))) #set($canViewRuleReview = false)
476 + #elseif($visibilityRuleReview == 'school_trusted' && ($isGuest || (!$isViewerAdmin && (($viewerSchoolCode != $schoolCode && !$isAffiliated) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewRuleReview = false)
858 858   #end
859 - #if($canViewPB)
478 + #if($canViewRuleReview)
860 860   <div class="seitokai-subsection">
861 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg> 広報 #if($visibilityPublicity != '' && $visibilityPublicity != 'public')<span class="visibility-badge visibility-${visibilityPublicity}">#if($visibilityPublicity == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
480 + <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><path d="M16 4h2a2 2 0 012 2v12a2 2 0 01-2 2h-2"/><path d="M8 4H6a2 2 0 00-2 2v12a2 2 0 002 2h2"/><line x1="12" y1="4" x2="12" y2="8"/><line x1="12" y1="16" x2="12" y2="20"/><line x1="8" y1="8" x2="16" y2="8"/><line x1="8" y1="16" x2="16" y2="16"/></svg> 校則の見直し #if($visibilityRuleReview != 'public')<span class="visibility-badge visibility-${visibilityRuleReview}">#if($visibilityRuleReview == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
862 862   <div class="seitokai-subsection-content">
863 - #if($publicityMethod && !$publicityMethod.isEmpty())
864 864   <div class="info-row">
865 - <span class="info-label">方法</span>
483 + <span class="info-label">見直しの有無(3年以内)</span>
484 + <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($!ruleReviewStatus)</span></span>
485 + </div>
486 + #if($ruleReviewContent && !$ruleReviewContent.isEmpty())
487 + <div class="info-row">
488 + <span class="info-label">見直しの内容</span>
866 866   <span class="info-value">
867 867   <div class="selection-display">
868 - #foreach($pm in $publicityMethod)
869 - <span class="selection-item">$!escapetool.xml($pm.trim())</span>
491 + #foreach($rc in $ruleReviewContent)
492 + <span class="selection-item">$!escapetool.xml($rc.trim())</span>
870 870   #end
871 871   </div>
872 872   </span>
873 873   </div>
874 874   #end
875 - #if($publicityFrequency && $publicityFrequency != '')
498 + #if($ruleReviewProposer && !$ruleReviewProposer.isEmpty())
876 876   <div class="info-row">
877 - <span class="info-label">頻度</span>
878 - <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($publicityFrequency)</span></span>
500 + <span class="info-label">見直しの提案者</span>
501 + <span class="info-value">
502 + <div class="selection-display">
503 + #foreach($rp in $ruleReviewProposer)
504 + <span class="selection-item">$!escapetool.xml($rp.trim())</span>
505 + #end
506 + </div>
507 + </span>
879 879   </div>
880 880   #end
881 - #if($publicityNote && $publicityNote != '')
510 + #if($ruleReviewImplementer && !$ruleReviewImplementer.isEmpty())
882 882   <div class="info-row">
883 - <span class="info-label">自由記述</span>
884 - <span class="info-value free-text-value">$!escapetool.xml($publicityNote)</span>
885 - </div>
886 - #end
887 - </div>
888 - </div>
889 - #else
890 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 広報情報は #if($visibilityPublicity == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
891 - #end
892 - #end
893 -
894 - ## --- 外部連携 ---
895 - #set($hasExternal = ($externalCooperation && $externalCooperation != '') || ($externalOrgName && $externalOrgName != '') || ($socialParticipation && !$socialParticipation.isEmpty()))
896 - #if($hasExternal)
897 - #set($canViewEX = true)
898 - #if($visibilityExternal == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewEX = false)
899 - #elseif($visibilityExternal == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewEX = false)
900 - #end
901 - #if($canViewEX)
902 - <div class="seitokai-subsection">
903 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></svg> 外部連携 #if($visibilityExternal != '' && $visibilityExternal != 'public')<span class="visibility-badge visibility-${visibilityExternal}">#if($visibilityExternal == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
904 - <div class="seitokai-subsection-content">
905 - #if($externalCooperation && $externalCooperation != '')
906 - <div class="info-row">
907 - <span class="info-label">他校の生徒会との連携</span>
908 - <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($externalCooperation)</span></span>
909 - </div>
910 - #end
911 - #if($externalOrgName && $externalOrgName != '')
912 - <div class="info-row">
913 - <span class="info-label">参加している生徒会団体の名前</span>
914 - <span class="info-value">$!escapetool.xml($externalOrgName)</span>
915 - </div>
916 - #end
917 - #if($socialParticipation && !$socialParticipation.isEmpty())
918 - <div class="info-row">
919 - <span class="info-label">社会参加・地域連携・ボランティア</span>
512 + <span class="info-label">見直しの実施者</span>
920 920   <span class="info-value">
921 921   <div class="selection-display">
922 - #foreach($sp2 in $socialParticipation)
923 - <span class="selection-item">$!escapetool.xml($sp2.trim())</span>
515 + #foreach($ri in $ruleReviewImplementer)
516 + <span class="selection-item">$!escapetool.xml($ri.trim())</span>
924 924   #end
925 925   </div>
926 926   </span>
927 927   </div>
928 928   #end
522 + #if($ruleReviewSystem && $ruleReviewSystem != '')
523 + <div class="info-row">
524 + <span class="info-label">見直しの仕組み</span>
525 + <span class="info-value">$!escapetool.xml($!ruleReviewSystem)</span>
526 + </div>
527 + #end
929 929   </div>
930 930   </div>
931 931   #else
932 - <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 外部連携情報は #if($visibilityExternal == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
531 + <div class="visibility-restricted-notice"><svg class="ico" viewBox="0 0 24 24"><rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0110 0v4"/></svg> 校則の見直し情報は #if($visibilityRuleReview == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
933 933   #end
934 934   #end
935 935  
... ... @@ -936,12 +936,12 @@
936 936   ## --- 生徒会の課題意識 ---
937 937   #if($challenges && $challenges != '')
938 938   #set($canViewChallenges = true)
939 - #if($visibilityChallenges == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewChallenges = false)
940 - #elseif($visibilityChallenges == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewChallenges = false)
538 + #if($visibilityChallenges == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode && !$isAffiliated))) #set($canViewChallenges = false)
539 + #elseif($visibilityChallenges == 'school_trusted' && ($isGuest || (!$isViewerAdmin && (($viewerSchoolCode != $schoolCode && !$isAffiliated) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewChallenges = false)
941 941   #end
942 942   #if($canViewChallenges)
943 943   <div class="seitokai-subsection">
944 - <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg> 生徒会の課題意識 #if($visibilityChallenges != 'public')<span class="visibility-badge visibility-${visibilityChallenges}">#if($visibilityChallenges == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
543 + <h3 class="seitokai-subsection-title"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg> 生徒会の課題意識 #if($visibilityChallenges != 'public')<span class="visibility-badge visibility-${visibilityChallenges}">#if($visibilityChallenges == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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>
945 945   <div class="seitokai-subsection-content">
946 946   <div class="challenge-text">$!escapetool.xml($challenges)</div>
947 947   </div>
... ... @@ -965,11 +965,6 @@
965 965   <tr><th>YouTube</th><td>#if($seitokaiYoutube && $seitokaiYoutube != '')<a href="$!escapetool.xml($seitokaiYoutube)" target="_blank" rel="noopener"><svg class="ico" viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3"/></svg> YouTubeチャンネル</a>#else<span class="text-placeholder">未登録</span>#end</td></tr>
966 966   <tr><th>その他SNS</th><td>#if($seitokaiOtherSns && $seitokaiOtherSns != '')$!escapetool.xml($seitokaiOtherSns)#else<span class="text-placeholder">未登録</span>#end</td></tr>
967 967   </table>
968 - #set($infoEditDate = $!doc.getValue('lastInfoEditedDate'))
969 - #set($infoEditBy = $!doc.getValue('lastInfoEditedBy'))
970 - #if($infoEditDate && $infoEditDate != '')
971 - <div class="info-last-updated"><svg class="ico" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 基本情報の最終更新: $!escapetool.xml($infoEditBy) — $!escapetool.xml($infoEditDate)</div>
972 - #end
973 973  </div>
974 974  
975 975  {{/html}}
... ... @@ -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" onclick="switchActivityFY('$currentFYStr', this)">$currentFYStr 年度</button>
601 + <button class="activity-fy-tab active" 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 active" onclick="switchActivityFY('all', this)">全期間</button>
607 + <button class="activity-fy-tab" 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="タイトルのみ表示">
... ... @@ -1033,7 +1033,6 @@
1033 1033   <span class="author-legend-title">所属:</span>
1034 1034   <span class="author-legend-item"><span class="badge badge-school-internal-confirmed badge-sm"><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> 校内(確認済)</span> <span class="text-hint">所属が確認されたこの学校のユーザー</span></span>
1035 1035   <span class="author-legend-item"><span class="badge badge-school-internal badge-sm"><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> 校内</span> <span class="text-hint">この学校に所属登録しているユーザー</span></span>
1036 - <span class="author-legend-item"><span class="badge badge-alumni badge-sm"><svg class="ico" viewBox="0 0 24 24"><path d="M22 10l-10-5L2 10l10 5 10-5z"/><path d="M6 12v5c0 1.66 2.69 3 6 3s6-1.34 6-3v-5"/></svg> 卒業生</span> <span class="text-hint">この学校の卒業生</span></span>
1037 1037   <span class="author-legend-item"><span class="badge badge-school-external badge-sm"><svg class="ico" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><path d="M2 12h20"/><path d="M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"/></svg> 他校</span> <span class="text-hint">別の学校に所属しているユーザー</span></span>
1038 1038   <span class="author-legend-item text-hint">※一般アカウントは所属バッジが表示されません</span>
1039 1039   </div>
... ... @@ -1049,67 +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($fyInt = $mathtool.toInteger($fy))
1058 - #if($fyInt)
1059 - #set($discard = $fyNums.add($fyInt))
1060 - #end
1061 - #end
1062 -#end
1063 -## 最大値を順番に取り出して降順リストを構築(最大20年度まで対応)
1064 -#set($fyDesc = [])
1065 -#set($fyRemaining = [])
1066 -#foreach($fy in $fyNums)
1067 - #set($discard = $fyRemaining.add($fy))
1068 -#end
1069 -#foreach($dummy in [1..20])
1070 - #if($fyRemaining.isEmpty())#break#end
1071 - #set($fyMax = $fyRemaining.get(0))
1072 - #foreach($fy in $fyRemaining)
1073 - #if($fy > $fyMax)#set($fyMax = $fy)#end
1074 - #end
1075 - #set($discard = $fyDesc.add($fyMax))
1076 - #set($fyNextRem = [])
1077 - #set($fyMaxRemoved = false)
1078 - #foreach($fy in $fyRemaining)
1079 - #if(!$fyMaxRemoved && $fy == $fyMax)
1080 - #set($fyMaxRemoved = true)
645 +## 特色ある活動を先頭に表示するため、並び替え用リストを作成
646 +#set($featuredActivities = [])
647 +#set($normalActivities = [])
648 +#if($activities && $activities.size() > 0)
649 + #foreach($act in $activities)
650 + #set($isFeatured = $!act.getValue('featured'))
651 + #if($isFeatured == '1')
652 + #set($discard = $featuredActivities.add($foreach.index))
1081 1081   #else
1082 - #set($discard = $fyNextRem.add($fy))
654 + #set($discard = $normalActivities.add($foreach.index))
1083 1083   #end
1084 1084   #end
1085 - #set($fyRemaining = $fyNextRem)
1086 1086  #end
1087 -## 年度未設定の活動は末尾に表示(fySetに'unknown'は入らないため無条件追加)
1088 -#set($discard = $fyDesc.add('unknown'))
1089 -## Step2: 年度降順で featured → normal の順にインデックスを収集
1090 1090  #set($orderedActivityIndices = [])
1091 -#foreach($curFY in $fyDesc)
1092 - ## 同年度の特色あり活動を先頭に
1093 - #set($actIdx2 = 0)
1094 - #foreach($act in $activities)
1095 - #set($aFY2 = $!act.getValue('fiscalYear'))
1096 - #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end
1097 - #if($aFY2 == $curFY && $act.getValue('featured') == '1')
1098 - #set($discard = $orderedActivityIndices.add($actIdx2))
1099 - #end
1100 - #set($actIdx2 = $actIdx2 + 1)
1101 - #end
1102 - ## 同年度の通常活動
1103 - #set($actIdx2 = 0)
1104 - #foreach($act in $activities)
1105 - #set($aFY2 = $!act.getValue('fiscalYear'))
1106 - #if(!$aFY2 || $aFY2 == '') #set($aFY2 = 'unknown') #end
1107 - #if($aFY2 == $curFY && $act.getValue('featured') != '1')
1108 - #set($discard = $orderedActivityIndices.add($actIdx2))
1109 - #end
1110 - #set($actIdx2 = $actIdx2 + 1)
1111 - #end
1112 -#end
659 +#set($discard = $orderedActivityIndices.addAll($featuredActivities))
660 +#set($discard = $orderedActivityIndices.addAll($normalActivities))
1113 1113  
1114 1114  #if($activities && $activities.size() > 0)
1115 1115   #foreach($actIdx in $orderedActivityIndices)
... ... @@ -1154,18 +1154,16 @@
1154 1154  <div class="activity-thread" data-fiscal-year="$!escapetool.xml($actFY)">
1155 1155   <div class="activity-thread-header">
1156 1156   <div class="activity-thread-title">
1157 - <h3 #if($actFeatured == '1')class="featured-title"#end>#if($actFeatured == '1')<svg class="ico ico-fixed-14 ico-star-offset" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg> #end$!escapetool.xml($!actTitle)</h3>
1158 - <div class="activity-meta-line">
1159 - <span class="activity-meta">$!escapetool.xml($!actCommittee) | $!escapetool.xml($!actPeriod) #if($actFY != 'unknown')| $!escapetool.xml($actFY)年度#end</span>
1160 - #set($actTagsList = $activity.getValue('tags'))
1161 - #if($actTagsList && !$actTagsList.isEmpty())
1162 - #foreach($tagItem in $actTagsList)
1163 - #if($tagItem && $tagItem.trim() != '')<span class="activity-tag-badge">$escapetool.xml($tagItem)</span>#end
1164 - #end
705 + <h3 #if($actFeatured == '1')class="featured-title"#end>$!escapetool.xml($!actTitle) #if($actFeatured == '1')<svg class="ico ico-fixed-14 ico-star-offset" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>#end</h3>
706 + <span class="activity-meta">$!escapetool.xml($!actCommittee) | $!escapetool.xml($!actPeriod) #if($actFY != 'unknown')| $!escapetool.xml($actFY)年度#end</span>
707 + #set($actTagsList = $activity.getValue('tags'))
708 + #if($actTagsList && !$actTagsList.isEmpty())
709 + #foreach($tagItem in $actTagsList)
710 + #if($tagItem && $tagItem.trim() != '')<span class="activity-tag-badge">$escapetool.xml($tagItem)</span>#end
1165 1165   #end
1166 - </div>
712 + #end
1167 1167   </div>
1168 - <div class="thread-meta-right">
714 + <div class="thread-meta-row">
1169 1169   <span class="thread-post-count">${reportCount}件の報告 ・ ${commentCount}件のコメント</span>
1170 1170   #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified' || $viewerAccountType == 'referred')
1171 1171   #if($actFeatured == '1')
... ... @@ -1225,8 +1225,8 @@
1225 1225   #set($postVis = $!post.getValue('visibility'))
1226 1226   #if(!$postVis || $postVis == '') #set($postVis = 'public') #end
1227 1227   #set($canViewPost = true)
1228 - #if($postVis == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewPost = false)
1229 - #elseif($postVis == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewPost = false)
774 + #if($postVis == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode && !$isAffiliated))) #set($canViewPost = false)
775 + #elseif($postVis == 'school_trusted' && ($isGuest || (!$isViewerAdmin && (($viewerSchoolCode != $schoolCode && !$isAffiliated) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewPost = false)
1230 1230   #end
1231 1231   #if(!$canViewPost)
1232 1232   <div class="thread-post visibility-restricted-post">
... ... @@ -1270,11 +1270,8 @@
1270 1270   <span class="badge badge-general badge-sm">一般</span>
1271 1271   #end
1272 1272   ## 所属バッジ(投稿者の学校コードとページの学校コードを比較)
1273 - #set($postIsSchoolMatch = ($postSchoolCode == $schoolCode || ($affiliatedSchoolCode != '' && $postSchoolCode == $affiliatedSchoolCode)))
1274 1274   #if($postSchoolCode && $postSchoolCode != '' && $postAccountType != 'general')
1275 - #if($postUserRole == 'graduate' && $postIsSchoolMatch)
1276 - <span class="badge badge-alumni badge-sm"><svg class="ico" viewBox="0 0 24 24"><path d="M22 10l-10-5L2 10l10 5 10-5z"/><path d="M6 12v5c0 1.66 2.69 3 6 3s6-1.34 6-3v-5"/></svg> 卒業生</span>
1277 - #elseif($postIsSchoolMatch && $postUserRole != 'graduate')
820 + #if($postSchoolCode == $schoolCode || ($affiliatedSchoolCode != '' && $postSchoolCode == $affiliatedSchoolCode))
1278 1278   #if($postAccountType == 'verified' || $postAccountType == 'admin')
1279 1279   <span class="badge badge-school-internal-confirmed badge-sm"><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> 校内(確認済)</span>
1280 1280   #else
... ... @@ -1301,13 +1301,6 @@
1301 1301   #if($postEdited == 1 || $postEdited == '1')
1302 1302   <span class="post-edited-label">(編集済み)</span>
1303 1303   #end
1304 - #set($postAuthorRefH = $!post.getValue('authorRef'))
1305 - #set($postObjNumH = $post.number)
1306 - #if(!$isGuest && $xcontext.user != $postAuthorRefH)
1307 - <button type="button" class="btn-post-report btn-post-report-header" onclick="openReportDialog(this, '${doc.fullName}', $postObjNumH, '${services.csrf.getToken()}')" title="この投稿を通報">
1308 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"/><line x1="4" y1="22" x2="4" y2="15"/></svg> 通報
1309 - </button>
1310 - #end
1311 1311   </div>
1312 1312   <div class="thread-post-body">
1313 1313   $!escapetool.xml($!postContent)
... ... @@ -1372,37 +1372,12 @@
1372 1372   #end
1373 1373   </div>
1374 1374   #if($postVis != 'public')
1375 - <div class="visibility-badge visibility-${postVis} post-action-mt">#if($postVis == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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</div>
911 + <div class="visibility-badge visibility-${postVis} post-action-mt">#if($postVis == 'school_trusted')<svg class="ico" viewBox="0 0 24 24"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></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</div>
1376 1376   #end
1377 - ## いいねボタン
1378 - #set($postLikeCount = $!post.getValue('likeCount'))
1379 - #if(!$postLikeCount || $postLikeCount == '') #set($postLikeCount = 0) #end
1380 - #set($postLikedBy = $!post.getValue('likedBy'))
1381 - #set($isLikedByMe = false)
1382 - #if($postLikedBy && $postLikedBy.contains($xcontext.user)) #set($isLikedByMe = true) #end
1383 - <div class="post-like-row post-action-mt">
1384 - #if($xcontext.user != 'XWiki.XWikiGuest')
1385 - <button type="button" class="btn-like #if($isLikedByMe)liked#end" data-page="$escapetool.xml($doc.fullName)" data-obj="$post.number" data-csrf="$services.csrf.getToken()" onclick="toggleLike(this)">
1386 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24" #if($isLikedByMe)fill="currentColor" stroke="none"#end><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
1387 - <span class="like-count">$postLikeCount</span>
1388 - </button>
1389 - #else
1390 - <span class="btn-like disabled">
1391 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>
1392 - <span class="like-count">$postLikeCount</span>
1393 - </span>
1394 - #end
1395 - </div>
1396 - ## 固定/編集/削除/通報/非表示ボタン(横並び)
1397 - #set($postAuthorRef = $!post.getValue('authorRef'))
1398 - #set($postObjNumED = $post.number)
1399 - #set($showPinBtn = ($viewerAccountType == 'admin' || $viewerAccountType == 'verified'))
1400 - #set($showEditDeleteBtn = ($xcontext.user == $postAuthorRef || $viewerAccountType == 'admin'))
1401 - #set($showHideBtn = ($viewerAccountType == 'admin'))
1402 - #if($showPinBtn || $showEditDeleteBtn || $showHideBtn)
1403 - <div class="post-edit-actions post-action-mt">
1404 - #if($showPinBtn)
1405 - #set($postObjNum = $post.number)
913 + ## 固定/解除ボタン(承認済み・管理者のみ)
914 + #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified')
915 + #set($postObjNum = $post.number)
916 + <div class="post-pin-action post-action-mt">
1406 1406   #if($isPinned == '1')
1407 1407   <a href="$doc.getURL('view', "action=unpin&postObj=${postObjNum}&form_token=${services.csrf.getToken()}")" class="btn-pin-toggle btn-unpin" title="固定を解除">
1408 1408   <svg class="ico ico-fixed-14" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M16 2l-4 4-2-1-5 5 3 3-6 6h4l4-4 3 3 5-5-1-2 4-4-5-5z"/></svg> 固定を解除
... ... @@ -1412,12 +1412,15 @@
1412 1412   <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M16 2l-4 4-2-1-5 5 3 3-6 6h4l4-4 3 3 5-5-1-2 4-4-5-5z"/></svg> 固定する
1413 1413   </a>
1414 1414   #end
1415 - #end
1416 - #if($showEditDeleteBtn)
926 + </div>
927 + #end
928 + ## 編集・削除ボタン(投稿者本人 or 管理者)
929 + #set($postAuthorRef = $!post.getValue('authorRef'))
930 + #set($postObjNumED = $post.number)
931 + #if($xcontext.user == $postAuthorRef || $viewerAccountType == 'admin')
932 + <div class="post-edit-actions post-action-mt">
1417 1417   #if($xcontext.user == $postAuthorRef)
1418 - #set($editImages = $!post.getValue('images'))
1419 - #set($editFiles = $!post.getValue('files'))
1420 - <button type="button" class="btn-post-edit" data-school="${doc.fullName}" data-obj="$postObjNumED" data-content="$!escapetool.xml($!postContent)" data-images="$!escapetool.xml($!editImages)" data-files="$!escapetool.xml($!editFiles)" data-post-type="$!post.getValue('postType')" onclick="openEditPost(this)" title="この投稿を編集">
934 + <button type="button" class="btn-post-edit" onclick="openEditPost(this, '${doc.fullName}', $postObjNumED, '$!escapetool.javascript($!postContent)')" title="この投稿を編集">
1421 1421   <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z"/></svg> 編集
1422 1422   </button>
1423 1423   #end
... ... @@ -1424,12 +1424,6 @@
1424 1424   <button type="button" class="btn-post-delete" onclick="confirmDeletePost('${doc.fullName}', $postObjNumED, '${services.csrf.getToken()}')" title="この投稿を削除">
1425 1425   <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><polyline points="3 6 5 6 21 6"/><path d="M19 6v14a2 2 0 01-2 2H7a2 2 0 01-2-2V6m3 0V4a2 2 0 012-2h4a2 2 0 012 2v2"/></svg> 削除
1426 1426   </button>
1427 - #end
1428 - #if($showHideBtn)
1429 - <button type="button" class="btn-post-hide" onclick="openHideDialog(this, '${doc.fullName}', $postObjNumED, '${services.csrf.getToken()}')" title="この投稿を非表示にする">
1430 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M17.94 17.94A10.07 10.07 0 0112 20c-7 0-11-8-11-8a18.45 18.45 0 015.06-5.94M9.9 4.24A9.12 9.12 0 0112 4c7 0 11 8 11 8a18.5 18.5 0 01-2.16 3.19m-6.72-1.07a3 3 0 11-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg> 非表示
1431 - </button>
1432 - #end
1433 1433   </div>
1434 1434   #end
1435 1435   </div>
... ... @@ -1479,11 +1479,9 @@
1479 1479  
1480 1480   #if($xcontext.user != "XWiki.XWikiGuest")
1481 1481   <div class="thread-add-post">
1482 - #if($isSchoolMember || $isAlumniOfSchool || $isViewerAdmin)
1483 1483   <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=report" class="btn-thread-add">
1484 1484   + 活動報告を追加
1485 1485   </a>
1486 - #end
1487 1487   <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=comment" class="btn-thread-comment">
1488 1488   <svg class="ico" viewBox="0 0 24 24"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg> コメントを書く
1489 1489   </a>
... ... @@ -1513,68 +1513,10 @@
1513 1513  {{/html}}
1514 1514  #end
1515 1515  
1516 -## --- OGP / SNSシェア対応 ---
1517 -#set($ogpTitle = "${schoolName} — 生徒会Wiki")
1518 -#set($ogpDesc = "${schoolName}の生徒会活動情報。")
1519 -#if($prefecture && $prefecture != '') #set($ogpDesc = "${ogpDesc}${prefecture}") #end
1520 -#if($city && $city != '') #set($ogpDesc = "${ogpDesc}${city}。") #end
1521 -#if($dailyActivities && $dailyActivities != '') #set($ogpDesc = "${ogpDesc} 主な活動: ${dailyActivities}") #end
1522 -#set($ogpUrl = "https://${request.serverName}${doc.getURL()}")
1523 -
1524 1524  ## --- 年度タブ切り替え JavaScript ---
1525 1525  {{html clean="false"}}
1526 1526  <script>
1527 -// OGPメタタグ挿入
1528 -(function() {
1529 - var ogp = {
1530 - 'og:title': '$escapetool.javascript($ogpTitle)',
1531 - 'og:description': '$escapetool.javascript($ogpDesc)',
1532 - 'og:type': 'article',
1533 - 'og:url': '$escapetool.javascript($ogpUrl)',
1534 - 'og:site_name': '生徒会Wiki',
1535 - 'twitter:card': 'summary'
1536 - };
1537 - for (var p in ogp) {
1538 - var meta = document.createElement('meta');
1539 - meta.setAttribute('property', p);
1540 - meta.setAttribute('content', ogp[p]);
1541 - document.head.appendChild(meta);
1542 - }
1543 - // twitter用
1544 - var tw = document.createElement('meta');
1545 - tw.setAttribute('name', 'twitter:card');
1546 - tw.setAttribute('content', 'summary');
1547 - document.head.appendChild(tw);
1548 -})();
1549 1549  // コンパクト表示(タイトルのみ)トグル
1550 -// いいねトグル
1551 -function toggleLike(btn) {
1552 - var page = btn.getAttribute('data-page');
1553 - var obj = btn.getAttribute('data-obj');
1554 - var csrf = btn.getAttribute('data-csrf');
1555 - btn.disabled = true;
1556 - var fd = new FormData();
1557 - fd.append('page', page);
1558 - fd.append('obj', obj);
1559 - fd.append('form_token', csrf);
1560 - fetch('/bin/SeitokaiCode/LikePost', { method: 'POST', body: fd })
1561 - .then(function(r) { return r.json(); })
1562 - .then(function(data) {
1563 - btn.querySelector('.like-count').textContent = data.count;
1564 - if (data.action === 'liked') {
1565 - btn.classList.add('liked');
1566 - btn.querySelector('svg').setAttribute('fill', 'currentColor');
1567 - btn.querySelector('svg').setAttribute('stroke', 'none');
1568 - } else {
1569 - btn.classList.remove('liked');
1570 - btn.querySelector('svg').removeAttribute('fill');
1571 - btn.querySelector('svg').setAttribute('stroke', 'currentColor');
1572 - }
1573 - })
1574 - .catch(function() { alert('エラーが発生しました'); })
1575 - .finally(function() { btn.disabled = false; });
1576 -}
1577 -
1578 1578  function toggleCompactView() {
1579 1579   var container = document.querySelector('.xwiki-content') || document.body;
1580 1580   var isCompact = container.classList.toggle('activity-compact-view');
... ... @@ -1618,7 +1618,7 @@
1618 1618  }
1619 1619  // ページ読み込み時の初期化
1620 1620  document.addEventListener('DOMContentLoaded', function() {
1621 - // 年度タブを降順にソート(「全期間」タブは先頭に固定)
1069 + // 年度タブを降順にソート(「全期間」タブは末尾に固定)
1622 1622   var tabContainer = document.querySelector('.activity-fy-tabs');
1623 1623   if (tabContainer) {
1624 1624   var tabs = Array.from(tabContainer.querySelectorAll('.activity-fy-tab'));
... ... @@ -1635,11 +1635,11 @@
1635 1635   var bYear = parseInt(b.textContent) || 0;
1636 1636   return bYear - aYear;
1637 1637   });
1638 - // DOM再配置(全期間を先頭、年度タブを降順で続ける)
1639 - if (allTab) { tabContainer.appendChild(allTab); }
1086 + // DOM再配置
1640 1640   fyTabs.forEach(function(t) { tabContainer.appendChild(t); });
1088 + if (allTab) { tabContainer.appendChild(allTab); }
1641 1641   }
1642 - // デフォルトで全期間を表示
1090 + // デフォルトで現在の年度を表示
1643 1643   var defaultTab = document.querySelector('.activity-fy-tab.active');
1644 1644   if (defaultTab) { defaultTab.click(); }
1645 1645   // 保存成功時のトースト通知
... ... @@ -1692,15 +1692,7 @@
1692 1692   };
1693 1693   var toast = document.createElement('div');
1694 1694   toast.className = 'toast toast-' + type;
1695 - var iconSvg = icons[type] || '';
1696 - if (iconSvg) {
1697 - var iconSpan = document.createElement('span');
1698 - iconSpan.innerHTML = iconSvg;
1699 - toast.appendChild(iconSpan);
1700 - }
1701 - var msgSpan = document.createElement('span');
1702 - msgSpan.textContent = message;
1703 - toast.appendChild(msgSpan);
1143 + toast.innerHTML = (icons[type] || '') + '<span>' + message + '</span>';
1704 1704   container.appendChild(toast);
1705 1705   setTimeout(function() { toast.remove(); }, 3200);
1706 1706  }
... ... @@ -1716,131 +1716,37 @@
1716 1716  }
1717 1717  
1718 1718  // 投稿の編集(インライン編集フォームを開く)
1719 -function openEditPost(btn) {
1159 +function openEditPost(btn, schoolPage, postObjNum, currentContent) {
1720 1720   var postEl = btn.closest('.thread-post');
1721 1721   if (!postEl) return;
1162 + // 既存の編集フォームがあれば閉じる
1722 1722   var existing = postEl.querySelector('.post-edit-form');
1723 1723   if (existing) { existing.remove(); return; }
1724 1724   var bodyEl = postEl.querySelector('.thread-post-body');
1725 1725   if (!bodyEl) return;
1726 -
1727 - var schoolPage = btn.getAttribute('data-school');
1728 - var postObjNum = btn.getAttribute('data-obj');
1729 - var currentContent = btn.getAttribute('data-content') || '';
1730 - var currentImages = btn.getAttribute('data-images') || '';
1731 - var currentFiles = btn.getAttribute('data-files') || '';
1732 - var postType = btn.getAttribute('data-post-type') || 'report';
1733 -
1734 1734   var form = document.createElement('div');
1735 1735   form.className = 'post-edit-form';
1736 - form.setAttribute('data-school', schoolPage);
1737 - form.setAttribute('data-obj', postObjNum);
1738 -
1739 - var html = '<textarea id="editContent_' + postObjNum + '">' + currentContent.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</textarea>';
1740 -
1741 - // コメント以外は添付ファイル編集を表示
1742 - function escAttr(s) { return s.replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#39;').replace(/</g,'&lt;').replace(/>/g,'&gt;'); }
1743 - if (postType !== 'comment') {
1744 - // 既存画像
1745 - html += '<div class="edit-attachments">';
1746 - if (currentImages.trim()) {
1747 - html += '<div class="edit-attach-section"><span class="edit-attach-label">画像</span>';
1748 - var imgs = currentImages.trim().split('\n');
1749 - for (var i = 0; i < imgs.length; i++) {
1750 - var img = imgs[i].trim();
1751 - if (!img) continue;
1752 - html += '<div class="edit-attach-item" data-name="' + escAttr(img) + '">' +
1753 - '<img src="/xwiki/bin/download/' + schoolPage.replace(/\./g,'/') + '/' + encodeURIComponent(img) + '" class="edit-attach-thumb" />' +
1754 - '<button type="button" class="edit-attach-remove" onclick="removeEditAttach(this)" title="削除">✕</button>' +
1755 - '<input type="hidden" name="keepImages" value="' + escAttr(img) + '" />' +
1756 - '</div>';
1757 - }
1758 - html += '</div>';
1759 - }
1760 - // 既存ファイル
1761 - if (currentFiles.trim()) {
1762 - html += '<div class="edit-attach-section"><span class="edit-attach-label">ファイル</span>';
1763 - var files = currentFiles.trim().split('\n');
1764 - for (var j = 0; j < files.length; j++) {
1765 - var f = files[j].trim();
1766 - if (!f) continue;
1767 - var displayName = f;
1768 - if (/^file_\d{14}_\d+_/.test(f)) displayName = f.replace(/^file_\d{14}_\d+_/, '');
1769 - html += '<div class="edit-attach-item" data-name="' + escAttr(f) + '">' +
1770 - '<span class="edit-attach-fname">' + escAttr(displayName) + '</span>' +
1771 - '<button type="button" class="edit-attach-remove" onclick="removeEditAttach(this)" title="削除">✕</button>' +
1772 - '<input type="hidden" name="keepFiles" value="' + escAttr(f) + '" />' +
1773 - '</div>';
1774 - }
1775 - html += '</div>';
1776 - }
1777 - // 新規追加
1778 - html += '<div class="edit-attach-add">' +
1779 - '<label class="form-label-sm">画像を追加(最大4枚まで)</label>' +
1780 - '<input type="file" name="editNewImages" accept="image/*" multiple class="form-file-input-sm" />' +
1781 - '<div class="form-hint">JPEG / PNG / GIF / WebP、各5MBまで</div>' +
1782 - '<label class="form-label-sm" style="margin-top:8px;">ファイルを追加(最大2つまで)</label>' +
1783 - '<input type="file" name="editNewFiles" accept=".pdf,.docx,.xlsx,.pptx" multiple class="form-file-input-sm" />' +
1784 - '<div class="form-hint">PDF / Word / Excel / PowerPoint、各10MBまで</div>' +
1785 - '</div>';
1786 - html += '</div>';
1787 - }
1788 -
1789 - html += '<div class="post-edit-form-actions">' +
1169 + form.innerHTML = '<textarea id="editContent_' + postObjNum + '">' + currentContent.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</textarea>' +
1170 + '<div class="post-edit-form-actions">' +
1790 1790   '<button type="button" class="btn-cancel-edit" onclick="this.closest(\'.post-edit-form\').remove()">キャンセル</button>' +
1791 - '<button type="button" class="btn-save" onclick="saveEditPost(this)">保存</button>' +
1172 + '<button type="button" class="btn-save" onclick="saveEditPost(\'' + schoolPage + '\', ' + postObjNum + ')">保存</button>' +
1792 1792   '</div>';
1793 -
1794 - form.innerHTML = html;
1795 1795   bodyEl.parentNode.insertBefore(form, bodyEl.nextSibling);
1796 1796   form.querySelector('textarea').focus();
1797 1797  }
1798 1798  
1799 -function removeEditAttach(btn) {
1800 - var item = btn.closest('.edit-attach-item');
1801 - if (item) item.remove();
1802 -}
1803 -
1804 1804  // 投稿の編集を保存
1805 -function saveEditPost(btn) {
1806 - var formEl = btn.closest('.post-edit-form');
1807 - if (!formEl) return;
1808 - var schoolPage = formEl.getAttribute('data-school');
1809 - var postObjNum = formEl.getAttribute('data-obj');
1810 - var textarea = formEl.querySelector('textarea');
1179 +function saveEditPost(schoolPage, postObjNum) {
1180 + var textarea = document.getElementById('editContent_' + postObjNum);
1811 1811   if (!textarea) return;
1812 1812   var newContent = textarea.value.trim();
1813 1813   if (!newContent) { alert('投稿内容を入力してください'); return; }
1814 -
1815 1815   var csrfEl = document.querySelector('input[name="form_token"]');
1816 1816   var csrfToken = csrfEl ? csrfEl.value : '';
1817 -
1818 - var fd = new FormData();
1819 - fd.append('schoolPage', schoolPage);
1820 - fd.append('postObj', postObjNum);
1821 - fd.append('newContent', newContent);
1822 - fd.append('form_token', csrfToken);
1823 -
1824 - // 残す画像・ファイル
1825 - formEl.querySelectorAll('input[name="keepImages"]').forEach(function(el) { fd.append('keepImages', el.value); });
1826 - formEl.querySelectorAll('input[name="keepFiles"]').forEach(function(el) { fd.append('keepFiles', el.value); });
1827 -
1828 - // 新規画像
1829 - var newImgInput = formEl.querySelector('input[name="editNewImages"]');
1830 - if (newImgInput && newImgInput.files) {
1831 - for (var i = 0; i < newImgInput.files.length; i++) { fd.append('editNewImages', newImgInput.files[i]); }
1832 - }
1833 - // 新規ファイル
1834 - var newFileInput = formEl.querySelector('input[name="editNewFiles"]');
1835 - if (newFileInput && newFileInput.files) {
1836 - for (var j = 0; j < newFileInput.files.length; j++) { fd.append('editNewFiles', newFileInput.files[j]); }
1837 - }
1838 -
1839 - btn.disabled = true;
1840 - btn.textContent = '保存中...';
1841 -
1842 1842   var xhr = new XMLHttpRequest();
1843 1843   xhr.open('POST', '/bin/get/SeitokaiCode/EditPost?outputSyntax=plain', true);
1188 + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1189 + var editPostData = 'schoolPage=' + encodeURIComponent(schoolPage) + '&postObj=' + postObjNum + '&newContent=' + encodeURIComponent(newContent) + '&form_token=' + encodeURIComponent(csrfToken);
1844 1844   xhr.onload = function() {
1845 1845   try {
1846 1846   var res = JSON.parse(xhr.responseText);
... ... @@ -1848,13 +1848,12 @@
1848 1848   showToast('投稿を更新しました', 'success');
1849 1849   setTimeout(function() { location.reload(); }, 800);
1850 1850   } else {
1851 - btn.disabled = false; btn.textContent = '保存';
1852 1852   alert('編集に失敗しました: ' + (res.error || ''));
1853 1853   }
1854 - } catch(e) { btn.disabled = false; btn.textContent = '保存'; alert('編集に失敗しました'); }
1199 + } catch(e) { alert('編集に失敗しました'); }
1855 1855   };
1856 - xhr.onerror = function() { btn.disabled = false; btn.textContent = '保存'; alert('通信エラーが発生しました'); };
1857 - xhr.send(fd);
1201 + xhr.onerror = function() { alert('通信エラーが発生しました'); };
1202 + xhr.send(editPostData);
1858 1858  }
1859 1859  
1860 1860  // 投稿の削除(確認ダイアログ付き)
... ... @@ -1878,80 +1878,6 @@
1878 1878   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1879 1879   xhr.send(deletePostData);
1880 1880  }
1881 -
1882 -/* --- 通報ダイアログ --- */
1883 -function openReportDialog(btn, targetPage, postObjNum, token) {
1884 - if (document.getElementById('report-dialog-overlay')) return;
1885 - var reasons = ['宣伝・スパム','不適切な内容','個人情報の露出','誹謗中傷','誤情報','その他'];
1886 - var overlay = document.createElement('div');
1887 - overlay.id = 'report-dialog-overlay';
1888 - overlay.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center;';
1889 - var dialog = document.createElement('div');
1890 - dialog.style.cssText = 'background:#fff;border-radius:12px;padding:24px;max-width:400px;width:90%;max-height:80vh;overflow-y:auto;';
1891 - var html = '<h3 style="margin:0 0 16px;font-size:1.1em;">投稿を通報</h3>';
1892 - html += '<p style="margin:0 0 12px;font-size:0.9em;color:#4b5563;">通報された投稿は管理者が確認するまで一時的に非表示になります。</p>';
1893 - html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">通報理由</label>';
1894 - html += '<select id="report-reason" style="width:100%;padding:8px;border:1px solid #d1d5db;border-radius:8px;margin-bottom:12px;font-size:0.9em;">';
1895 - for (var i=0; i<reasons.length; i++) html += '<option value="'+reasons[i]+'">'+reasons[i]+'</option>';
1896 - html += '</select>';
1897 - html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">補足コメント(任意)</label>';
1898 - html += '<textarea id="report-detail" rows="3" maxlength="500" style="width:100%;padding:8px;border:1px solid #d1d5db;border-radius:8px;resize:vertical;font-size:0.9em;box-sizing:border-box;" placeholder="具体的な内容があればご記入ください"></textarea>';
1899 - html += '<div style="display:flex;gap:8px;margin-top:16px;justify-content:flex-end;">';
1900 - html += '<button type="button" id="report-cancel-btn" style="padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;">キャンセル</button>';
1901 - html += '<button type="button" id="report-submit-btn" style="padding:8px 16px;border:none;border-radius:8px;background:#dc2626;color:#fff;cursor:pointer;font-weight:600;">通報する</button>';
1902 - html += '</div>';
1903 - dialog.innerHTML = html;
1904 - overlay.appendChild(dialog);
1905 - document.body.appendChild(overlay);
1906 - overlay.addEventListener('click', function(e) { if (e.target === overlay) overlay.remove(); });
1907 - document.getElementById('report-cancel-btn').addEventListener('click', function() { overlay.remove(); });
1908 - document.getElementById('report-submit-btn').addEventListener('click', function() {
1909 - var reason = document.getElementById('report-reason').value;
1910 - var detail = document.getElementById('report-detail').value;
1911 - var submitBtn = document.getElementById('report-submit-btn');
1912 - submitBtn.disabled = true; submitBtn.textContent = '送信中...';
1913 - var xhr = new XMLHttpRequest();
1914 - xhr.open('POST', '/bin/get/SeitokaiCode/ReportAction?outputSyntax=plain', true);
1915 - xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1916 - var data = 'targetPage=' + encodeURIComponent(targetPage) + '&targetPost=' + postObjNum + '&reason=' + encodeURIComponent(reason) + '&detail=' + encodeURIComponent(detail) + '&form_token=' + encodeURIComponent(token);
1917 - xhr.onload = function() {
1918 - overlay.remove();
1919 - showToast('通報を受け付けました', 'success');
1920 - setTimeout(function() { location.reload(); }, 1000);
1921 - };
1922 - xhr.onerror = function() { overlay.remove(); alert('通信エラーが発生しました'); };
1923 - xhr.send(data);
1924 - });
1925 -}
1926 -
1927 -/* --- 非表示ダイアログ(管理者用) --- */
1928 -function openHideDialog(btn, targetPage, postObjNum, token) {
1929 - if (document.getElementById('hide-dialog-overlay')) return;
1930 - var overlay = document.createElement('div');
1931 - overlay.id = 'hide-dialog-overlay';
1932 - overlay.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,0.5);z-index:9999;display:flex;align-items:center;justify-content:center;';
1933 - var dialog = document.createElement('div');
1934 - dialog.style.cssText = 'background:#fff;border-radius:12px;padding:24px;max-width:400px;width:90%;';
1935 - var html = '<h3 style="margin:0 0 16px;font-size:1.1em;">投稿を非表示にする</h3>';
1936 - html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">非表示の理由</label>';
1937 - html += '<input type="text" id="hide-reason" style="width:100%;padding:8px;border:1px solid #d1d5db;border-radius:8px;margin-bottom:12px;font-size:0.9em;box-sizing:border-box;" placeholder="理由を入力" />';
1938 - html += '<div style="display:flex;gap:8px;margin-top:16px;justify-content:flex-end;">';
1939 - html += '<button type="button" id="hide-cancel-btn" style="padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;">キャンセル</button>';
1940 - html += '<button type="button" id="hide-submit-btn" style="padding:8px 16px;border:none;border-radius:8px;background:#d97706;color:#fff;cursor:pointer;font-weight:600;">非表示にする</button>';
1941 - html += '<button type="button" id="hide-warn-btn" style="padding:8px 16px;border:none;border-radius:8px;background:#dc2626;color:#fff;cursor:pointer;font-weight:600;">非表示+警告</button>';
1942 - html += '</div>';
1943 - dialog.innerHTML = html;
1944 - overlay.appendChild(dialog);
1945 - document.body.appendChild(overlay);
1946 - overlay.addEventListener('click', function(e) { if (e.target === overlay) overlay.remove(); });
1947 - document.getElementById('hide-cancel-btn').addEventListener('click', function() { overlay.remove(); });
1948 - function doHide(action) {
1949 - var reason = document.getElementById('hide-reason').value || '管理者判断';
1950 - window.location.href = '/bin/view/SeitokaiCode/ModerationAction?action=' + action + '&targetPage=' + encodeURIComponent(targetPage) + '&targetPost=' + postObjNum + '&reason=' + encodeURIComponent(reason) + '&form_token=' + encodeURIComponent(token);
1951 - }
1952 - document.getElementById('hide-submit-btn').addEventListener('click', function() { doHide('hide'); });
1953 - document.getElementById('hide-warn-btn').addEventListener('click', function() { doHide('hide-warn'); });
1954 -}
1955 1955  </script>
1956 1956  {{/html}}
1957 1957  {{/velocity}}