学校ページ テンプレート

Version 48.1 by Super Admin on 2026/03/13 21:13
Warning: For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:SeitokaiCode.SchoolTemplate]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.

#stop
  #end
#end

 - 投稿固定/解除処理 -
#set($pinAction = $!request.action)
#if(($pinAction == 'pin' || $pinAction == 'unpin') && ($viewerAccountType == 'admin' || ($viewerAccountType == 'verified' && $viewerSchoolCode == $schoolCode)) && $services.csrf.isTokenValid($request.form_token))
  #set($pinPostObjStr = $!request.postObj)
  #if(!$pinPostObjStr.matches('^\d+$'))
    
不正な値 → 無視
  #else
  #set($postObjNum = $mathtool.toInteger($pinPostObjStr))
  #set($postObj = $doc.getObject('SeitokaiCode.ActivityPostClass', $postObjNum))
  #if($postObj)
    #if($pinAction == 'pin')
      $postObj.set('pinned', '1')
      #set($pinnerDoc = $xwiki.getDocument($xcontext.user))
      #set($pinnerName = $!pinnerDoc.getValue('displayName'))
      #if(!$pinnerName || $pinnerName == '')#set($pinnerName = $xwiki.getUserName($xcontext.user))#end
      $postObj.set('pinnedBy', $pinnerName)
      $postObj.set('pinnedDate', $datetool.format('yyyy/MM/dd HH:mm', $datetool.date))
      $doc.saveWithProgrammingRights('投稿を固定')
    #else
      $postObj.set('pinned', '')
      $postObj.set('pinnedBy', '')
      $postObj.set('pinnedDate', '')
      $doc.saveWithProgrammingRights('投稿の固定を解除')
    #end
    $response.sendRedirect($doc.getURL('view'))
    #stop
  #end
  #end /matches
#end

 - 特色ある活動 選定/解除処理 -
#set($featAction = $!request.action)
#if(($featAction == 'feature' || $featAction == 'unfeature') && ($viewerAccountType == 'admin' || (($viewerAccountType == 'verified' || $viewerAccountType == 'referred') && $viewerSchoolCode == $schoolCode)) && $services.csrf.isTokenValid($request.form_token))
  #set($featActObjStr = $!request.actObj)
  #if($featActObjStr.matches('^\d+$'))
  #set($actObjNum = $mathtool.toInteger($featActObjStr))
  #set($actObj = $doc.getObject('SeitokaiCode.ActivityClass', $actObjNum))
  #if($actObj)
    #if($featAction == 'feature')
      
上限3件チェック
      #set($allActs = $doc.getObjects('SeitokaiCode.ActivityClass'))
      #set($featCount = 0)
      #if($allActs)
        #foreach($fa in $allActs)
          #if($!fa.getValue('featured') == '1')
            #set($featCount = $featCount + 1)
          #end
        #end
      #end
      #if($featCount < 3)
        $actObj.set('featured', '1')
        #set($featurerDoc = $xwiki.getDocument($xcontext.user))
        #set($featurerName = $!featurerDoc.getValue('displayName'))
        #if(!$featurerName || $featurerName == '')#set($featurerName = $xwiki.getUserName($xcontext.user))#end
        $actObj.set('featuredBy', $featurerName)
        $actObj.set('featuredDate', $datetool.format('yyyy/MM/dd HH:mm', $datetool.date))
        $doc.saveWithProgrammingRights('特色ある活動に選定')
      #end
    #else
      $actObj.set('featured', '')
      $actObj.set('featuredBy', '')
      $actObj.set('featuredDate', '')
      $doc.saveWithProgrammingRights('特色ある活動の選定を解除')
    #end
    $response.sendRedirect($doc.getURL('view'))
    #stop
  #end
  #end /matches
#end

 - ユーザー情報取得 -
displayName: Wiki上の表示名(ニックネーム)。本名(firstName/lastName)は管理者のみ閲覧可能。
#set($lastAuthor = $doc.author)
#set($lastAuthorDoc = $xwiki.getDocument($lastAuthor))
#set($authorAccountType = '')
#set($authorUserRole = '')
#set($authorUserStatus = '')
#set($authorEnrollmentYear = '')
#set($authorGrade = '')
#set($authorDisplayName = '')
#if($lastAuthorDoc)
  #set($authorAccountType = $!lastAuthorDoc.getValue('accountType'))
  #set($authorUserRole = $!lastAuthorDoc.getValue('userRole'))
  #set($authorUserStatus = $!lastAuthorDoc.getValue('userStatus'))
  #set($authorEnrollmentYear = $!lastAuthorDoc.getValue('enrollmentYear'))
  #set($authorDisplayName = $!lastAuthorDoc.getValue('displayName'))
  #if(!$authorDisplayName || $authorDisplayName == '')
    false引数でプレーンテキスト(HTMLリンクなし)を取得
    #set($authorDisplayName = $xwiki.getUserName($doc.author, false))
  #end
  
- 学年の動的計算(学校種別対応) -
  日本の学校年度: 4月始まり。currentSchoolYear = (月>=4) ? 今年 : 去年
  
学年 = currentSchoolYear - enrollmentYear + 1
  在学年数超過: 卒業生として表示
  #set($authorSchoolCode = $!lastAuthorDoc.getValue('schoolCode'))
  #if($authorEnrollmentYear && $authorEnrollmentYear != '' && $authorUserRole == 'student')
    #set($now = $datetool.date)
    #set($currentYear = $datetool.format('yyyy', $now))
    #set($currentMonth = $datetool.format('MM', $now))
    #set($currentYearInt = $mathtool.toInteger($currentYear))
    #set($currentMonthInt = $mathtool.toInteger($currentMonth))
    #set($enrollYearInt = $mathtool.toInteger($authorEnrollmentYear))
    #if($currentMonthInt >= 4)
      #set($schoolYear = $currentYearInt)
    #else
      #set($schoolYear = $mathtool.sub($currentYearInt, 1))
    #end
    
学校種別から在学年数を判定: C1=中学(3年), C2=義務教育(9年), D1=高校(3年), D2=中等教育(6年)
    #set($authorMaxYears = 3)
    #if($authorSchoolCode && $authorSchoolCode.length() >= 2)
      #set($authorSchoolType = $authorSchoolCode.substring(0, 2))
      #if($authorSchoolType == 'C2')
        #set($authorMaxYears = 9)
      #elseif($authorSchoolType == 'D2')
        #set($authorMaxYears = 6)
      #end
    #end
    #set($gradeNum = $mathtool.add($mathtool.sub($schoolYear, $enrollYearInt), 1))
    #if($gradeNum >= 1 && $gradeNum <= $authorMaxYears)
      #set($authorGrade = "${gradeNum}年生")
    #elseif($gradeNum > $authorMaxYears)
      #set($authorGrade = "卒業生")
    #end
  #end
#end

 - 学校名見出し(XWikiデフォルトタイトルを非表示にし、学校名を表示) -
#if($schoolName && $schoolName != '')
<style>.document-header { display: none !important; }</style>
<h1 class="school-page-title">$!escapetool.xml($schoolName)</h1>
#end

 - 編集ボタン(権限があるユーザーのみ表示) -
#set($canEditSchool = false)
#if(!$isGuest && ($isViewerAdmin || $viewerSchoolCode == $schoolCode))
  #set($canEditSchool = true)
#end
#if($canEditSchool)
<div style="text-align:right; margin-bottom:12px;">
  <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>
</div>
#end

 - ① 学校基本情報 + 連絡先(左右グリッド・折りたたみ対応) -
<div class="school-info-grid">
  <div class="school-info-card collapsed" id="card-basic-info">
    <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>
    <table class="wiki-table school-info-table">
      <tr><th>学校コード</th><td>$!escapetool.xml($!schoolCode)</td></tr>
      <tr><th>学校名</th><td>$!escapetool.xml($!schoolName)</td></tr>
      <tr><th>所在地</th><td>$!escapetool.xml($!prefecture) #if($city && $city != '')$!escapetool.xml($city)#end</td></tr>
      <tr><th>学級数・生徒数</th><td>#if($classCount && $classCount != '')${classCount}学級#end #if($studentCount && $studentCount != '')/ 約${studentCount}名#end</td></tr>
      <tr><th>共学・別学</th><td>$!escapetool.xml($!coeducation)</td></tr>
      <tr><th>設置者</th><td>$!escapetool.xml($!establishment)</td></tr>
      <tr><th>学校種</th><td>$!escapetool.xml($!schoolLevel)</td></tr>
      <tr><th>課程</th><td>#if($schoolSystem && !$schoolSystem.isEmpty())#foreach($ss in $schoolSystem)#if($foreach.count > 1) / #end$!escapetool.xml($ss)#end#end</td></tr>
      <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>
    </table>
    #set($infoEditDate = $!doc.getValue('lastInfoEditedDate'))
    #set($infoEditBy = $!doc.getValue('lastInfoEditedBy'))
    #if($infoEditDate && $infoEditDate != '')
    <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>
    #end
  </div>

  <div class="school-info-card collapsed" id="card-contact">
    <h2 role="button" tabindex="0" aria-expanded="false" onclick="toggleInfoCard('card-contact')" onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();toggleInfoCard('card-contact')}"><span><svg class="ico ico-md" viewBox="0 0 24 24"><path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z"/></svg> 連絡先・SNS</span><span class="collapse-toggle"><span class="collapse-label-open">たたむ</span><span class="collapse-label-closed">開く</span> <span class="collapse-arrow">▼</span></span></h2>
    <table class="wiki-table school-info-table">
      <tr><th>問い合わせ先</th><td>#if($contactInfo && $contactInfo != '')$!escapetool.xml($contactInfo)#else<span class="text-placeholder">未登録</span>#end</td></tr>
      <tr><th>生徒会Web</th><td>#if($seitokaiWebsite && $seitokaiWebsite != '')<a href="$!escapetool.xml($seitokaiWebsite)" target="_blank" rel="noopener"><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> $!escapetool.xml($seitokaiWebsite)</a>#else<span class="text-placeholder">未登録</span>#end</td></tr>
      <tr><th>X (Twitter)</th><td>#if($seitokaiTwitter && $seitokaiTwitter != '')<a href="https://x.com/$!escapetool.url($seitokaiTwitter)" target="_blank" rel="noopener">𝕏 @$!escapetool.xml($seitokaiTwitter)</a>#else<span class="text-placeholder">未登録</span>#end</td></tr>
      <tr><th>Instagram</th><td>#if($seitokaiInstagram && $seitokaiInstagram != '')<a href="https://instagram.com/$!escapetool.url($seitokaiInstagram)" target="_blank" rel="noopener"><svg class="ico" viewBox="0 0 24 24"><path d="M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/><circle cx="12" cy="13" r="4"/></svg> @$!escapetool.xml($seitokaiInstagram)</a>#else<span class="text-placeholder">未登録</span>#end</td></tr>
      <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>
      <tr><th>その他SNS</th><td>#if($seitokaiOtherSns && $seitokaiOtherSns != '')$!escapetool.xml($seitokaiOtherSns)#else<span class="text-placeholder">未登録</span>#end</td></tr>
    </table>
  </div>
</div>

 - 生徒会情報アコーディオン -
<div class="school-section-divider">
  <button class="shortcut-btn shortcut-btn-secondary" onclick="var sec=document.getElementById('seitokai-info-section');sec.classList.toggle('open');this.querySelector('.shortcut-arrow').textContent=sec.classList.contains('open')?'▲':'▼';">
    <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 class="shortcut-arrow">▼</span>
  </button>
</div>

<div id="seitokai-info-section" class="seitokai-info-accordion">

 - ② 組織図 -
#set($hasOrgContent = ($orgChart && $orgChart != '') || ($orgChartImage && $orgChartImage != ''))
#if($hasOrgContent)
  
公開範囲チェック
  #set($canViewOrgChart = true)
  #if($visibilityOrgChart == 'members' && $isGuest) #set($canViewOrgChart = false)
  #elseif($visibilityOrgChart == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode))) #set($canViewOrgChart = false)
  #end
  #if($canViewOrgChart)
<h2 class="section-title"><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"/><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 == 'members')<svg class="ico" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg> 登録者限定#else<svg class="ico" viewBox="0 0 24 24"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 校内限定#end</span>#end</h2>
<div class="school-section-card">
  <div class="card-inner">
    #if($orgChartImage && $orgChartImage != '')
    <div class="school-org-img-wrap"><img src="$doc.getAttachmentURL($orgChartImage)" alt="組織図" class="org-chart-img" /></div>
    #end
    #if($orgChart && $orgChart != '')$!escapetool.xml($orgChart)#end
  </div>
</div>
  #else
<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 == 'members')登録ユーザー#else校内メンバー#end のみ閲覧可能です</div>
  #end
#end

 - ③④⑤ 日常の活動・選挙・定例活動 -
<div class="school-section-grid">
  #if($dailyActivities && !$dailyActivities.isEmpty())
  <div class="school-section-card">
    <h3><svg class="ico" viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg> 日常の活動</h3>
    <div class="card-inner">
      <p class="activity-hint">活動時間の多い順に上位3つ</p>
      <div class="tag-container">
        #set($daIdx = 1)
        #foreach($da in $dailyActivities)
          <span class="tag tag-accent">${daIdx}. $!escapetool.xml($da.trim())</span>
          #set($daIdx = $daIdx + 1)
        #end
      </div>
      #if($dailyActivitiesNote && $dailyActivitiesNote.trim() != '')
      <div class="free-note">$!escapetool.xml($dailyActivitiesNote)</div>
      #end
    </div>
  </div>
  #end

  #if($electionExists && $electionExists != '')
  <div class="school-section-card">
    <h3><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>
    <div class="card-inner">
      <div class="info-row">
        <span class="info-label">役員選挙</span>
        <span class="info-value">$!escapetool.xml($!electionExists)</span>
      </div>
      #if($electionType && $electionType != '')
      <div class="info-row">
        <span class="info-label">直近の選挙方式</span>
        <span class="info-value">$!escapetool.xml($!electionType)</span>
      </div>
      #end
      #if($electionNote && $electionNote.trim() != '')
      <div class="free-note">$!escapetool.xml($electionNote)</div>
      #end
    </div>
  </div>
  #end
</div>

<div class="school-section-grid">
  #if($meetingFrequency && $meetingFrequency != '')
  <div class="school-section-card">
    <h3><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>
    <div class="card-inner">
      <div class="info-row">
        <span class="info-label">役員定例会の頻度</span>
        <span class="info-value">$!escapetool.xml($!meetingFrequency)</span>
      </div>
      #if($regularActivitiesNote && $regularActivitiesNote.trim() != '')
      <div class="free-note">$!escapetool.xml($regularActivitiesNote)</div>
      #end
    </div>
  </div>
  #end

   - ⑦ 予算 -
  #set($hasBudget = ($budgetProcess && !$budgetProcess.isEmpty()) || ($studentFee && $studentFee != '') || ($budgetScale && $budgetScale != ''))
  #if($hasBudget)
    
公開範囲チェック
    #set($canViewBudget = true)
    #if($visibilityBudget == 'members' && $isGuest) #set($canViewBudget = false)
    #elseif($visibilityBudget == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode))) #set($canViewBudget = false)
    #end
    #if($canViewBudget)
  <div class="school-section-card">
    <h3><svg class="ico" viewBox="0 0 24 24"><line x1="12" y1="1" x2="12" y2="23"/><path d="M17 5H9.5a3.5 3.5 0 000 7h5a3.5 3.5 0 010 7H6"/></svg> 予算 #if($visibilityBudget != 'public')<span class="visibility-badge visibility-${visibilityBudget}">#if($visibilityBudget == 'members')<svg class="ico" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg> 登録者限定#else<svg class="ico" viewBox="0 0 24 24"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 校内限定#end</span>#end</h3>
    <div class="card-inner">
      #if($budgetProcess && !$budgetProcess.isEmpty())
      <div class="info-row">
        <span class="info-label">作成過程の生徒関与</span>
        <span class="info-value">
          <div class="selection-display">
            #foreach($bp in $budgetProcess)
              <span class="selection-item">$!escapetool.xml($bp.trim())</span>
            #end
          </div>
        </span>
      </div>
      #end
      #if($studentFee && $studentFee != '')
      <div class="info-row">
        <span class="info-label">生徒会費(年額)</span>
        <span class="info-value">$!escapetool.xml($!studentFee)</span>
      </div>
      #end
      #if($budgetScale && $budgetScale != '')
      <div class="info-row">
        <span class="info-label">予算規模</span>
        <span class="info-value">$!escapetool.xml($!budgetScale)</span>
      </div>
      #end
      #if($budgetAllocation && !$budgetAllocation.isEmpty())
      <div class="info-row">
        <span class="info-label">主な予算配分</span>
        <span class="info-value">
          <div class="selection-display">
            #foreach($ba in $budgetAllocation)
              <span class="selection-item">$!escapetool.xml($ba.trim())</span>
            #end
          </div>
        </span>
      </div>
      #end
      #if($budgetNote && $budgetNote.trim() != '')
      <div class="free-note">$!escapetool.xml($budgetNote)</div>
      #end
    </div>
  </div>
    #else
  <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 == 'members')登録ユーザー#else校内メンバー#end のみ閲覧可能です</div>
    #end
  #end
</div>

 - ⑧ 校則の見直し -
#if($ruleReviewStatus && $ruleReviewStatus != '')
  
公開範囲チェック
  #set($canViewRuleReview = true)
  #if($visibilityRuleReview == 'members' && $isGuest) #set($canViewRuleReview = false)
  #elseif($visibilityRuleReview == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode))) #set($canViewRuleReview = false)
  #end
  #if($canViewRuleReview)
<h2 class="section-title"><svg class="ico ico-md" 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 == 'members')<svg class="ico" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg> 登録者限定#else<svg class="ico" viewBox="0 0 24 24"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 校内限定#end</span>#end</h2>
<div class="school-section-card">
  <div class="card-inner">
    <div class="info-row">
      <span class="info-label">見直しの有無(3年以内)</span>
      <span class="info-value"><span class="tag tag-primary tag-sm">$!escapetool.xml($!ruleReviewStatus)</span></span>
    </div>
    #if($ruleReviewContent && !$ruleReviewContent.isEmpty())
    <div class="info-row">
      <span class="info-label">見直しの内容</span>
      <span class="info-value">
        <div class="selection-display">
          #foreach($rc in $ruleReviewContent)
            <span class="selection-item">$!escapetool.xml($rc.trim())</span>
          #end
        </div>
      </span>
    </div>
    #end
    #if($ruleReviewProposer && !$ruleReviewProposer.isEmpty())
    <div class="info-row">
      <span class="info-label">見直しの提案者</span>
      <span class="info-value">
        <div class="selection-display">
          #foreach($rp in $ruleReviewProposer)
            <span class="selection-item">$!escapetool.xml($rp.trim())</span>
          #end
        </div>
      </span>
    </div>
    #end
    #if($ruleReviewImplementer && !$ruleReviewImplementer.isEmpty())
    <div class="info-row">
      <span class="info-label">見直しの実施者</span>
      <span class="info-value">
        <div class="selection-display">
          #foreach($ri in $ruleReviewImplementer)
            <span class="selection-item">$!escapetool.xml($ri.trim())</span>
          #end
        </div>
      </span>
    </div>
    #end
    #if($ruleReviewSystem && $ruleReviewSystem != '')
    <div class="info-row">
      <span class="info-label">見直しの仕組み</span>
      <span class="info-value">$!escapetool.xml($!ruleReviewSystem)</span>
    </div>
    #end
  </div>
</div>
  #else
<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 == 'members')登録ユーザー#else校内メンバー#end のみ閲覧可能です</div>
  #end
#end

 - ⑨ 課題 -
#if($challenges && $challenges != '')
  
公開範囲チェック
  #set($canViewChallenges = true)
  #if($visibilityChallenges == 'members' && $isGuest) #set($canViewChallenges = false)
  #elseif($visibilityChallenges == 'school' && ($isGuest || (!$isViewerAdmin && $viewerSchoolCode != $schoolCode))) #set($canViewChallenges = false)
  #end
  #if($canViewChallenges)
<h2 class="section-title">生徒会の課題意識 #if($visibilityChallenges != 'public')<span class="visibility-badge visibility-${visibilityChallenges}">#if($visibilityChallenges == 'members')<svg class="ico" viewBox="0 0 24 24"><path d="M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 00-3-3.87"/><path d="M16 3.13a4 4 0 010 7.75"/></svg> 登録者限定#else<svg class="ico" viewBox="0 0 24 24"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 校内限定#end</span>#end</h2>
<div class="challenge-text">$!escapetool.xml($challenges)</div>
  #else
<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($visibilityChallenges == 'members')登録ユーザー#else校内メンバー#end のみ閲覧可能です</div>
  #end
#end

</div> seitokai-info-accordion 終了

{{/html}}

 - ⑩ 活動報告一覧(スレッド型・年度タブ付き) -

活動報告

 - 投稿者ステータス凡例(折りたたみ) -
Failed to execute the [html] macro. Cause: [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Click on this message for details.

 特色ある活動を先頭に表示するため、並び替え用リストを作成
#set($featuredActivities = [])
#set($normalActivities = [])
#if($activities && $activities.size() > 0)
  #foreach($act in $activities)
    #set($isFeatured = $!act.getValue('featured'))
    #if($isFeatured == '1')
      #set($discard = $featuredActivities.add($foreach.index))
    #else
      #set($discard = $normalActivities.add($foreach.index))
    #end
  #end
#end
#set($orderedActivityIndices = [])
#set($discard = $orderedActivityIndices.addAll($featuredActivities))
#set($discard = $orderedActivityIndices.addAll($normalActivities))

#if($activities && $activities.size() > 0)
  #foreach($actIdx in $orderedActivityIndices)
    #set($activity = $activities.get($actIdx))
    #set($actTitle = $activity.getValue('title'))
    #set($actCommittee = $activity.getValue('committee'))
    #set($actPeriod = $activity.getValue('period'))
    #set($actFY = $!activity.getValue('fiscalYear'))
    #set($actFeatured = $!activity.getValue('featured'))
    #if(!$actFY || $actFY == '') #set($actFY = 'unknown') #end
    この活動に紐づく投稿を収集(固定投稿を先頭に)
    #set($pinnedPosts = [])
    #set($normalPosts = [])
    #if($allPosts)
      #foreach($post in $allPosts)
        #if($post.getValue('activityIndex') == $actIdx)
          #set($isPinned = $!post.getValue('pinned'))
          #if($isPinned == '1')
            #set($discard = $pinnedPosts.add($post))
          #else
            #set($discard = $normalPosts.add($post))
          #end
        #end
      #end
    #end
    #set($threadPosts = [])
    #set($discard = $threadPosts.addAll($pinnedPosts))
    #set($discard = $threadPosts.addAll($normalPosts))
    
report/comment カウント
    #set($reportCount = 0)
    #set($commentCount = 0)
    #foreach($tp in $threadPosts)
      #set($tpType = $!tp.getValue('postType'))
      #if($tpType == 'comment')
        #set($commentCount = $commentCount + 1)
      #else
        #set($reportCount = $reportCount + 1)
      #end
    #end

Failed to execute the [html] macro. Cause: [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Click on this message for details.

  #end
#else
Failed to execute the [html] macro. Cause: [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Click on this message for details.

#end

 - 活動追加ボタン -
#if($xcontext.user != "XWiki.XWikiGuest")
Failed to execute the [html] macro. Cause: [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Click on this message for details.

#end

 - 年度タブ切り替え JavaScript -
Failed to execute the [html] macro. Cause: [When using HTML content inline, you can only use inline HTML content. Block HTML content (such as tables) cannot be displayed. Try leaving an empty line before and after the macro.]. Click on this message for details.

{{/velocity}}