Download views/admin.ejs from launch-calcium/Gallery-Copper-Typescript: direct link, hf CLI and curl.
- Browser
- Download file 3.07 kB
-
https://huggingface.co/spaces/launch-calcium/Gallery-Copper-Typescript/resolve/main/views/admin.ejs
- Command line
-
hf download hf://spaces/launch-calcium/Gallery-Copper-Typescript/views/admin.ejs
-
curl -L -o admin.ejs https://huggingface.co/spaces/launch-calcium/Gallery-Copper-Typescript/resolve/main/views/admin.ejs
3.07 kB
| <%- include('header') %> | |
| <div class="tableh1">Admin Control Panel</div> | |
| <div class="tableb"> | |
| <h2>Manage Categories</h2> | |
| <table class="form-table" style="margin-bottom: 20px;"> | |
| <thead> | |
| <tr> | |
| <th>ID</th> | |
| <th>Name</th> | |
| <th>Description</th> | |
| <th>Actions</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <% categories.forEach(cat => { %> | |
| <tr> | |
| <td><%= cat.cid %></td> | |
| <td><%= cat.name %></td> | |
| <td><%= cat.description %></td> | |
| <td> | |
| <form action="/admin/category/delete/<%= cat.cid %>" method="POST" style="display:inline;" onsubmit="return confirm('Delete category?');"> | |
| <button type="submit" class="btn" style="background:#e74c3c;">Delete</button> | |
| </form> | |
| </td> | |
| </tr> | |
| <% }) %> | |
| </tbody> | |
| </table> | |
| <h3>Add New Category</h3> | |
| <form action="/admin/category/add" method="POST" style="margin-bottom: 30px;"> | |
| <p><input type="text" name="name" placeholder="Category Name" required></p> | |
| <p><input type="text" name="description" placeholder="Description"></p> | |
| <p><button type="submit" class="btn">Create Category</button></p> | |
| </form> | |
| <hr> | |
| <h2>Manage Albums</h2> | |
| <table class="form-table" style="margin-bottom: 20px;"> | |
| <thead> | |
| <tr> | |
| <th>ID</th> | |
| <th>Title</th> | |
| <th>Category</th> | |
| <th>Actions</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| <% albums.forEach(alb => { %> | |
| <tr> | |
| <td><%= alb.aid %></td> | |
| <td><%= alb.title %></td> | |
| <td>Category #<%= alb.category %></td> | |
| <td> | |
| <form action="/admin/album/delete/<%= alb.aid %>" method="POST" style="display:inline;" onsubmit="return confirm('Delete album and all its pictures?');"> | |
| <button type="submit" class="btn" style="background:#e74c3c;">Delete</button> | |
| </form> | |
| </td> | |
| </tr> | |
| <% }) %> | |
| </tbody> | |
| </table> | |
| <h3>Add New Album</h3> | |
| <form action="/admin/album/add" method="POST" style="margin-bottom: 30px;"> | |
| <p><input type="text" name="title" placeholder="Album Title" required></p> | |
| <p><input type="text" name="description" placeholder="Description"></p> | |
| <p> | |
| Category: | |
| <select name="category"> | |
| <option value="0">Root Category</option> | |
| <% categories.forEach(cat => { %> | |
| <option value="<%= cat.cid %>"><%= cat.name %></option> | |
| <% }) %> | |
| </select> | |
| </p> | |
| <p><button type="submit" class="btn">Create Album</button></p> | |
| </form> | |
| <hr> | |
| <h2>Gallery Configuration</h2> | |
| <form action="/admin/config/update" method="POST"> | |
| <table class="form-table"> | |
| <% configs.forEach(cfg => { %> | |
| <tr> | |
| <td><label><%= cfg.name %></label></td> | |
| <td><input type="text" name="<%= cfg.name %>" value="<%= cfg.value %>"></td> | |
| </tr> | |
| <% }) %> | |
| <tr> | |
| <td></td> | |
| <td><button type="submit" class="btn">Save Settings</button></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| <%- include('footer') %> | |