Inital commit
This commit is contained in:
commit
a6af7dbfcb
114 files changed
+27520
No files matched your search
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<%- include('../partials/head'); -%>
|
||||
<%- include('../partials/admin-editor-css'); -%>
|
||||
<title>Admin - Link editor</title>
|
||||
</head>
|
||||
<body>
|
||||
<%- include('../winter'); -%>
|
||||
|
||||
|
||||
<div class="editor-container">
|
||||
<a class="btn btn-back" href="<%= endpoint %>/dashboard">Back to dashboard</a>
|
||||
<section>
|
||||
<h2>Add Link</h2>
|
||||
<form action="<%= endpoint %>/link/add" method="post" class="editor-form">
|
||||
<input type="text" name="name" placeholder="Name" required>
|
||||
<input type="text" name="url" placeholder="https://example.com">
|
||||
<label>
|
||||
<input type="checkbox" name="linkHidden" value="1">
|
||||
Link hidden
|
||||
</label>
|
||||
<div class="icon-select">
|
||||
<input type="hidden" name="icon" value="">
|
||||
|
||||
<button type="button" class="icon-select-trigger">
|
||||
<span style="color:#bbb;">None</span>
|
||||
</button>
|
||||
|
||||
<div class="icon-options">
|
||||
<div class="icon-option" data-id="" data-name="">
|
||||
<span style="color:#bbb;">None</span>
|
||||
</div>
|
||||
<% icons.forEach(icon => { %>
|
||||
<div class="icon-option" data-id="<%= icon.id %>" data-name="<%= icon.name %>">
|
||||
<img src="/assets/images/<%= icon.path %>" alt="<%= icon.alt %>">
|
||||
<span><%= icon.alt %></span>
|
||||
</div>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit">Add</button>
|
||||
</form>
|
||||
</section>
|
||||
<% for (var i = 0; i < links.length; i++) { %>
|
||||
<section>
|
||||
<form action="<%= endpoint %>/link/edit" method="post" class="editor-form">
|
||||
<input type="hidden" name="id" value="<%= i %>">
|
||||
|
||||
<input type="text" name="name" value="<%= links[i].name %>" placeholder="Name" required>
|
||||
<input type="text" name="url" value="<%= links[i].url ?? '' %>" placeholder="https://example.com">
|
||||
|
||||
<div class="icon-select">
|
||||
<input type="hidden" name="icon" value="<%= links[i].iconId ?? '' %>">
|
||||
<button type="button" class="icon-select-trigger">
|
||||
<% if (links[i].iconName) { %>
|
||||
<img src="/assets/images/<%= links[i].iconName %>" alt="">
|
||||
<% } else { %>
|
||||
<span style="color:#bbb;">None</span>
|
||||
<% } %>
|
||||
</button>
|
||||
<div class="icon-options">
|
||||
<div class="icon-option" data-id="" data-name="">
|
||||
<span style="color:#bbb;">None</span>
|
||||
</div>
|
||||
<% icons.forEach(icon => { %>
|
||||
<div class="icon-option" data-id="<%= icon.id %>" data-name="<%= icon.path %>">
|
||||
<img src="/assets/images/<%= icon.path %>" alt="<%= icon.alt %>">
|
||||
<span><%= icon.alt %></span>
|
||||
</div>
|
||||
<% }) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label>
|
||||
<input type="checkbox" name="linkHidden" value="1" <%= links[i].linkHidden ? 'checked' : '' %>>
|
||||
Hidden
|
||||
</label>
|
||||
|
||||
<button type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
<div style="display:flex; gap:0.5rem; margin-top:0.5rem;">
|
||||
<form action="<%= endpoint %>/link/delete" method="post">
|
||||
<input type="hidden" name="id" value="<%= i %>">
|
||||
<button type="submit" style="border-color:var(--admin-danger);color:var(--admin-danger);">Delete</button>
|
||||
</form>
|
||||
<form action="<%= endpoint %>/link/move/up" method="post">
|
||||
<input type="hidden" name="id" value="<%= i %>">
|
||||
<button type="submit" aria-label="Move up" title="Move up">↑</button>
|
||||
</form>
|
||||
<form action="<%= endpoint %>/link/move/down" method="post">
|
||||
<input type="hidden" name="id" value="<%= i %>">
|
||||
<button type="submit" aria-label="Move down" title="Move down">↓</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<% if (links[i].icon) { %>
|
||||
<img class="preview" src="<%= links[i].icon %>" alt="<%= links[i].name %>">
|
||||
<% } else { %>
|
||||
<span class="preview" style="color:#bbb;">No image</span> <% }
|
||||
%>
|
||||
|
||||
</section>
|
||||
|
||||
<% } %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<%- include('../partials/icon-select-script'); -%>
|
||||
</script>
|
||||
|
||||
<%- include('../footer'); -%>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user