private structures

This commit is contained in:
Your Name 2026-08-19 09:51:07 -04:00
parent 1f7dbf21e0
commit e179814859
6 changed files with 243 additions and 18 deletions

View file

@ -0,0 +1,28 @@
<div id="members" class="flex flex-col gap-1">
<label>Members</label>
<% if (!it.members.length) { %>
<div class="text-xs italic">no members yet — only you can see this while private</div>
<% } %>
<% it.members.forEach((v) => { %>
<div class="flex flex-row items-center gap-2 text-sm">
<span class="flex-grow"><%~ v.username %></span>
<button
hx-delete="/workshop/<%= it.structure.id %>/members/<%= v.user_id %>"
hx-target="#members"
hx-swap="outerHTML"
>remove</button>
</div>
<% }) %>
<% if (it.notFound) { %>
<div class="text-xs text-red-600">no user named "<%~ it.notFound %>"</div>
<% } %>
<form
hx-post="/workshop/<%= it.structure.id %>/members"
hx-target="#members"
hx-swap="outerHTML"
class="flex flex-row gap-1"
>
<input name="username" placeholder="username" class="flex-grow">
<button type="submit">invite</button>
</form>
</div>