Fossil SCM

Fix the forum approval/rejection broken by the previous check-in by injecting a hidden input field to replace the hijacked button. Also add separate links to the markdown/wiki format rules, rather than a link to the list of links to those rules, as requested in [https://sqlite.org/forum/forumpost/d6343657f0865d44|sqlite forum post 2026-06-28T11:49:11Z].

stephan 2026-06-29 10:59 UTC trunk merge
Commit 68414a41171e7661913e3014863bff2606b1952c1fb99c735762fa3ddb325c0e
+4 -2
--- src/forum.c
+++ src/forum.c
@@ -1307,12 +1307,14 @@
13071307
}
13081308
}else if( g.perm.ModForum ){
13091309
/* Allow moderators to approve or reject pending posts. Also allow
13101310
** forum supervisors to mark non-special users as trusted and therefore
13111311
** able to post unmoderated. */
1312
- @ <input type="submit" name="approve" value="Approve">
1313
- @ <input type="submit" name="reject" value="Reject">
1312
+ @ <input type="submit" name="approve" value="Approve" \
1313
+ @ class="action-approve">\
1314
+ @ <input type="submit" name="reject" value="Reject" \
1315
+ @ class="action-reject">\
13141316
if( g.perm.AdminForum && !login_is_special(pManifest->zUser) ){
13151317
@ <br><label><input type="checkbox" name="trust">
13161318
@ Trust user "%h(pManifest->zUser)" so that future posts by \
13171319
@ "%h(pManifest->zUser)" do not require moderation.
13181320
@ </label>
13191321
--- src/forum.c
+++ src/forum.c
@@ -1307,12 +1307,14 @@
1307 }
1308 }else if( g.perm.ModForum ){
1309 /* Allow moderators to approve or reject pending posts. Also allow
1310 ** forum supervisors to mark non-special users as trusted and therefore
1311 ** able to post unmoderated. */
1312 @ <input type="submit" name="approve" value="Approve">
1313 @ <input type="submit" name="reject" value="Reject">
 
 
1314 if( g.perm.AdminForum && !login_is_special(pManifest->zUser) ){
1315 @ <br><label><input type="checkbox" name="trust">
1316 @ Trust user "%h(pManifest->zUser)" so that future posts by \
1317 @ "%h(pManifest->zUser)" do not require moderation.
1318 @ </label>
1319
--- src/forum.c
+++ src/forum.c
@@ -1307,12 +1307,14 @@
1307 }
1308 }else if( g.perm.ModForum ){
1309 /* Allow moderators to approve or reject pending posts. Also allow
1310 ** forum supervisors to mark non-special users as trusted and therefore
1311 ** able to post unmoderated. */
1312 @ <input type="submit" name="approve" value="Approve" \
1313 @ class="action-approve">\
1314 @ <input type="submit" name="reject" value="Reject" \
1315 @ class="action-reject">\
1316 if( g.perm.AdminForum && !login_is_special(pManifest->zUser) ){
1317 @ <br><label><input type="checkbox" name="trust">
1318 @ Trust user "%h(pManifest->zUser)" so that future posts by \
1319 @ "%h(pManifest->zUser)" do not require moderation.
1320 @ </label>
1321
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538538
#initHelpTab(){
539539
const eh = this.#e.help;
540540
const list = D.ul();
541541
D.append(
542542
D.li(list),
543
- D.attr(D.a(F.repoUrl('markup_help'), 'Markup styles'),
543
+ D.attr(D.a(F.repoUrl('md_rules'), 'Markdown markup rules'),
544
+ 'target', '_new')
545
+ );
546
+ D.append(
547
+ D.li(list),
548
+ D.attr(D.a(F.repoUrl('wiki_rules'), 'Fossil wiki markup rules'),
544549
'target', '_new')
545550
);
546551
D.append(
547552
D.li(list),
548553
"WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
982987
? "Confirm re-open"
983988
: "Confirm close"),
984989
onconfirm: ()=>form.submit()
985990
});
986991
});
992
+ form
993
+ .querySelectorAll("input.action-approve, input.action-reject")
994
+ .forEach(function(e){
995
+ e.type = 'button'/*do not submit form on click*/;
996
+ const isApprove = e.classList.contains('action-approve');
997
+ F.confirmer(e, {
998
+ confirmText: (isApprove
999
+ ? "Confirm approval"
1000
+ : "Confirm rejection"),
1001
+ onconfirm: ()=>{
1002
+ form.append(
1003
+ /* Workaround for the button element's value not
1004
+ being sent with the form: inject a hidden field
1005
+ corresponding to the button's action. */
1006
+ D.attr(
1007
+ D.input('hidden'),
1008
+ 'name', isApprove ? 'approve' : 'reject',
1009
+ 'value', 'ignored'
1010
+ )
1011
+ );
1012
+ form.submit();
1013
+ }
1014
+ });
1015
+ /* We should also arguably disable the approve/reject
1016
+ button's counterpart while it's counting down. */
1017
+ });
9871018
form
9881019
.querySelectorAll("input[type='button'].action-status")
9891020
.forEach(function(btn){
990
- btn.classList.remove('hidden');
9911021
const sel = btn.previousElementSibling;
9921022
const updateButton = ()=>{
9931023
/* Enable btn only when the status has been locally
9941024
modified. */
9951025
if( sel.dataset.initialValue ){
9961026
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538 #initHelpTab(){
539 const eh = this.#e.help;
540 const list = D.ul();
541 D.append(
542 D.li(list),
543 D.attr(D.a(F.repoUrl('markup_help'), 'Markup styles'),
 
 
 
 
 
544 'target', '_new')
545 );
546 D.append(
547 D.li(list),
548 "WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
982 ? "Confirm re-open"
983 : "Confirm close"),
984 onconfirm: ()=>form.submit()
985 });
986 });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
987 form
988 .querySelectorAll("input[type='button'].action-status")
989 .forEach(function(btn){
990 btn.classList.remove('hidden');
991 const sel = btn.previousElementSibling;
992 const updateButton = ()=>{
993 /* Enable btn only when the status has been locally
994 modified. */
995 if( sel.dataset.initialValue ){
996
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538 #initHelpTab(){
539 const eh = this.#e.help;
540 const list = D.ul();
541 D.append(
542 D.li(list),
543 D.attr(D.a(F.repoUrl('md_rules'), 'Markdown markup rules'),
544 'target', '_new')
545 );
546 D.append(
547 D.li(list),
548 D.attr(D.a(F.repoUrl('wiki_rules'), 'Fossil wiki markup rules'),
549 'target', '_new')
550 );
551 D.append(
552 D.li(list),
553 "WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
987 ? "Confirm re-open"
988 : "Confirm close"),
989 onconfirm: ()=>form.submit()
990 });
991 });
992 form
993 .querySelectorAll("input.action-approve, input.action-reject")
994 .forEach(function(e){
995 e.type = 'button'/*do not submit form on click*/;
996 const isApprove = e.classList.contains('action-approve');
997 F.confirmer(e, {
998 confirmText: (isApprove
999 ? "Confirm approval"
1000 : "Confirm rejection"),
1001 onconfirm: ()=>{
1002 form.append(
1003 /* Workaround for the button element's value not
1004 being sent with the form: inject a hidden field
1005 corresponding to the button's action. */
1006 D.attr(
1007 D.input('hidden'),
1008 'name', isApprove ? 'approve' : 'reject',
1009 'value', 'ignored'
1010 )
1011 );
1012 form.submit();
1013 }
1014 });
1015 /* We should also arguably disable the approve/reject
1016 button's counterpart while it's counting down. */
1017 });
1018 form
1019 .querySelectorAll("input[type='button'].action-status")
1020 .forEach(function(btn){
 
1021 const sel = btn.previousElementSibling;
1022 const updateButton = ()=>{
1023 /* Enable btn only when the status has been locally
1024 modified. */
1025 if( sel.dataset.initialValue ){
1026
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538538
#initHelpTab(){
539539
const eh = this.#e.help;
540540
const list = D.ul();
541541
D.append(
542542
D.li(list),
543
- D.attr(D.a(F.repoUrl('markup_help'), 'Markup styles'),
543
+ D.attr(D.a(F.repoUrl('md_rules'), 'Markdown markup rules'),
544
+ 'target', '_new')
545
+ );
546
+ D.append(
547
+ D.li(list),
548
+ D.attr(D.a(F.repoUrl('wiki_rules'), 'Fossil wiki markup rules'),
544549
'target', '_new')
545550
);
546551
D.append(
547552
D.li(list),
548553
"WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
982987
? "Confirm re-open"
983988
: "Confirm close"),
984989
onconfirm: ()=>form.submit()
985990
});
986991
});
992
+ form
993
+ .querySelectorAll("input.action-approve, input.action-reject")
994
+ .forEach(function(e){
995
+ e.type = 'button'/*do not submit form on click*/;
996
+ const isApprove = e.classList.contains('action-approve');
997
+ F.confirmer(e, {
998
+ confirmText: (isApprove
999
+ ? "Confirm approval"
1000
+ : "Confirm rejection"),
1001
+ onconfirm: ()=>{
1002
+ form.append(
1003
+ /* Workaround for the button element's value not
1004
+ being sent with the form: inject a hidden field
1005
+ corresponding to the button's action. */
1006
+ D.attr(
1007
+ D.input('hidden'),
1008
+ 'name', isApprove ? 'approve' : 'reject',
1009
+ 'value', 'ignored'
1010
+ )
1011
+ );
1012
+ form.submit();
1013
+ }
1014
+ });
1015
+ /* We should also arguably disable the approve/reject
1016
+ button's counterpart while it's counting down. */
1017
+ });
9871018
form
9881019
.querySelectorAll("input[type='button'].action-status")
9891020
.forEach(function(btn){
990
- btn.classList.remove('hidden');
9911021
const sel = btn.previousElementSibling;
9921022
const updateButton = ()=>{
9931023
/* Enable btn only when the status has been locally
9941024
modified. */
9951025
if( sel.dataset.initialValue ){
9961026
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538 #initHelpTab(){
539 const eh = this.#e.help;
540 const list = D.ul();
541 D.append(
542 D.li(list),
543 D.attr(D.a(F.repoUrl('markup_help'), 'Markup styles'),
 
 
 
 
 
544 'target', '_new')
545 );
546 D.append(
547 D.li(list),
548 "WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
982 ? "Confirm re-open"
983 : "Confirm close"),
984 onconfirm: ()=>form.submit()
985 });
986 });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
987 form
988 .querySelectorAll("input[type='button'].action-status")
989 .forEach(function(btn){
990 btn.classList.remove('hidden');
991 const sel = btn.previousElementSibling;
992 const updateButton = ()=>{
993 /* Enable btn only when the status has been locally
994 modified. */
995 if( sel.dataset.initialValue ){
996
--- src/fossil.page.forumpost.js
+++ src/fossil.page.forumpost.js
@@ -538,11 +538,16 @@
538 #initHelpTab(){
539 const eh = this.#e.help;
540 const list = D.ul();
541 D.append(
542 D.li(list),
543 D.attr(D.a(F.repoUrl('md_rules'), 'Markdown markup rules'),
544 'target', '_new')
545 );
546 D.append(
547 D.li(list),
548 D.attr(D.a(F.repoUrl('wiki_rules'), 'Fossil wiki markup rules'),
549 'target', '_new')
550 );
551 D.append(
552 D.li(list),
553 "WARNING: draft edits are keyed on the ID of the message they ",
@@ -982,14 +987,39 @@
987 ? "Confirm re-open"
988 : "Confirm close"),
989 onconfirm: ()=>form.submit()
990 });
991 });
992 form
993 .querySelectorAll("input.action-approve, input.action-reject")
994 .forEach(function(e){
995 e.type = 'button'/*do not submit form on click*/;
996 const isApprove = e.classList.contains('action-approve');
997 F.confirmer(e, {
998 confirmText: (isApprove
999 ? "Confirm approval"
1000 : "Confirm rejection"),
1001 onconfirm: ()=>{
1002 form.append(
1003 /* Workaround for the button element's value not
1004 being sent with the form: inject a hidden field
1005 corresponding to the button's action. */
1006 D.attr(
1007 D.input('hidden'),
1008 'name', isApprove ? 'approve' : 'reject',
1009 'value', 'ignored'
1010 )
1011 );
1012 form.submit();
1013 }
1014 });
1015 /* We should also arguably disable the approve/reject
1016 button's counterpart while it's counting down. */
1017 });
1018 form
1019 .querySelectorAll("input[type='button'].action-status")
1020 .forEach(function(btn){
 
1021 const sel = btn.previousElementSibling;
1022 const updateButton = ()=>{
1023 /* Enable btn only when the status has been locally
1024 modified. */
1025 if( sel.dataset.initialValue ){
1026
--- src/style.forum.css
+++ src/style.forum.css
@@ -101,5 +101,9 @@
101101
.forumTime {
102102
/* Animate the transition when a ForumPostEditor shifts
103103
its post to the left. */
104104
transition: margin-left 0.25s linear;
105105
}
106
+
107
+.forum form input.action-approve {
108
+ margin-right: 1em;
109
+}
106110
--- src/style.forum.css
+++ src/style.forum.css
@@ -101,5 +101,9 @@
101 .forumTime {
102 /* Animate the transition when a ForumPostEditor shifts
103 its post to the left. */
104 transition: margin-left 0.25s linear;
105 }
 
 
 
 
106
--- src/style.forum.css
+++ src/style.forum.css
@@ -101,5 +101,9 @@
101 .forumTime {
102 /* Animate the transition when a ForumPostEditor shifts
103 its post to the left. */
104 transition: margin-left 0.25s linear;
105 }
106
107 .forum form input.action-approve {
108 margin-right: 1em;
109 }
110

Keyboard Shortcuts

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