Ignore:
Timestamp:
06/14/2026 04:17:14 PM (3 months ago)
Author:
roboburr <roboburr@…>
Branches:
main
Children:
640b39c
Parents:
ccbd6a6
Message:

hub: artist self-management — owner manages their own subsite (posts/appearance/comments)

A site owner (member) now gets a "My PrutFolio" dashboard and can manage their
OWN site; cross-site access is restricted.

  • auth.js: requireSiteManager (owner of res.locals.site or god) + requireSiteManagerBySlug (owner of :slug or god).
  • admin.js: /admin role-aware -> god=hub management, owner=my-site dashboard, member without site=403.
  • admin-sites.js: /:slug/edit + /save owner-or-god (was god-only); upload-photo requireAuth. list/new/create/delete remain god-only.
  • admin-comments.js: requireSiteManager + redirects/form actions via siteUrlBase so the artist context (/user/<slug>/admin/comments) is correct.
  • render.js: userOwnsSite flag; topnav + overview show "Admin" for owners; topnav "New post" uses siteUrlBase.
  • pages/my-site.ejs: artist dashboard.

Co-Authored-By: Claude <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/admin-comments.ejs

    rccbd6a6 r8cb1dc7  
    2626            <strong><%= c.author_username %></strong>
    2727            <% if (c.parent_comment_id) { %><span class="muted">(reply)</span><% } %>
    28             on <a href="/<%= c.post_slug %>"><%= c.post_title || c.post_slug %></a>
     28            on <a href="<%= siteUrlBase %>/<%= c.post_slug %>"><%= c.post_title || c.post_slug %></a>
    2929            <span class="muted">&middot; <%= formatDateTime(c.created_at) %></span>
    3030          </div>
    3131          <blockquote class="moderation-content"><%= c.content %></blockquote>
    3232          <div class="moderation-actions">
    33             <form method="post" action="/admin/comments/<%= c.id %>/approve" style="display:inline">
     33            <form method="post" action="<%= siteUrlBase %>/admin/comments/<%= c.id %>/approve" style="display:inline">
    3434              <button type="submit" class="btn btn-primary">Approve</button>
    3535            </form>
    36             <form method="post" action="/admin/comments/<%= c.id %>/reject" style="display:inline">
     36            <form method="post" action="<%= siteUrlBase %>/admin/comments/<%= c.id %>/reject" style="display:inline">
    3737              <button type="submit" class="btn btn-danger">Reject</button>
    3838            </form>
     
    5555          <tr class="status-<%= c.status %>">
    5656            <td><%= c.author_username %></td>
    57             <td><a href="/<%= c.post_slug %>"><%= c.post_title || c.post_slug %></a></td>
     57            <td><a href="<%= siteUrlBase %>/<%= c.post_slug %>"><%= c.post_title || c.post_slug %></a></td>
    5858            <td>
    5959              <span class="status-pill status-pill--<%= c.status %>"><%= c.status %></span>
Note: See TracChangeset for help on using the changeset viewer.