Fossil SCM

Swap the positions of the Unpin and Attach buttons.

stephan 2026-05-26 14:21 UTC forum-statuses
Commit e2bb38a4636865bab97dc1821938893a947be2b0f6c6634a3e2a830af4507ecb
1 file changed +15 -18
+15 -18
--- src/forum.c
+++ src/forum.c
@@ -1284,13 +1284,25 @@
12841284
@ %s(iClosed ? "action-reopen" : "action-close")'/>
12851285
/* ^^^ activated by fossil.page.forumpost.js */
12861286
}
12871287
@ </form>
12881288
}
1289
- if( g.perm.Admin
1290
- || (login_is_individual()
1291
- && forumpost_is_owner(p/*not pHead*/->fpid, 0)) ){
1289
+ if( !p->pIrt && g.perm.Setup ){
1290
+ const int isPinned = forum_rid_is_tagged(pHead->fpid, "pinned", 0);
1291
+ @ <form method="post" \
1292
+ @ action='%R/forumpost_%s(isPinned ? "unpin" : "pin")'>
1293
+ login_insert_csrf_secret();
1294
+ @ <input type="hidden" name="fpid" value="%s(p->zUuid)" />
1295
+ @ <input type="button" value='%s(isPinned ? "Unpin" : "Pin")' \
1296
+ @ class='submit hidden \
1297
+ @ %s(isPinned ? "action-unpin" : "action-pin")'/>
1298
+ /* ^^^ activated by fossil.page.forumpost.js */
1299
+ @ </form>
1300
+ }
1301
+ if( g.perm.Admin ||
1302
+ (login_is_individual()
1303
+ && forumpost_is_owner(p/*not pHead*/->fpid, 0)) ){
12921304
/* When an admin edits someone else's post, the admin
12931305
** effectively takes over ownership of it (and we currently
12941306
** have no way of passing it back). Because of this, we
12951307
** check the ownership of `p` instead of `pHead`. */
12961308
@ <form method="post" action="%R/attachadd">\
@@ -1298,25 +1310,10 @@
12981310
@ <input type="submit" value="Attach...">
12991311
login_insert_csrf_secret();
13001312
moderation_pending_www(p->fpid);
13011313
@ </form>
13021314
}
1303
- if( !p->pIrt ){
1304
- /* Root node only... */
1305
- if( g.perm.Setup ){
1306
- const int isPinned = forum_rid_is_tagged(pHead->fpid, "pinned", 0);
1307
- @ <form method="post" \
1308
- @ action='%R/forumpost_%s(isPinned ? "unpin" : "pin")'>
1309
- login_insert_csrf_secret();
1310
- @ <input type="hidden" name="fpid" value="%s(p->zUuid)" />
1311
- @ <input type="button" value='%s(isPinned ? "Unpin" : "Pin")' \
1312
- @ class='submit hidden \
1313
- @ %s(isPinned ? "action-unpin" : "action-pin")'/>
1314
- /* ^^^ activated by fossil.page.forumpost.js */
1315
- @ </form>
1316
- }
1317
- }
13181315
}
13191316
@ </div>
13201317
}
13211318
if( !p->pIrt && (flags & FDISPLAY_SELECTED)){
13221319
forum_render_status_selection(p);
13231320
--- src/forum.c
+++ src/forum.c
@@ -1284,13 +1284,25 @@
1284 @ %s(iClosed ? "action-reopen" : "action-close")'/>
1285 /* ^^^ activated by fossil.page.forumpost.js */
1286 }
1287 @ </form>
1288 }
1289 if( g.perm.Admin
1290 || (login_is_individual()
1291 && forumpost_is_owner(p/*not pHead*/->fpid, 0)) ){
 
 
 
 
 
 
 
 
 
 
 
 
1292 /* When an admin edits someone else's post, the admin
1293 ** effectively takes over ownership of it (and we currently
1294 ** have no way of passing it back). Because of this, we
1295 ** check the ownership of `p` instead of `pHead`. */
1296 @ <form method="post" action="%R/attachadd">\
@@ -1298,25 +1310,10 @@
1298 @ <input type="submit" value="Attach...">
1299 login_insert_csrf_secret();
1300 moderation_pending_www(p->fpid);
1301 @ </form>
1302 }
1303 if( !p->pIrt ){
1304 /* Root node only... */
1305 if( g.perm.Setup ){
1306 const int isPinned = forum_rid_is_tagged(pHead->fpid, "pinned", 0);
1307 @ <form method="post" \
1308 @ action='%R/forumpost_%s(isPinned ? "unpin" : "pin")'>
1309 login_insert_csrf_secret();
1310 @ <input type="hidden" name="fpid" value="%s(p->zUuid)" />
1311 @ <input type="button" value='%s(isPinned ? "Unpin" : "Pin")' \
1312 @ class='submit hidden \
1313 @ %s(isPinned ? "action-unpin" : "action-pin")'/>
1314 /* ^^^ activated by fossil.page.forumpost.js */
1315 @ </form>
1316 }
1317 }
1318 }
1319 @ </div>
1320 }
1321 if( !p->pIrt && (flags & FDISPLAY_SELECTED)){
1322 forum_render_status_selection(p);
1323
--- src/forum.c
+++ src/forum.c
@@ -1284,13 +1284,25 @@
1284 @ %s(iClosed ? "action-reopen" : "action-close")'/>
1285 /* ^^^ activated by fossil.page.forumpost.js */
1286 }
1287 @ </form>
1288 }
1289 if( !p->pIrt && g.perm.Setup ){
1290 const int isPinned = forum_rid_is_tagged(pHead->fpid, "pinned", 0);
1291 @ <form method="post" \
1292 @ action='%R/forumpost_%s(isPinned ? "unpin" : "pin")'>
1293 login_insert_csrf_secret();
1294 @ <input type="hidden" name="fpid" value="%s(p->zUuid)" />
1295 @ <input type="button" value='%s(isPinned ? "Unpin" : "Pin")' \
1296 @ class='submit hidden \
1297 @ %s(isPinned ? "action-unpin" : "action-pin")'/>
1298 /* ^^^ activated by fossil.page.forumpost.js */
1299 @ </form>
1300 }
1301 if( g.perm.Admin ||
1302 (login_is_individual()
1303 && forumpost_is_owner(p/*not pHead*/->fpid, 0)) ){
1304 /* When an admin edits someone else's post, the admin
1305 ** effectively takes over ownership of it (and we currently
1306 ** have no way of passing it back). Because of this, we
1307 ** check the ownership of `p` instead of `pHead`. */
1308 @ <form method="post" action="%R/attachadd">\
@@ -1298,25 +1310,10 @@
1310 @ <input type="submit" value="Attach...">
1311 login_insert_csrf_secret();
1312 moderation_pending_www(p->fpid);
1313 @ </form>
1314 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1315 }
1316 @ </div>
1317 }
1318 if( !p->pIrt && (flags & FDISPLAY_SELECTED)){
1319 forum_render_status_selection(p);
1320

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button