Changes for page 学校一覧

Last modified by Super Admin on 2026/03/23 10:15

From version Icon 27.1 Icon
edited by Super Admin
on 2026/03/18 03:55
Change comment: There is no comment for this version
To version Icon 2.1 Icon
edited by XWikiGuest
on 2026/03/06 00:39
Change comment: There is no comment for this version

Summary

Details

Icon Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.superadmin
1 +XWiki.XWikiGuest
Content
... ... @@ -3,54 +3,37 @@
3 3  ## ソート: 更新順(デフォルト)/ 都道府県順
4 4  ## カード形式で表示し、活動数・投稿数・最終更新日を表示
5 5  
6 -## --- 閲覧者情報(非表示校フィルタ用) ---
7 -#set($listViewerUser = $xcontext.user)
8 -#set($isListAdmin = false)
9 -#if($listViewerUser != 'XWiki.XWikiGuest')
10 - #set($listViewerDoc = $xwiki.getDocument($listViewerUser))
11 - #set($listViewerAccountType = $!listViewerDoc.getValue('accountType'))
12 - #if($listViewerAccountType == 'admin')
13 - #set($isListAdmin = true)
14 - #end
15 -#end
16 -
17 17  #set($sortParam = $!request.sort)
18 18  #if(!$sortParam || $sortParam == '')
19 19   #set($sortParam = 'updated')
20 20  #end
21 21  
22 -## ソート順に応じたXWQLクエリ(非表示校フィルタ付き)
23 -#if($isListAdmin)
24 - ## 管理者: 全校表示
25 - #if($sortParam == 'pref')
26 - #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school order by school.prefecture, school.schoolName"))
27 - #else
28 - #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school order by doc.date desc"))
29 - #end
11 +## ソート順に応じたXWQLクエリ
12 +#if($sortParam == 'pref')
13 + #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school order by school.prefecture, school.schoolName"))
30 30  #else
31 - ## 一般: 非表示校を除外
32 - #if($sortParam == 'pref')
33 - #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school where (school.hidden <> 1 or school.hidden is null) order by school.prefecture, school.schoolName"))
34 - #else
35 - #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school where (school.hidden <> 1 or school.hidden is null) order by doc.date desc"))
36 - #end
15 + ## 更新順: ドキュメントの最終更新日でソート(降順)
16 + #set($query = $services.query.xwql("from doc.object(SeitokaiCode.SchoolClass) as school order by doc.date desc"))
37 37  #end
38 38  #set($results = $query.execute())
39 39  
20 += <svg class="ico" style="width:1.1em;height:1.1em;vertical-align:-0.15em;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 20h20"/><path d="M5 20V10l7-5 7 5v10"/><path d="M9 20v-5h6v5"/></svg> 登録されている学校 =
21 +
40 40  {{html clean="false"}}
41 -<h1 class="home-section-title">登録されている学校</h1>
42 -<div class="sort-header">
43 - <div class="school-count">
23 +<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;flex-wrap:wrap;gap:10px;">
24 + <div style="font-size:0.9em;color:#64748b;">
44 44   $results.size() 校が登録されています
45 45   </div>
46 - <div class="sort-toggle-group">
27 + <div style="display:flex;gap:4px;background:#f1f5f9;border-radius:8px;padding:3px;">
47 47   <a href="$doc.getURL('view', 'sort=updated')"
48 - class="sort-toggle #if($sortParam == 'updated')active#end">
49 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> 更新順
29 + style="padding:6px 14px;border-radius:6px;font-size:0.84em;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px;
30 + #if($sortParam == 'updated')background:#fff;color:#1e293b;box-shadow:0 1px 3px rgba(0,0,0,0.1);#else color:#64748b;#end">
31 + <svg style="width:14px;height:14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> 更新順
50 50   </a>
51 51   <a href="$doc.getURL('view', 'sort=pref')"
52 - class="sort-toggle #if($sortParam == 'pref')active#end">
53 - <svg class="ico ico-fixed-14" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg> 都道府県順
34 + style="padding:6px 14px;border-radius:6px;font-size:0.84em;font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px;
35 + #if($sortParam == 'pref')background:#fff;color:#1e293b;box-shadow:0 1px 3px rgba(0,0,0,0.1);#else color:#64748b;#end">
36 + <svg style="width:14px;height:14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg> 都道府県順
54 54   </a>
55 55   </div>
56 56  </div>
... ... @@ -62,7 +62,7 @@
62 62  #set($currentPref = '')
63 63  
64 64  {{html clean="false"}}
65 -<div class="school-card-grid">
48 +<div style="display:grid;grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));gap:16px;">
66 66  #foreach($docName in $results)
67 67   #set($schoolDoc = $xwiki.getDocument($docName))
68 68   #set($schoolObj = $schoolDoc.getObject('SeitokaiCode.SchoolClass'))
... ... @@ -79,15 +79,13 @@
79 79   #set($actCount = $schoolDoc.getObjects('SeitokaiCode.ActivityClass').size())
80 80   ## 投稿数をカウント(全活動の投稿合計)
81 81   #set($postCount = $schoolDoc.getObjects('SeitokaiCode.ActivityPostClass').size())
82 - ## 特色ある活動の数とタイトル収集
65 + ## 特色ある活動の数をカウント
83 83   #set($schoolActivities = $schoolDoc.getObjects('SeitokaiCode.ActivityClass'))
84 84   #set($featuredCount = 0)
85 - #set($featuredTitles = [])
86 86   #if($schoolActivities)
87 87   #foreach($sa in $schoolActivities)
88 88   #if($!sa.getValue('featured') == '1')
89 89   #set($featuredCount = $featuredCount + 1)
90 - #set($discard = $featuredTitles.add($!sa.getValue('title')))
91 91   #end
92 92   #end
93 93   #end
... ... @@ -95,43 +95,39 @@
95 95   ## 都道府県グループヘッダー(都道府県順の場合)
96 96   #if($sortParam == 'pref' && $sPref != $currentPref)
97 97   #set($currentPref = $sPref)
98 - <div class="pref-group-header">
99 - <span class="pref-group-label"><svg class="ico ico-fixed-16" viewBox="0 0 24 24"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg> $!escapetool.xml($currentPref)</span>
79 + <div style="grid-column:1/-1;margin-top:12px;padding:8px 0;border-bottom:2px solid #e2e8f0;">
80 + <span style="font-size:1.05em;font-weight:700;color:#1e293b;display:inline-flex;align-items:center;gap:4px;"><svg style="width:16px;height:16px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z"/><circle cx="12" cy="10" r="3"/></svg> $escapetool.xml($currentPref)</span>
100 100   </div>
101 101   #end
102 102  
103 - #set($sHidden = $!schoolObj.getValue('hidden'))
104 - <a href="$schoolDoc.getURL('view')" class="school-card #if($sHidden == 1)school-card-hidden#end">
105 - <div class="school-card-body">
106 - <div class="school-card-header-row">
107 - <div class="school-card-name">$!escapetool.xml($sName)</div>
108 - #if($sHidden == 1)
109 - <span class="badge-hidden">非表示</span>
110 - #end
84 + <a href="$schoolDoc.getURL('view')" style="text-decoration:none;color:inherit;display:block;background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;transition:box-shadow 0.2s,transform 0.1s;"
85 + onmouseover="this.style.boxShadow='0 4px 12px rgba(0,0,0,0.08)';this.style.transform='translateY(-1px)'"
86 + onmouseout="this.style.boxShadow='';this.style.transform=''">
87 + <div style="padding:16px 20px;">
88 + <div style="display:flex;align-items:center;gap:8px;margin-bottom:4px;flex-wrap:wrap;">
89 + <div style="font-weight:700;font-size:0.95em;color:#1e293b;">$escapetool.xml($sName)</div>
111 111   #if($sEst)
112 - <span class="school-card-badge #if($sEst == '公立')public#elseif($sEst == '私立')private#else national#end">$!escapetool.xml($sEst)</span>
91 + <span style="font-size:0.72em;padding:2px 8px;border-radius:4px;font-weight:600;
92 + #if($sEst == '公立')background:#dbeafe;color:#1d4ed8;
93 + #elseif($sEst == '私立')background:#fce7f3;color:#be185d;
94 + #else background:#f3e8ff;color:#7c3aed;#end">$escapetool.xml($sEst)</span>
113 113   #end
114 114   </div>
115 - <div class="school-card-meta">
116 - $!escapetool.xml($sPref) $!escapetool.xml($sCity)
117 - #if($sCoed) ・ $!escapetool.xml($sCoed)#end
118 - #if($sSystem && !$sSystem.isEmpty())#foreach($__sys in $sSystem)#if($foreach.count > 1)・#end$!escapetool.xml($__sys)#end#end
97 + <div style="font-size:0.82em;color:#94a3b8;margin-bottom:8px;">
98 + $escapetool.xml($sPref) $escapetool.xml($sCity)
99 + #if($sCoed) ・ $escapetool.xml($sCoed)#end
100 + #if($sSystem) ・ $escapetool.xml($sSystem)#end
119 119   </div>
120 120   ## 特色ある活動バッジ
121 121   #if($featuredCount > 0)
122 - <div class="school-card-featured-wrap">
123 - <span class="badge-featured"><svg class="ico ico-fixed-14" 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> 特色ある活動 ${featuredCount}件</span>
104 + <div style="display:flex;gap:4px;flex-wrap:wrap;margin-bottom:8px;">
105 + <span style="font-size:0.72em;padding:2px 8px;background:#fef3c7;color:#92400e;border-radius:4px;font-weight:600;display:inline-flex;align-items:center;gap:3px;"><svg style="width:11px;height:11px;" 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> 特色ある活動 ${featuredCount}件</span>
124 124   </div>
125 - <div class="school-card-featured-titles">
126 - #foreach($ft in $featuredTitles)
127 - <span class="featured-title-item"><svg class="ico ico-fixed-12" 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> $!escapetool.xml($ft)</span>
128 - #end
129 - </div>
130 130   #end
131 - <div class="school-card-stats">
132 - <span><svg class="ico ico-fixed-14" 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> 活動 <span class="num">$actCount</span>件</span>
133 - <span><svg class="ico ico-fixed-14" 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> 投稿 <span class="num">$postCount</span>件</span>
134 - <span><svg class="ico ico-fixed-14" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> 更新 $lastUpdate</span>
108 + <div style="display:flex;gap:14px;font-size:0.8em;color:#94a3b8;">
109 + <span style="display:inline-flex;align-items:center;gap:3px;"><svg style="width:13px;height:13px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><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> 活動 <strong style="color:#334155;">$actCount</strong>件</span>
110 + <span style="display:inline-flex;align-items:center;gap:3px;"><svg style="width:13px;height:13px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"/></svg> 投稿 <strong style="color:#334155;">$postCount</strong>件</span>
111 + <span style="display:inline-flex;align-items:center;gap:3px;"><svg style="width:13px;height:13px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg> 更新 $lastUpdate</span>
135 135   </div>
136 136   </div>
137 137   </a>