summaryrefslogtreecommitdiff
path: root/client/html/pools_page.tpl
diff options
context:
space:
mode:
authorRuin0x11 <ipickering2@gmail.com>2020-05-03 19:53:28 -0700
committerRuin0x11 <ipickering2@gmail.com>2020-05-03 19:53:28 -0700
commitd59ecb8e230a55e6875076824723580bd3f4419b (patch)
tree34121668a4abb61fdeff0639d0c9567d0c398692 /client/html/pools_page.tpl
parent6a95a66f12a5407cfd8ffa7e373f756236bf0bce (diff)
Add pool CRUD operations/pages
Diffstat (limited to 'client/html/pools_page.tpl')
-rw-r--r--client/html/pools_page.tpl48
1 files changed, 48 insertions, 0 deletions
diff --git a/client/html/pools_page.tpl b/client/html/pools_page.tpl
new file mode 100644
index 0000000..19f3f2a
--- /dev/null
+++ b/client/html/pools_page.tpl
@@ -0,0 +1,48 @@
+<div class='pool-list table-wrap'>
+ <% if (ctx.response.results.length) { %>
+ <table>
+ <thead>
+ <th class='names'>
+ <% if (ctx.parameters.query == 'sort:name' || !ctx.parameters.query) { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: '-sort:name'}) %>'>Pool name(s)</a>
+ <% } else { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: 'sort:name'}) %>'>Pool name(s)</a>
+ <% } %>
+ </th>
+ <th class='post-count'>
+ <% if (ctx.parameters.query == 'sort:post-count') { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: '-sort:post-count'}) %>'>Post Count</a>
+ <% } else { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: 'sort:post-count'}) %>'>Post Count</a>
+ <% } %>
+ </th>
+ <th class='creation-time'>
+ <% if (ctx.parameters.query == 'sort:creation-time') { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: '-sort:creation-time'}) %>'>Created on</a>
+ <% } else { %>
+ <a href='<%- ctx.formatClientLink('pools', {query: 'sort:creation-time'}) %>'>Created on</a>
+ <% } %>
+ </th>
+ </thead>
+ <tbody>
+ <% for (let pool of ctx.response.results) { %>
+ <tr>
+ <td class='names'>
+ <ul>
+ <% for (let name of pool.names) { %>
+ <li><%= ctx.makePoolLink(pool, false, false, name) %></li>
+ <% } %>
+ </ul>
+ </td>
+ <td class='post-count'>
+ <a href='<%- ctx.formatClientLink('pools', {query: 'pool:' + pool.id}) %>'><%- pool.postCount %></a>
+ </td>
+ <td class='creation-time'>
+ <%= ctx.makeRelativeTime(pool.creationTime) %>
+ </td>
+ </tr>
+ <% } %>
+ </tbody>
+ </table>
+ <% } %>
+</div>