SVNからのミラー

This commit is contained in:
2025-11-07 22:48:07 +09:00
commit 438c7d8aef
68 changed files with 7619 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
{@ if (isset($totalPages) && $totalPages > 1) @}
<div class="pagination">
{# 検索クエリがある場合はページネーションリンクに含める #}
{$ $queryParams = [] $}
{@ if (isset($_GET['q']) && !empty($_GET['q'])) @}
{$ $queryParams['q'] = $_GET['q'] $}
{@ endif @}
{# 前のページへのリンク #}
{@ if (isset($currentPage) && $currentPage > 1) @}
{$ $prevParams = $queryParams $}
{$ $prevParams['page'] = $currentPage - 1 $}
{$ $prevQueryString = http_build_query($prevParams) $}
<a href="?{{ $prevQueryString }}" class="page-link">&laquo; 前</a>
{@ endif @}
{# 表示するページ番号の範囲を計算(モバイル対応の為) #}
{# 最大表示ページ数 #}
{$ $rangeSize = 2 $}
{$ $startPage = max(1, $currentPage - floor($rangeSize / 2)) $}
{$ $endPage = min($totalPages, $startPage + $rangeSize - 1) $}
{# 範囲の調整 #}
{@ if ($endPage - $startPage + 1 < $rangeSize && $startPage > 1) @}
{$ $startPage = max(1, $endPage - $rangeSize + 1) $}
{@ endif @}
{# 最初のページへのリンク(多数のページがある場合) #}
{@ if ($startPage > 1) @}
{$ $firstParams = $queryParams $}
{$ $firstParams['page'] = 1 $}
{$ $firstQueryString = http_build_query($firstParams) $}
<a href="?{{ $firstQueryString }}" class="page-link">1</a>
{@ if ($startPage > 2) @}
<span class="page-ellipsis">...</span>
{@ endif @}
{@ endif @}
{@ for ($i = $startPage; $i <= $endPage; $i++) @}
{$ $pageParams = $queryParams $}
{$ $pageParams['page'] = $i $}
{$ $pageQueryString = http_build_query($pageParams) $}
{@ if ($i == $currentPage) @}
<span class="page-current" aria-current="page">{{ $i }}</span>
{@ else @}
<a href="?{{ $pageQueryString }}" class="page-link">{{ $i }}</a>
{@ endif @}
{@ endfor @}
{@ if ($endPage < $totalPages) @}
{# 最後のページへのリンク(多数のページがある場合) #}
{$ $lastParams = $queryParams $}
{$ $lastParams['page'] = $totalPages $}
{$ $lastQueryString = http_build_query($lastParams) $}
{@ if ($endPage < $totalPages - 1) @}
<span class="page-ellipsis">...</span>
{@ endif @}
<a href="?{{ $lastQueryString }}" class="page-link">{{ $totalPages }}</a>
{@ endif @}
{# 次のページへのリンク #}
{@ if (isset($currentPage) && $currentPage < $totalPages) @}
{$ $nextParams = $queryParams $}
{$ $nextParams['page'] = $currentPage + 1 $}
{$ $nextQueryString = http_build_query($nextParams) $}
<a href="?{{ $nextQueryString }}" class="page-link">次 &raquo;</a>
{@ endif @}
</div>
{@ endif @}