Fossil SCM
Swap the positions of the Unpin and Attach buttons.
Commit
e2bb38a4636865bab97dc1821938893a947be2b0f6c6634a3e2a830af4507ecb
Parent
39e97fc0284029d…
1 file changed
+15
-18
+15
-18
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1284,13 +1284,25 @@ | ||
| 1284 | 1284 | @ %s(iClosed ? "action-reopen" : "action-close")'/> |
| 1285 | 1285 | /* ^^^ activated by fossil.page.forumpost.js */ |
| 1286 | 1286 | } |
| 1287 | 1287 | @ </form> |
| 1288 | 1288 | } |
| 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)) ){ | |
| 1292 | 1304 | /* When an admin edits someone else's post, the admin |
| 1293 | 1305 | ** effectively takes over ownership of it (and we currently |
| 1294 | 1306 | ** have no way of passing it back). Because of this, we |
| 1295 | 1307 | ** check the ownership of `p` instead of `pHead`. */ |
| 1296 | 1308 | @ <form method="post" action="%R/attachadd">\ |
| @@ -1298,25 +1310,10 @@ | ||
| 1298 | 1310 | @ <input type="submit" value="Attach..."> |
| 1299 | 1311 | login_insert_csrf_secret(); |
| 1300 | 1312 | moderation_pending_www(p->fpid); |
| 1301 | 1313 | @ </form> |
| 1302 | 1314 | } |
| 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 | 1315 | } |
| 1319 | 1316 | @ </div> |
| 1320 | 1317 | } |
| 1321 | 1318 | if( !p->pIrt && (flags & FDISPLAY_SELECTED)){ |
| 1322 | 1319 | forum_render_status_selection(p); |
| 1323 | 1320 |
| --- 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 |