Changeset b94c08e in Klonkt
- Timestamp:
- 06/14/2026 05:25:41 PM (3 months ago)
- Branches:
- main
- Children:
- 8afbdd6
- Parents:
- 7963a6e
- Location:
- src/views
- Files:
-
- 5 edited
-
pages/home.ejs (modified) (2 diffs)
-
pages/post.ejs (modified) (9 diffs)
-
pages/search.ejs (modified) (1 diff)
-
partials/bottom-tab.ejs (modified) (1 diff)
-
partials/profile-sheet.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/views/pages/home.ejs
r7963a6e rb94c08e 11 11 12 12 const allPosts = [...pinnedPosts, ...posts]; 13 const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; 13 14 %> 14 15 … … 26 27 <% if (user && permissions.canCreatePost(user, site)) { %> 27 28 <p style="margin-top:2rem"> 28 <a class="btn" href=" /posts/new"29 hx-get=" /posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"30 hx-push-url=" /posts/new" hx-indicator="#pcms-loading">29 <a class="btn" href="<%= _base %>/posts/new" 30 hx-get="<%= _base %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" 31 hx-push-url="<%= _base %>/posts/new" hx-indicator="#pcms-loading"> 31 32 Schrijf je eerste post → 32 33 </a> -
src/views/pages/post.ejs
r7963a6e rb94c08e 1 <% 2 // In hub-mode is de site bereikbaar onder /user/<slug>; alle site-scoped links 3 // (tag, edit, delete, comments) moeten met die prefix anders vallen ze terug op 4 // de primaire site → 404 / verkeerde site. In solo is _base = ''. 5 const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; 6 %> 1 7 <article class="container post-page"> 2 8 <% if (post.cover_image_url) { %> … … 30 36 <div class="post-tags"> 31 37 <% post.tags.forEach(t => { %> 32 <a class="tag" href=" /tag/<%= encodeURIComponent(t) %>"33 hx-get=" /tag/<%= encodeURIComponent(t) %>?partial=1"38 <a class="tag" href="<%= _base %>/tag/<%= encodeURIComponent(t) %>" 39 hx-get="<%= _base %>/tag/<%= encodeURIComponent(t) %>?partial=1" 34 40 hx-target="#pcms-main" hx-swap="innerHTML" 35 hx-push-url=" /tag/<%= encodeURIComponent(t) %>"41 hx-push-url="<%= _base %>/tag/<%= encodeURIComponent(t) %>" 36 42 hx-indicator="#pcms-loading">#<%= t %></a> 37 43 <% }); %> … … 43 49 <aside class="post-actions"> 44 50 <% if (permissions.canEditPost(user, post, site)) { %> 45 <a href=" /posts/<%= post.slug %>/edit" class="btn"46 hx-get=" /posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main"47 hx-push-url=" /posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading">51 <a href="<%= _base %>/posts/<%= post.slug %>/edit" class="btn" 52 hx-get="<%= _base %>/posts/<%= post.slug %>/edit?partial=1" hx-target="#pcms-main" 53 hx-push-url="<%= _base %>/posts/<%= post.slug %>/edit" hx-indicator="#pcms-loading"> 48 54 ✏️ Edit 49 55 </a> 50 56 <% } %> 51 57 <% if (permissions.canDeletePost(user, post, site)) { %> 52 <form method="post" action=" /posts/<%= post.slug %>/delete" style="display:inline" onsubmit="return confirm('Delete this post?')">58 <form method="post" action="<%= _base %>/posts/<%= post.slug %>/delete" style="display:inline" onsubmit="return confirm('Delete this post?')"> 53 59 <button type="submit" class="btn btn-danger">🗑 Delete</button> 54 60 </form> … … 78 84 79 85 <% if (!comments || !comments.length) { %> 80 <p class="comments-empty">No comments yet.<% if (!user) { %> <a href="/auth/login?next=<%= encodeURIComponent( '/' + post.slug + '#comments') %>">Log in</a> to start the conversation.<% } %></p>86 <p class="comments-empty">No comments yet.<% if (!user) { %> <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>">Log in</a> to start the conversation.<% } %></p> 81 87 <% } else { %> 82 88 <ol class="comments-list"> … … 101 107 <% } %> 102 108 <% if (user && permissions.canDeleteComment(user, c, site)) { %> 103 <form method="post" action=" /comments/<%= c.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')">109 <form method="post" action="<%= _base %>/comments/<%= c.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')"> 104 110 <button type="submit" class="comment-delete-btn">Delete</button> 105 111 </form> … … 109 115 <!-- Inline reply form (hidden by default) --> 110 116 <% if (user) { %> 111 <form method="post" action=" /comments" class="comment-reply-form" hidden data-reply-form-for="<%= c.id %>">117 <form method="post" action="<%= _base %>/comments" class="comment-reply-form" hidden data-reply-form-for="<%= c.id %>"> 112 118 <input type="hidden" name="post_slug" value="<%= post.slug %>"> 113 119 <input type="hidden" name="parent_comment_id" value="<%= c.id %>"> … … 140 146 <div class="comment-actions"> 141 147 <% if (user && permissions.canDeleteComment(user, r, site)) { %> 142 <form method="post" action=" /comments/<%= r.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')">148 <form method="post" action="<%= _base %>/comments/<%= r.id %>/delete" style="display:inline" onsubmit="return confirm('Delete this comment?')"> 143 149 <button type="submit" class="comment-delete-btn">Delete</button> 144 150 </form> … … 158 164 <!-- Top-level comment form (only for logged-in users for now) --> 159 165 <% if (user) { %> 160 <form method="post" action=" /comments" class="comment-form">166 <form method="post" action="<%= _base %>/comments" class="comment-form"> 161 167 <input type="hidden" name="post_slug" value="<%= post.slug %>"> 162 168 <label class="comment-form-label"> … … 168 174 <% } else { %> 169 175 <p class="comments-login-cta"> 170 <a href="/auth/login?next=<%= encodeURIComponent( '/' + post.slug + '#comments') %>" class="btn">Log in to comment</a>176 <a href="/auth/login?next=<%= encodeURIComponent(_base + '/' + post.slug + '#comments') %>" class="btn">Log in to comment</a> 171 177 </p> 172 178 <% } %> -
src/views/pages/search.ejs
r7963a6e rb94c08e 1 <% const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; %> 1 2 <div class="container search-page"> 2 3 <h1>Search</h1> 3 4 4 <form method="get" action=" /search" class="search-page-form">5 <form method="get" action="<%= _base %>/search" class="search-page-form"> 5 6 <input 6 7 type="search" -
src/views/partials/bottom-tab.ejs
r7963a6e rb94c08e 59 59 <% if (_canPost) { %> 60 60 <a class="bottom-tab-item bottom-tab-fab<%= _active === 'create' ? ' is-active' : '' %>" 61 href=" /posts/new"62 hx-get=" /posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"63 hx-push-url=" /posts/new" hx-indicator="#pcms-loading"61 href="<%= _siteUrlBase %>/posts/new" 62 hx-get="<%= _siteUrlBase %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" 63 hx-push-url="<%= _siteUrlBase %>/posts/new" hx-indicator="#pcms-loading" 64 64 aria-label="Nieuwe post"> 65 65 <svg class="bottom-tab-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.25" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"> -
src/views/partials/profile-sheet.ejs
r7963a6e rb94c08e 21 21 : (user.role === 'editor') ? 'redacteur' 22 22 : ''; 23 // Site-scoped link (post-aanmaken) heeft in hub de /user/<slug>-prefix nodig. 24 const _base = (typeof siteUrlBase !== 'undefined' && siteUrlBase) ? siteUrlBase : ''; 23 25 %> 24 26 … … 64 66 <% if (_canPost) { %> 65 67 <li role="none"> 66 <a href=" /posts/new" class="profile-sheet-item" role="menuitem" data-close-sheet67 hx-get=" /posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML"68 hx-push-url=" /posts/new" hx-indicator="#pcms-loading">68 <a href="<%= _base %>/posts/new" class="profile-sheet-item" role="menuitem" data-close-sheet 69 hx-get="<%= _base %>/posts/new?partial=1" hx-target="#pcms-main" hx-swap="innerHTML" 70 hx-push-url="<%= _base %>/posts/new" hx-indicator="#pcms-loading"> 69 71 <svg class="psi-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"/></svg> 70 72 <span class="psi-label">Nieuwe post</span>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)