feat(ai-cases-write): 등록된 사례 목록 5건 단위 페이징
- 최신순 정렬 후 페이지당 5개, 이전/다음 네비 - edit·page 쿼리 유지, 목록 영역 스타일 보강 Made-with: Cursor
This commit is contained in:
@@ -46,18 +46,42 @@
|
||||
<p class="muted admin-hint">슬러그는 URL에 쓰이므로 영문·숫자·하이픈만 사용하세요. <strong>원문 PDF 경로</strong>(<code>/public/...</code>)가 있으면 상세는 PDF 페이지 이미지로 보여 주며, 이때 <strong>본문(Markdown)은 비워도 됩니다</strong>. PDF가 없을 때는 본문이 필수입니다.</p>
|
||||
</section>
|
||||
|
||||
<% if (allStories.length) { %>
|
||||
<% if (typeof listPagination !== 'undefined' && listPagination.totalCount > 0) { %>
|
||||
<section class="panel">
|
||||
<h2>등록된 사례</h2>
|
||||
<div class="section-head" style="margin-bottom:8px;align-items:baseline;">
|
||||
<h2 style="margin:0;">등록된 사례</h2>
|
||||
<% if (listPagination.totalPages > 1) { %>
|
||||
<span class="muted" style="font-size:13px;">총 <%= listPagination.totalCount %>건 · <%= listPagination.page %>/<%= listPagination.totalPages %> 페이지</span>
|
||||
<% } else { %>
|
||||
<span class="muted" style="font-size:13px;">총 <%= listPagination.totalCount %>건</span>
|
||||
<% } %>
|
||||
</div>
|
||||
<ul class="admin-story-list">
|
||||
<% allStories.forEach(function(s) { %>
|
||||
<li>
|
||||
<a href="/ai-cases/write?edit=<%= s.slug %>"><strong><%= s.title %></strong></a>
|
||||
<% var _listPageQ = listPagination.page > 1 ? ('&page=' + listPagination.page) : ''; %>
|
||||
<a href="/ai-cases/write?edit=<%= encodeURIComponent(s.slug) %><%= _listPageQ %>"><strong><%= s.title %></strong></a>
|
||||
<span class="muted">/<%= s.slug %></span>
|
||||
<button type="button" class="btn-ghost btn-sm js-delete-story" data-id="<%= s.id %>" data-title="<%= s.title %>">삭제</button>
|
||||
</li>
|
||||
<% }) %>
|
||||
</ul>
|
||||
<% if (listPagination.totalPages > 1) { %>
|
||||
<nav class="admin-story-list-pagination" aria-label="등록된 사례 페이지">
|
||||
<% var _pq = editSlug ? ('edit=' + encodeURIComponent(editSlug) + '&') : ''; %>
|
||||
<% if (listPagination.hasPrev) { %>
|
||||
<a class="btn-ghost btn-sm" href="/ai-cases/write?<%= _pq %>page=<%= listPagination.page - 1 %>">이전</a>
|
||||
<% } else { %>
|
||||
<span class="btn-ghost btn-sm" style="opacity:0.45;pointer-events:none;">이전</span>
|
||||
<% } %>
|
||||
<span class="muted" style="font-size:13px;padding:0 8px;"><%= listPagination.page %> / <%= listPagination.totalPages %></span>
|
||||
<% if (listPagination.hasNext) { %>
|
||||
<a class="btn-ghost btn-sm" href="/ai-cases/write?<%= _pq %>page=<%= listPagination.page + 1 %>">다음</a>
|
||||
<% } else { %>
|
||||
<span class="btn-ghost btn-sm" style="opacity:0.45;pointer-events:none;">다음</span>
|
||||
<% } %>
|
||||
</nav>
|
||||
<% } %>
|
||||
</section>
|
||||
<% } %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user