mirror of
https://github.com/wassname/talk.git
synced 2026-06-29 20:03:00 +08:00
41 lines
1.8 KiB
Plaintext
41 lines
1.8 KiB
Plaintext
<html>
|
|
<head>
|
|
<title>All Assets</title>
|
|
<%- include ../partials/dev %>
|
|
</head>
|
|
<body>
|
|
<%- include ../partials/dev-nav %>
|
|
<div class="container">
|
|
<div class="d-flex w-100 justify-content-between mt-3 mb-2">
|
|
<h1 class="mb-0">All Assets</h1>
|
|
<span class="text-muted"><%= skip + 1 %> - <%= skip + assets.length %> of <%= count %> Assets</span>
|
|
</div>
|
|
<div class="list-group">
|
|
<% if (skip === 0) { %><a href="<%= BASE_PATH %>dev/assets/random" class="list-group-item list-group-item-action list-group-item-primary"><i class="fa fa-plus" aria-hidden="true"></i> Create a random article</a><% } %>
|
|
<% assets.forEach(function (asset) { %>
|
|
<a href="<%= BASE_PATH %>dev/assets/id/<%= asset.id %>" class="list-group-item list-group-item-action flex-column align-items-start">
|
|
<div class="d-flex w-100 justify-content-between">
|
|
<h5 class="mb-1"><%= asset.title %></h5>
|
|
<small>Created <%= asset.created_at.toLocaleString('en-US') %></small>
|
|
</div>
|
|
<small><%= asset.url %></small>
|
|
</a>
|
|
<% }) %>
|
|
</div>
|
|
<% if (count !== assets.length) { %>
|
|
<nav aria-label="Page navigation example" class="mt-2">
|
|
<ul class="pagination justify-content-center">
|
|
<% let page = 1; for (let i = 0; i < count; i += limit) { %>
|
|
<% if (i === skip) { %>
|
|
<li class="page-item disabled"><a class="page-link" href="#"><%= page %></a></li>
|
|
<% } else { %>
|
|
<li class="page-item"><a class="page-link" href="?skip=<%= i %>&limit=<%= limit %>"><%= page %></a></li>
|
|
<% } %>
|
|
<% page++; } %>
|
|
</ul>
|
|
</nav>
|
|
<% } %>
|
|
</div>
|
|
</body>
|
|
</html>
|