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

From version Icon 98.1 Icon
edited by Super Admin
on 2026/03/20 18:16
Change comment: There is no comment for this version
To version Icon 112.1 Icon
edited by Super Admin
on 2026/03/25 01:50
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -7,6 +7,19 @@
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)" />
10 10  ## メンテナンスバナー({{include}}ではなくインラインで記述し、<p>タグ挿入を回避)
11 11  #set($bannerDoc = $xwiki.getDocument('SeitokaiAdmin.MaintenanceBanner'))
12 12  #set($bannerObj = $bannerDoc.getObject('SeitokaiCode.MaintenanceBannerClass'))
... ... @@ -145,6 +145,7 @@
145 145  #set($isGuest = $viewerUser == 'XWiki.XWikiGuest')
146 146  #set($isViewerAdmin = false)
147 147  #set($viewerSchoolCode = '')
161 +#set($viewerSecondaryGraduated = false)
148 148  #if(!$isGuest)
149 149   #set($viewerDoc = $xwiki.getDocument($viewerUser))
150 150   #set($viewerAccountType = $!viewerDoc.getValue('accountType'))
... ... @@ -154,6 +154,24 @@
154 154   #if($viewerAccountType == 'admin')
155 155   #set($isViewerAdmin = true)
156 156   #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
157 157  #end
158 158  
159 159  ## --- 関連校(中高一貫校)情報 ---
... ... @@ -163,7 +163,7 @@
163 163  #if($affiliatedSchoolCode && $affiliatedSchoolCode != '')
164 164   #if($viewerSchoolCode == $affiliatedSchoolCode)
165 165   #set($isAffiliated = true)
166 - #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $affiliatedSchoolCode)
198 + #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $affiliatedSchoolCode && !$viewerSecondaryGraduated)
167 167   #set($isAffiliated = true)
168 168   #end
169 169  #end
... ... @@ -173,7 +173,7 @@
173 173  #if(!$isGuest && $viewerUserRole != 'graduate')
174 174   #if($viewerSchoolCode == $schoolCode || $isAffiliated)
175 175   #set($isSchoolMember = true)
176 - #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $schoolCode)
208 + #elseif($viewerSecondarySchoolCode && $viewerSecondarySchoolCode != '' && $viewerSecondarySchoolCode == $schoolCode && !$viewerSecondaryGraduated)
177 177   #set($isSchoolMember = true)
178 178   #end
179 179  #end
... ... @@ -433,6 +433,123 @@
433 433   #end
434 434   #end
435 435  
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 +
436 436   ## --- 日常の活動 ---
437 437   #if($dailyActivities && !$dailyActivities.isEmpty())
438 438   #set($canViewDA = true)
... ... @@ -459,36 +459,6 @@
459 459   #end
460 460   #end
461 461  
462 - ## --- 選挙 ---
463 - #if($electionExists && $electionExists != '')
464 - #set($canViewEL = true)
465 - #if($visibilityElection == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewEL = false)
466 - #elseif($visibilityElection == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewEL = false)
467 - #end
468 - #if($canViewEL)
469 - <div class="seitokai-subsection">
470 - <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>
471 - <div class="seitokai-subsection-content">
472 - <div class="info-row">
473 - <span class="info-label">役員選挙</span>
474 - <span class="info-value">$!escapetool.xml($!electionExists)</span>
475 - </div>
476 - #if($electionType && $electionType != '')
477 - <div class="info-row">
478 - <span class="info-label">直近の選挙方式</span>
479 - <span class="info-value">$!escapetool.xml($!electionType)</span>
480 - </div>
481 - #end
482 - #if($electionNote && $electionNote.trim() != '')
483 - <div class="free-note">$!escapetool.xml($electionNote)</div>
484 - #end
485 - </div>
486 - </div>
487 - #else
488 - <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>
489 - #end
490 - #end
491 -
492 492   ## --- 定例活動 ---
493 493   #if($meetingFrequency && $meetingFrequency != '')
494 494   #set($canViewMT = true)
... ... @@ -513,68 +513,96 @@
513 513   #end
514 514   #end
515 515  
516 - ## --- 予算 ---
517 - #set($hasBudget = ($budgetProcess && !$budgetProcess.isEmpty()) || ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != ''))
518 - #if($hasBudget)
519 - #set($canViewBudget = true)
520 - #if($visibilityBudget == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewBudget = false)
521 - #elseif($visibilityBudget == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewBudget = false)
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)
522 522   #end
523 - #if($canViewBudget)
642 + #if($canViewAS)
524 524   <div class="seitokai-subsection">
525 - <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>
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>
526 526   <div class="seitokai-subsection-content">
527 - #if($budgetProcess && !$budgetProcess.isEmpty())
646 + #if($assemblyFormat && $assemblyFormat != '')
528 528   <div class="info-row">
529 - <span class="info-label">作成過程の生徒関与</span>
530 - <span class="info-value">
531 - <div class="selection-display">
532 - #set($allBpOpts = ["各部・委員会等への予算希望額調査","予算額調整(折衝等)","生徒会予算案の作成","生徒総会での議決","生徒関与なし","その他"])
533 - #foreach($bpOpt in $allBpOpts)
534 - #if($budgetProcess.contains($bpOpt))
535 - <span class="selection-item">$!escapetool.xml($bpOpt)</span>
536 - #else
537 - <span class="selection-item selection-item-off">$!escapetool.xml($bpOpt)</span>
538 - #end
539 - #end
540 - </div>
541 - </span>
648 + <span class="info-label">開催方式</span>
649 + <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($assemblyFormat)</span></span>
542 542   </div>
543 543   #end
544 - #if($studentFee && $studentFee != '')
652 + #if($assemblyCount && $assemblyCount > 0)
545 545   <div class="info-row">
546 - <span class="info-label">生徒会費(年)</span>
547 - <span class="info-value">$!escapetool.xml($!studentFee)</span>
654 + <span class="info-label">開催回数(年)</span>
655 + <span class="info-value">$!escapetool.xml($assemblyCount)</span>
548 548   </div>
549 549   #end
550 - #if($budgetScale && $budgetScale != '')
658 + #if($assemblyAgenda && !$assemblyAgenda.isEmpty())
551 551   <div class="info-row">
552 - <span class="info-label">予算規模</span>
553 - <span class="info-value">$!escapetool.xml($!budgetScale)</span>
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>
554 554   </div>
555 555   #end
556 - #if($budgetAllocation && !$budgetAllocation.isEmpty())
670 + #if($assemblyTopics && !$assemblyTopics.isEmpty())
557 557   <div class="info-row">
558 - <span class="info-label">主な予算配分</span>
672 + <span class="info-label">扱う内容</span>
559 559   <span class="info-value">
560 560   <div class="selection-display">
561 - #foreach($ba in $budgetAllocation)
562 - <span class="selection-item">$!escapetool.xml($ba.trim())</span>
675 + #foreach($at in $assemblyTopics)
676 + <span class="selection-item">$!escapetool.xml($at.trim())</span>
563 563   #end
564 564   </div>
565 565   </span>
566 566   </div>
567 567   #end
568 - #if($budgetNote && $budgetNote.trim() != '')
569 - <div class="free-note">$!escapetool.xml($budgetNote)</div>
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>
570 570   #end
571 571   </div>
572 572   </div>
573 573   #else
574 - <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($visibilityBudget == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
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>
575 575   #end
576 576   #end
577 577  
695 + ## --- 選挙 ---
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 + <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>
704 + <div class="seitokai-subsection-content">
705 + <div class="info-row">
706 + <span class="info-label">役員選挙</span>
707 + <span class="info-value">$!escapetool.xml($!electionExists)</span>
708 + </div>
709 + #if($electionType && $electionType != '')
710 + <div class="info-row">
711 + <span class="info-label">直近の選挙方式</span>
712 + <span class="info-value">$!escapetool.xml($!electionType)</span>
713 + </div>
714 + #end
715 + #if($electionNote && $electionNote.trim() != '')
716 + <div class="free-note">$!escapetool.xml($electionNote)</div>
717 + #end
718 + </div>
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 + #end
724 +
578 578   ## --- 校則・生徒会会則の見直し ---
579 579   #if($ruleReviewStatus && $ruleReviewStatus != '')
580 580   #set($canViewRuleReview = true)
... ... @@ -640,151 +640,65 @@
640 640   #end
641 641   #end
642 642  
643 - ## --- 活動環境 ---
644 - #set($hasActivityEnv = ($activityPlace && !$activityPlace.isEmpty()) || ($activityRoomEquipment && $activityRoomEquipment != '') || ($activityRoomImage && $activityRoomImage != '') || ($ictTools && !$ictTools.isEmpty()) || ($ictUsage && !$ictUsage.isEmpty()))
645 - #if($hasActivityEnv)
646 - #set($canViewAE = true)
647 - #if($visibilityActivityEnv == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAE = false)
648 - #elseif($visibilityActivityEnv == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAE = false)
790 + ## --- 予算 ---
791 + #set($hasBudget = ($budgetProcess && !$budgetProcess.isEmpty()) || ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != ''))
792 + #if($hasBudget)
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)
649 649   #end
650 - #if($canViewAE)
797 + #if($canViewBudget)
651 651   <div class="seitokai-subsection">
652 - <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>
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>
653 653   <div class="seitokai-subsection-content">
654 - #if($activityPlace && !$activityPlace.isEmpty())
801 + #if($budgetProcess && !$budgetProcess.isEmpty())
655 655   <div class="info-row">
656 - <span class="info-label">普段活動場所</span>
803 + <span class="info-label">作成過程生徒関与</span>
657 657   <span class="info-value">
658 658   <div class="selection-display">
659 - #foreach($ap in $activityPlace)
660 - <span class="selection-item">$!escapetool.xml($ap.trim())</span>
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
661 661   #end
662 662   </div>
663 663   </span>
664 664   </div>
665 665   #end
666 - #if($activityRoomEquipment && $activityRoomEquipment != '')
818 + #if($studentFee && $studentFee != '')
667 667   <div class="info-row">
668 - <span class="info-label">生徒会室の設備</span>
669 - <span class="info-value free-text-value">$!escapetool.xml($activityRoomEquipment)</span>
820 + <span class="info-label">生徒会費(年額)</span>
821 + <span class="info-value">$!escapetool.xml($!studentFee)</span>
670 670   </div>
671 671   #end
672 - #if($activityRoomImage && $activityRoomImage != '')
824 + #if($budgetScale && $budgetScale != '')
673 673   <div class="info-row">
674 - <span class="info-label">活動場所の写真</span>
675 - <span class="info-value"><div class="school-org-img-wrap"><img src="$doc.getAttachmentURL($activityRoomImage)" alt="活動場所の写真" class="org-chart-img" /></div></span>
826 + <span class="info-label">予算規模</span>
827 + <span class="info-value">$!escapetool.xml($!budgetScale)</span>
676 676   </div>
677 677   #end
678 - #if($ictTools && !$ictTools.isEmpty())
830 + #if($budgetAllocation && !$budgetAllocation.isEmpty())
679 679   <div class="info-row">
680 - <span class="info-label">利用しているICTツール</span>
832 + <span class="info-label">主な予算配分</span>
681 681   <span class="info-value">
682 - #set($ictCatDisplay = [
683 - ["連絡ツール", ["メール","LINE","LINE WORKS","Discord","Slack","Microsoft Teams","Google Chat","InstagramのDM","XのDM","その他(連絡)"]],
684 - ["ドキュメント作成・共有", ["Googleドキュメント","Googleスプレッドシート","Googleスライド","Googleドライブ","Word","Excel","PowerPoint","OneDrive","SharePoint","Notion","Pages","Numbers","Keynote","Dropbox","Box","その他(ドキュメント)"]],
685 - ["タスク管理", ["Googleカレンダー","Google ToDoリスト","Trello","Asana","Excel等スプレッドシート","その他(タスク管理)"]],
686 - ["ビデオ会議ツール", ["Zoom","Google Meet","その他(ビデオ会議)"]],
687 - ["アンケート", ["Googleフォーム","Microsoft Forms","その他(アンケート)"]],
688 - ["デザイン・クリエイティブ", ["Canva","各種Adobe","CapCut","LumaFusion","AviUtl","ibisPaint","その他(デザイン)"]],
689 - ["その他", ["独自のWebシステム・自作アプリ"]]
690 - ])
691 - #foreach($catD in $ictCatDisplay)
692 - #set($catHasItems = false)
693 - #foreach($t in $catD.get(1))
694 - #if($ictTools.contains($t)) #set($catHasItems = true) #end
695 - #end
696 - #if($catHasItems)
697 - <div style="margin-bottom:6px">
698 - <span style="font-size:0.8em;font-weight:600;color:var(--text-mid)">$catD.get(0):</span>
699 - <div class="selection-display" style="margin-top:2px">
700 - #foreach($t in $catD.get(1))
701 - #if($ictTools.contains($t))
702 - <span class="selection-item">$!escapetool.xml($t)</span>
703 - #end
704 - #end
705 - </div>
706 - </div>
707 - #end
708 - #end
709 - </span>
710 - </div>
711 - #end
712 - #if($ictUsage && !$ictUsage.isEmpty())
713 - <div class="info-row">
714 - <span class="info-label">ICT活用している場面</span>
715 - <span class="info-value">
716 716   <div class="selection-display">
717 - #foreach($iu in $ictUsage)
718 - <span class="selection-item">$!escapetool.xml($iu.trim())</span>
835 + #foreach($ba in $budgetAllocation)
836 + <span class="selection-item">$!escapetool.xml($ba.trim())</span>
719 719   #end
720 720   </div>
721 721   </span>
722 722   </div>
723 723   #end
724 - </div>
725 - </div>
726 - #else
727 - <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>
728 - #end
729 - #end
730 -
731 - ## --- 生徒総会 ---
732 - #set($hasAssembly = ($assemblyFormat && $assemblyFormat != '') || ($assemblyCount && $assemblyCount > 0) || ($assemblyAgenda && !$assemblyAgenda.isEmpty()) || ($assemblyTopics && !$assemblyTopics.isEmpty()) || ($assemblyNote && $assemblyNote != ''))
733 - #if($hasAssembly)
734 - #set($canViewAS = true)
735 - #if($visibilityAssembly == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAS = false)
736 - #elseif($visibilityAssembly == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAS = false)
737 - #end
738 - #if($canViewAS)
739 - <div class="seitokai-subsection">
740 - <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>
741 - <div class="seitokai-subsection-content">
742 - #if($assemblyFormat && $assemblyFormat != '')
743 - <div class="info-row">
744 - <span class="info-label">開催方式</span>
745 - <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($assemblyFormat)</span></span>
746 - </div>
842 + #if($budgetNote && $budgetNote.trim() != '')
843 + <div class="free-note">$!escapetool.xml($budgetNote)</div>
747 747   #end
748 - #if($assemblyCount && $assemblyCount > 0)
749 - <div class="info-row">
750 - <span class="info-label">開催回数(年)</span>
751 - <span class="info-value">$!escapetool.xml($assemblyCount)回</span>
752 - </div>
753 - #end
754 - #if($assemblyAgenda && !$assemblyAgenda.isEmpty())
755 - <div class="info-row">
756 - <span class="info-label">議案の集め方</span>
757 - <span class="info-value">
758 - <div class="selection-display">
759 - #foreach($aa in $assemblyAgenda)
760 - <span class="selection-item">$!escapetool.xml($aa.trim())</span>
761 - #end
762 - </div>
763 - </span>
764 - </div>
765 - #end
766 - #if($assemblyTopics && !$assemblyTopics.isEmpty())
767 - <div class="info-row">
768 - <span class="info-label">扱う内容</span>
769 - <span class="info-value">
770 - <div class="selection-display">
771 - #foreach($at in $assemblyTopics)
772 - <span class="selection-item">$!escapetool.xml($at.trim())</span>
773 - #end
774 - </div>
775 - </span>
776 - </div>
777 - #end
778 - #if($assemblyNote && $assemblyNote != '')
779 - <div class="info-row">
780 - <span class="info-label">自由記述</span>
781 - <span class="info-value free-text-value">$!escapetool.xml($assemblyNote)</span>
782 - </div>
783 - #end
784 784   </div>
785 785   </div>
786 786   #else
787 - <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>
848 + <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($visibilityBudget == 'school_trusted')校内の承認済み・紹介メンバー#else校内メンバー#end のみ閲覧可能です</div>
788 788   #end
789 789   #end
790 790  
... ... @@ -872,35 +872,6 @@
872 872   #end
873 873   #end
874 874  
875 - ## --- 年間主要行事 ---
876 - #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]])
877 - #set($hasAnyEvent = false)
878 - #foreach($m in $months)
879 - #if($m.get(1) && $m.get(1) != '') #set($hasAnyEvent = true) #end
880 - #end
881 - #if($hasAnyEvent)
882 - #set($canViewAN = true)
883 - #if($visibilityAnnualEvents == 'school' && ($isGuest || (!$isViewerAdmin && !$isSchoolMember))) #set($canViewAN = false)
884 - #elseif($visibilityAnnualEvents == 'school_trusted' && ($isGuest || (!$isViewerAdmin && ((!$isSchoolMember) || ($viewerAccountType != 'verified' && $viewerAccountType != 'referred'))))) #set($canViewAN = false)
885 - #end
886 - #if($canViewAN)
887 - <div class="seitokai-subsection">
888 - <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>
889 - <div class="seitokai-subsection-content">
890 - <table class="wiki-table school-info-table" style="margin:0">
891 - #foreach($m in $months)
892 - #if($m.get(1) && $m.get(1) != '')
893 - <tr><td style="width:60px;font-weight:600;white-space:nowrap">$m.get(0)</td><td>$!escapetool.xml($m.get(1))</td></tr>
894 - #end
895 - #end
896 - </table>
897 - </div>
898 - </div>
899 - #else
900 - <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>
901 - #end
902 - #end
903 -
904 904   ## --- 生徒会の課題意識 ---
905 905   #if($challenges && $challenges != '')
906 906   #set($canViewChallenges = true)
... ... @@ -1297,6 +1297,25 @@
1297 1297   #if($postVis != 'public')
1298 1298   <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>
1299 1299   #end
1332 + ## いいねボタン
1333 + #set($postLikeCount = $!post.getValue('likeCount'))
1334 + #if(!$postLikeCount || $postLikeCount == '') #set($postLikeCount = 0) #end
1335 + #set($postLikedBy = $!post.getValue('likedBy'))
1336 + #set($isLikedByMe = false)
1337 + #if($postLikedBy && $postLikedBy.contains($xcontext.user)) #set($isLikedByMe = true) #end
1338 + <div class="post-like-row post-action-mt">
1339 + #if($xcontext.user != 'XWiki.XWikiGuest')
1340 + <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)">
1341 + <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>
1342 + <span class="like-count">$postLikeCount</span>
1343 + </button>
1344 + #else
1345 + <span class="btn-like disabled">
1346 + <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>
1347 + <span class="like-count">$postLikeCount</span>
1348 + </span>
1349 + #end
1350 + </div>
1300 1300   ## 固定/編集/削除/通報/非表示ボタン(横並び)
1301 1301   #set($postAuthorRef = $!post.getValue('authorRef'))
1302 1302   #set($postObjNumED = $post.number)
... ... @@ -1417,10 +1417,68 @@
1417 1417  {{/html}}
1418 1418  #end
1419 1419  
1471 +## --- OGP / SNSシェア対応 ---
1472 +#set($ogpTitle = "${schoolName} — 生徒会Wiki")
1473 +#set($ogpDesc = "${schoolName}の生徒会活動情報。")
1474 +#if($prefecture && $prefecture != '') #set($ogpDesc = "${ogpDesc}${prefecture}") #end
1475 +#if($city && $city != '') #set($ogpDesc = "${ogpDesc}${city}。") #end
1476 +#if($dailyActivities && $dailyActivities != '') #set($ogpDesc = "${ogpDesc} 主な活動: ${dailyActivities}") #end
1477 +#set($ogpUrl = "https://${request.serverName}${doc.getURL()}")
1478 +
1420 1420  ## --- 年度タブ切り替え JavaScript ---
1421 1421  {{html clean="false"}}
1422 1422  <script>
1482 +// OGPメタタグ挿入
1483 +(function() {
1484 + var ogp = {
1485 + 'og:title': '$escapetool.javascript($ogpTitle)',
1486 + 'og:description': '$escapetool.javascript($ogpDesc)',
1487 + 'og:type': 'article',
1488 + 'og:url': '$escapetool.javascript($ogpUrl)',
1489 + 'og:site_name': '生徒会Wiki',
1490 + 'twitter:card': 'summary'
1491 + };
1492 + for (var p in ogp) {
1493 + var meta = document.createElement('meta');
1494 + meta.setAttribute('property', p);
1495 + meta.setAttribute('content', ogp[p]);
1496 + document.head.appendChild(meta);
1497 + }
1498 + // twitter用
1499 + var tw = document.createElement('meta');
1500 + tw.setAttribute('name', 'twitter:card');
1501 + tw.setAttribute('content', 'summary');
1502 + document.head.appendChild(tw);
1503 +})();
1423 1423  // コンパクト表示(タイトルのみ)トグル
1505 +// いいねトグル
1506 +function toggleLike(btn) {
1507 + var page = btn.getAttribute('data-page');
1508 + var obj = btn.getAttribute('data-obj');
1509 + var csrf = btn.getAttribute('data-csrf');
1510 + btn.disabled = true;
1511 + var fd = new FormData();
1512 + fd.append('page', page);
1513 + fd.append('obj', obj);
1514 + fd.append('form_token', csrf);
1515 + fetch('/bin/SeitokaiCode/LikePost', { method: 'POST', body: fd })
1516 + .then(function(r) { return r.json(); })
1517 + .then(function(data) {
1518 + btn.querySelector('.like-count').textContent = data.count;
1519 + if (data.action === 'liked') {
1520 + btn.classList.add('liked');
1521 + btn.querySelector('svg').setAttribute('fill', 'currentColor');
1522 + btn.querySelector('svg').setAttribute('stroke', 'none');
1523 + } else {
1524 + btn.classList.remove('liked');
1525 + btn.querySelector('svg').removeAttribute('fill');
1526 + btn.querySelector('svg').setAttribute('stroke', 'currentColor');
1527 + }
1528 + })
1529 + .catch(function() { alert('エラーが発生しました'); })
1530 + .finally(function() { btn.disabled = false; });
1531 +}
1532 +
1424 1424  function toggleCompactView() {
1425 1425   var container = document.querySelector('.xwiki-content') || document.body;
1426 1426   var isCompact = container.classList.toggle('activity-compact-view');
... ... @@ -1538,7 +1538,15 @@
1538 1538   };
1539 1539   var toast = document.createElement('div');
1540 1540   toast.className = 'toast toast-' + type;
1541 - toast.innerHTML = (icons[type] || '') + '<span>' + message + '</span>';
1650 + var iconSvg = icons[type] || '';
1651 + if (iconSvg) {
1652 + var iconSpan = document.createElement('span');
1653 + iconSpan.innerHTML = iconSvg;
1654 + toast.appendChild(iconSpan);
1655 + }
1656 + var msgSpan = document.createElement('span');
1657 + msgSpan.textContent = message;
1658 + toast.appendChild(msgSpan);
1542 1542   container.appendChild(toast);
1543 1543   setTimeout(function() { toast.remove(); }, 3200);
1544 1544  }
... ... @@ -1577,6 +1577,7 @@
1577 1577   var html = '<textarea id="editContent_' + postObjNum + '">' + currentContent.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</textarea>';
1578 1578  
1579 1579   // コメント以外は添付ファイル編集を表示
1697 + function escAttr(s) { return s.replace(/&/g,'&amp;').replace(/"/g,'&quot;').replace(/'/g,'&#39;').replace(/</g,'&lt;').replace(/>/g,'&gt;'); }
1580 1580   if (postType !== 'comment') {
1581 1581   // 既存画像
1582 1582   html += '<div class="edit-attachments">';
... ... @@ -1586,10 +1586,10 @@
1586 1586   for (var i = 0; i < imgs.length; i++) {
1587 1587   var img = imgs[i].trim();
1588 1588   if (!img) continue;
1589 - html += '<div class="edit-attach-item" data-name="' + img.replace(/"/g,'&quot;') + '">' +
1707 + html += '<div class="edit-attach-item" data-name="' + escAttr(img) + '">' +
1590 1590   '<img src="/xwiki/bin/download/' + schoolPage.replace(/\./g,'/') + '/' + encodeURIComponent(img) + '" class="edit-attach-thumb" />' +
1591 1591   '<button type="button" class="edit-attach-remove" onclick="removeEditAttach(this)" title="削除">✕</button>' +
1592 - '<input type="hidden" name="keepImages" value="' + img.replace(/"/g,'&quot;') + '" />' +
1710 + '<input type="hidden" name="keepImages" value="' + escAttr(img) + '" />' +
1593 1593   '</div>';
1594 1594   }
1595 1595   html += '</div>';
... ... @@ -1603,10 +1603,10 @@
1603 1603   if (!f) continue;
1604 1604   var displayName = f;
1605 1605   if (/^file_\d{14}_\d+_/.test(f)) displayName = f.replace(/^file_\d{14}_\d+_/, '');
1606 - html += '<div class="edit-attach-item" data-name="' + f.replace(/"/g,'&quot;') + '">' +
1607 - '<span class="edit-attach-fname">' + displayName.replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</span>' +
1724 + html += '<div class="edit-attach-item" data-name="' + escAttr(f) + '">' +
1725 + '<span class="edit-attach-fname">' + escAttr(displayName) + '</span>' +
1608 1608   '<button type="button" class="edit-attach-remove" onclick="removeEditAttach(this)" title="削除">✕</button>' +
1609 - '<input type="hidden" name="keepFiles" value="' + f.replace(/"/g,'&quot;') + '" />' +
1727 + '<input type="hidden" name="keepFiles" value="' + escAttr(f) + '" />' +
1610 1610   '</div>';
1611 1611   }
1612 1612   html += '</div>';