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

From version Icon 74.1 Icon
edited by Super Admin
on 2026/03/19 12:32
Change comment: There is no comment for this version
To version Icon 82.1 Icon
edited by Super Admin
on 2026/03/19 23:16
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Content
... ... @@ -36,7 +36,7 @@
36 36  #set($website = $doc.getValue('website'))
37 37  #set($schoolPhoto = $doc.getValue('schoolPhoto'))
38 38  
39 -## --- 組織 ---
39 +## --- 生徒会組織 ---
40 40  #set($orgChart = $doc.getValue('orgChart'))
41 41  #set($orgChartImage = $doc.getValue('orgChartImage'))
42 42  
... ... @@ -365,7 +365,7 @@
365 365   <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>
366 366   <div class="seitokai-info-body">
367 367  
368 - ## --- 組織 ---
368 + ## --- 生徒会組織 ---
369 369   #set($hasOrgContent = ($orgChart && $orgChart != '') || ($orgChartImage && $orgChartImage != ''))
370 370   #if($hasOrgContent)
371 371   #set($canViewOrgChart = true)
... ... @@ -374,16 +374,16 @@
374 374   #end
375 375   #if($canViewOrgChart)
376 376   <div class="seitokai-subsection">
377 - <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>
377 + <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>
378 378   <div class="seitokai-subsection-content">
379 379   #if($orgChartImage && $orgChartImage != '')
380 380   <div class="school-org-img-wrap"><img src="$doc.getAttachmentURL($orgChartImage)" alt="組織図" class="org-chart-img" /></div>
381 381   #end
382 - #if($orgChart && $orgChart != '')$!escapetool.xml($orgChart)#end
382 + #if($orgChart && $orgChart != '')<div class="free-note">$!escapetool.xml($orgChart)</div>#end
383 383   </div>
384 384   </div>
385 385   #else
386 - <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>
386 + <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>
387 387   #end
388 388   #end
389 389  
... ... @@ -736,16 +736,18 @@
736 736  <div class="activity-thread" data-fiscal-year="$!escapetool.xml($actFY)">
737 737   <div class="activity-thread-header">
738 738   <div class="activity-thread-title">
739 - <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>
740 - <span class="activity-meta">$!escapetool.xml($!actCommittee) | $!escapetool.xml($!actPeriod) #if($actFY != 'unknown')| $!escapetool.xml($actFY)年度#end</span>
741 - #set($actTagsList = $activity.getValue('tags'))
742 - #if($actTagsList && !$actTagsList.isEmpty())
743 - #foreach($tagItem in $actTagsList)
744 - #if($tagItem && $tagItem.trim() != '')<span class="activity-tag-badge">$escapetool.xml($tagItem)</span>#end
739 + <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>
740 + <div class="activity-meta-line">
741 + <span class="activity-meta">$!escapetool.xml($!actCommittee) | $!escapetool.xml($!actPeriod) #if($actFY != 'unknown')| $!escapetool.xml($actFY)年度#end</span>
742 + #set($actTagsList = $activity.getValue('tags'))
743 + #if($actTagsList && !$actTagsList.isEmpty())
744 + #foreach($tagItem in $actTagsList)
745 + #if($tagItem && $tagItem.trim() != '')<span class="activity-tag-badge">$escapetool.xml($tagItem)</span>#end
746 + #end
745 745   #end
746 - #end
748 + </div>
747 747   </div>
748 - <div class="thread-meta-row">
750 + <div class="thread-meta-right">
749 749   <span class="thread-post-count">${reportCount}件の報告 ・ ${commentCount}件のコメント</span>
750 750   #if($viewerAccountType == 'admin' || $viewerAccountType == 'verified' || $viewerAccountType == 'referred')
751 751   #if($actFeatured == '1')
... ... @@ -881,6 +881,13 @@
881 881   #if($postEdited == 1 || $postEdited == '1')
882 882   <span class="post-edited-label">(編集済み)</span>
883 883   #end
886 + #set($postAuthorRefH = $!post.getValue('authorRef'))
887 + #set($postObjNumH = $post.number)
888 + #if(!$isGuest && $xcontext.user != $postAuthorRefH)
889 + <button type="button" class="btn-post-report btn-post-report-header" onclick="openReportDialog(this, '${doc.fullName}', $postObjNumH, '${services.csrf.getToken()}')" title="この投稿を通報">
890 + <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> 通報
891 + </button>
892 + #end
884 884   </div>
885 885   <div class="thread-post-body">
886 886   $!escapetool.xml($!postContent)
... ... @@ -947,12 +947,13 @@
947 947   #if($postVis != 'public')
948 948   <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>
949 949   #end
950 - ## 固定/編集/削除ボタン(横並び)
959 + ## 固定/編集/削除/通報/非表示ボタン(横並び)
951 951   #set($postAuthorRef = $!post.getValue('authorRef'))
952 952   #set($postObjNumED = $post.number)
953 953   #set($showPinBtn = ($viewerAccountType == 'admin' || $viewerAccountType == 'verified'))
954 954   #set($showEditDeleteBtn = ($xcontext.user == $postAuthorRef || $viewerAccountType == 'admin'))
955 - #if($showPinBtn || $showEditDeleteBtn)
964 + #set($showHideBtn = ($viewerAccountType == 'admin'))
965 + #if($showPinBtn || $showEditDeleteBtn || $showHideBtn)
956 956   <div class="post-edit-actions post-action-mt">
957 957   #if($showPinBtn)
958 958   #set($postObjNum = $post.number)
... ... @@ -976,6 +976,11 @@
976 976   <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> 削除
977 977   </button>
978 978   #end
989 + #if($showHideBtn)
990 + <button type="button" class="btn-post-hide" onclick="openHideDialog(this, '${doc.fullName}', $postObjNumED, '${services.csrf.getToken()}')" title="この投稿を非表示にする">
991 + <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> 非表示
992 + </button>
993 + #end
979 979   </div>
980 980   #end
981 981   </div>
... ... @@ -1025,9 +1025,11 @@
1025 1025  
1026 1026   #if($xcontext.user != "XWiki.XWikiGuest")
1027 1027   <div class="thread-add-post">
1043 + #if($isSchoolMember || $isViewerAdmin)
1028 1028   <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=report" class="btn-thread-add">
1029 1029   + 活動報告を追加
1030 1030   </a>
1047 + #end
1031 1031   <a href="/bin/SeitokaiCode/ActivityPostForm?schoolPage=${doc.fullName}&activityIndex=${actIdx}&schoolCode=$!escapetool.url($schoolCode)&postType=comment" class="btn-thread-comment">
1032 1032   <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> コメントを書く
1033 1033   </a>
... ... @@ -1261,6 +1261,80 @@
1261 1261   xhr.onerror = function() { alert('通信エラーが発生しました'); };
1262 1262   xhr.send(deletePostData);
1263 1263  }
1281 +
1282 +/* --- 通報ダイアログ --- */
1283 +function openReportDialog(btn, targetPage, postObjNum, token) {
1284 + if (document.getElementById('report-dialog-overlay')) return;
1285 + var reasons = ['宣伝・スパム','不適切な内容','個人情報の露出','誹謗中傷','誤情報','その他'];
1286 + var overlay = document.createElement('div');
1287 + overlay.id = 'report-dialog-overlay';
1288 + 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;';
1289 + var dialog = document.createElement('div');
1290 + dialog.style.cssText = 'background:#fff;border-radius:12px;padding:24px;max-width:400px;width:90%;max-height:80vh;overflow-y:auto;';
1291 + var html = '<h3 style="margin:0 0 16px;font-size:1.1em;">投稿を通報</h3>';
1292 + html += '<p style="margin:0 0 12px;font-size:0.9em;color:#4b5563;">通報された投稿は管理者が確認するまで一時的に非表示になります。</p>';
1293 + html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">通報理由</label>';
1294 + html += '<select id="report-reason" style="width:100%;padding:8px;border:1px solid #d1d5db;border-radius:8px;margin-bottom:12px;font-size:0.9em;">';
1295 + for (var i=0; i<reasons.length; i++) html += '<option value="'+reasons[i]+'">'+reasons[i]+'</option>';
1296 + html += '</select>';
1297 + html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">補足コメント(任意)</label>';
1298 + 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>';
1299 + html += '<div style="display:flex;gap:8px;margin-top:16px;justify-content:flex-end;">';
1300 + html += '<button type="button" id="report-cancel-btn" style="padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;">キャンセル</button>';
1301 + 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>';
1302 + html += '</div>';
1303 + dialog.innerHTML = html;
1304 + overlay.appendChild(dialog);
1305 + document.body.appendChild(overlay);
1306 + overlay.addEventListener('click', function(e) { if (e.target === overlay) overlay.remove(); });
1307 + document.getElementById('report-cancel-btn').addEventListener('click', function() { overlay.remove(); });
1308 + document.getElementById('report-submit-btn').addEventListener('click', function() {
1309 + var reason = document.getElementById('report-reason').value;
1310 + var detail = document.getElementById('report-detail').value;
1311 + var submitBtn = document.getElementById('report-submit-btn');
1312 + submitBtn.disabled = true; submitBtn.textContent = '送信中...';
1313 + var xhr = new XMLHttpRequest();
1314 + xhr.open('POST', '/bin/get/SeitokaiCode/ReportAction?outputSyntax=plain', true);
1315 + xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1316 + var data = 'targetPage=' + encodeURIComponent(targetPage) + '&targetPost=' + postObjNum + '&reason=' + encodeURIComponent(reason) + '&detail=' + encodeURIComponent(detail) + '&form_token=' + encodeURIComponent(token);
1317 + xhr.onload = function() {
1318 + overlay.remove();
1319 + showToast('通報を受け付けました', 'success');
1320 + setTimeout(function() { location.reload(); }, 1000);
1321 + };
1322 + xhr.onerror = function() { overlay.remove(); alert('通信エラーが発生しました'); };
1323 + xhr.send(data);
1324 + });
1325 +}
1326 +
1327 +/* --- 非表示ダイアログ(管理者用) --- */
1328 +function openHideDialog(btn, targetPage, postObjNum, token) {
1329 + if (document.getElementById('hide-dialog-overlay')) return;
1330 + var overlay = document.createElement('div');
1331 + overlay.id = 'hide-dialog-overlay';
1332 + 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;';
1333 + var dialog = document.createElement('div');
1334 + dialog.style.cssText = 'background:#fff;border-radius:12px;padding:24px;max-width:400px;width:90%;';
1335 + var html = '<h3 style="margin:0 0 16px;font-size:1.1em;">投稿を非表示にする</h3>';
1336 + html += '<label style="display:block;margin-bottom:8px;font-weight:600;font-size:0.9em;">非表示の理由</label>';
1337 + 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="理由を入力" />';
1338 + html += '<div style="display:flex;gap:8px;margin-top:16px;justify-content:flex-end;">';
1339 + html += '<button type="button" id="hide-cancel-btn" style="padding:8px 16px;border:1px solid #d1d5db;border-radius:8px;background:#fff;cursor:pointer;">キャンセル</button>';
1340 + 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>';
1341 + 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>';
1342 + html += '</div>';
1343 + dialog.innerHTML = html;
1344 + overlay.appendChild(dialog);
1345 + document.body.appendChild(overlay);
1346 + overlay.addEventListener('click', function(e) { if (e.target === overlay) overlay.remove(); });
1347 + document.getElementById('hide-cancel-btn').addEventListener('click', function() { overlay.remove(); });
1348 + function doHide(action) {
1349 + var reason = document.getElementById('hide-reason').value || '管理者判断';
1350 + window.location.href = '/bin/view/SeitokaiCode/ModerationAction?action=' + action + '&targetPage=' + encodeURIComponent(targetPage) + '&targetPost=' + postObjNum + '&reason=' + encodeURIComponent(reason) + '&form_token=' + encodeURIComponent(token);
1351 + }
1352 + document.getElementById('hide-submit-btn').addEventListener('click', function() { doHide('hide'); });
1353 + document.getElementById('hide-warn-btn').addEventListener('click', function() { doHide('hide-warn'); });
1354 +}
1264 1264  </script>
1265 1265  {{/html}}
1266 1266  {{/velocity}}