Fossil SCM

Use <h3> tags, with a CSS class for styling, for the title on forum posts, as this works better for screen readers.

drh 2020-03-14 14:22 trunk merge
Commit fb85d7b632e66065e4519bb2a1e439919ab09c7fc6c141e8d7ac972c7da52bbd
1 file changed +13 -10
+13 -10
--- src/forum.c
+++ src/forum.c
@@ -362,11 +362,11 @@
362362
}
363363
if( pPost->zThreadTitle ){
364364
@ <h1>%h(pPost->zThreadTitle)</h1>
365365
}
366366
zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
367
- @ <p>(%d(p->sid)) By %h(pPost->zUser) on %h(zDate)
367
+ @ <h3 class='forumPostHdr'>(%d(p->sid)) By %h(pPost->zUser) on %h(zDate)
368368
fossil_free(zDate);
369369
if( p->pEdit ){
370370
@ edit of %z(href("%R/forumpost/%S?t=c",p->pEdit->zUuid))\
371371
@ %d(p->pEdit->sid)</a>
372372
}
@@ -392,10 +392,11 @@
392392
if( fossil_strcmp(pPost->zMimetype,"text/plain")!=0 ){
393393
@ %z(href("%R/forumpost/%S?raw",p->zUuid))[source]</a>
394394
}
395395
isPrivate = content_is_private(p->fpid);
396396
sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
397
+ @ </h3>
397398
if( isPrivate && !g.perm.ModForum && !sameUser ){
398399
@ <p><span class="modpending">Awaiting Moderator Approval</span></p>
399400
}else{
400401
forum_render(0, pPost->zMimetype, pPost->zWiki, 0);
401402
}
@@ -480,11 +481,12 @@
480481
if( pPost==0 ) continue;
481482
if( pPost->zThreadTitle ){
482483
@ <h1>%h(pPost->zThreadTitle)</h1>
483484
}
484485
zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
485
- @ <p>(%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(pOPost->zUser) on %h(zDate)
486
+ @ <h3 class='forumPostHdr'>\
487
+ @ (%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(pOPost->zUser) on %h(zDate)
486488
fossil_free(zDate);
487489
if( g.perm.Debug ){
488490
@ <span class="debug">\
489491
@ <a href="%R/artifact/%h(p->zUuid)">(artifact)</a></span>
490492
}
@@ -514,10 +516,11 @@
514516
if( pIrt ){
515517
@ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
516518
@ %d(pIrt->sid)</a>
517519
}
518520
}
521
+ @ </h3>
519522
isPrivate = content_is_private(fpid);
520523
sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
521524
if( isPrivate && !g.perm.ModForum && !sameUser ){
522525
@ <p><span class="modpending">Awaiting Moderator Approval</span></p>
523526
}else{
@@ -1014,18 +1017,18 @@
10141017
if( zMimetype==0 ) zMimetype = fossil_strdup(pPost->zMimetype);
10151018
if( zTitle==0 && pPost->zThreadTitle!=0 ){
10161019
zTitle = fossil_strdup(pPost->zThreadTitle);
10171020
}
10181021
style_header("Edit %s", zTitle ? "Post" : "Reply");
1019
- @ <h1>Original Post:</h1>
1022
+ @ <h2>Original Post:</h2>
10201023
forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
10211024
"forumEdit");
10221025
if( P("preview") ){
1023
- @ <h1>Preview of Edited Post:</h1>
1026
+ @ <h2>Preview of Edited Post:</h2>
10241027
forum_render(zTitle, zMimetype, zContent,"forumEdit");
10251028
}
1026
- @ <h1>Revised Message:</h1>
1029
+ @ <h2>Revised Message:</h2>
10271030
@ <form action="%R/forume2" method="POST">
10281031
@ <input type="hidden" name="fpid" value="%h(P("fpid"))">
10291032
@ <input type="hidden" name="edit" value="1">
10301033
forum_from_line();
10311034
forum_entry_widget(zTitle, zMimetype, zContent);
@@ -1032,23 +1035,23 @@
10321035
}else{
10331036
/* Reply */
10341037
zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
10351038
zContent = PDT("content","");
10361039
style_header("Reply");
1037
- @ <h1>Replying To:</h1>
10381040
if( pRootPost->zThreadTitle ){
1039
- @ <h3>%h(pRootPost->zThreadTitle)</h3>
1041
+ @ <h1>Thread: %h(pRootPost->zThreadTitle)</h1>
10401042
}
1043
+ @ <h2>Replying To:</h2>
10411044
zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
1042
- @ <p>%h(pPost->zThreadTitle ? "Post" : "Reply") by %h(pPost->zUser) on %h(zDate)
1045
+ @ <h3 class='forumPostHdr'>By %h(pPost->zUser) on %h(zDate)</h3>
10431046
fossil_free(zDate);
10441047
forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit");
10451048
if( P("preview") ){
1046
- @ <h1>Preview:</h1>
1049
+ @ <h2>Preview:</h2>
10471050
forum_render(0, zMimetype,zContent, "forumEdit");
10481051
}
1049
- @ <h1>Enter Reply:</h1>
1052
+ @ <h2>Enter Reply:</h2>
10501053
@ <form action="%R/forume2" method="POST">
10511054
@ <input type="hidden" name="fpid" value="%h(P("fpid"))">
10521055
@ <input type="hidden" name="reply" value="1">
10531056
forum_from_line();
10541057
forum_entry_widget(0, zMimetype, zContent);
10551058
--- src/forum.c
+++ src/forum.c
@@ -362,11 +362,11 @@
362 }
363 if( pPost->zThreadTitle ){
364 @ <h1>%h(pPost->zThreadTitle)</h1>
365 }
366 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
367 @ <p>(%d(p->sid)) By %h(pPost->zUser) on %h(zDate)
368 fossil_free(zDate);
369 if( p->pEdit ){
370 @ edit of %z(href("%R/forumpost/%S?t=c",p->pEdit->zUuid))\
371 @ %d(p->pEdit->sid)</a>
372 }
@@ -392,10 +392,11 @@
392 if( fossil_strcmp(pPost->zMimetype,"text/plain")!=0 ){
393 @ %z(href("%R/forumpost/%S?raw",p->zUuid))[source]</a>
394 }
395 isPrivate = content_is_private(p->fpid);
396 sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
 
397 if( isPrivate && !g.perm.ModForum && !sameUser ){
398 @ <p><span class="modpending">Awaiting Moderator Approval</span></p>
399 }else{
400 forum_render(0, pPost->zMimetype, pPost->zWiki, 0);
401 }
@@ -480,11 +481,12 @@
480 if( pPost==0 ) continue;
481 if( pPost->zThreadTitle ){
482 @ <h1>%h(pPost->zThreadTitle)</h1>
483 }
484 zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
485 @ <p>(%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(pOPost->zUser) on %h(zDate)
 
486 fossil_free(zDate);
487 if( g.perm.Debug ){
488 @ <span class="debug">\
489 @ <a href="%R/artifact/%h(p->zUuid)">(artifact)</a></span>
490 }
@@ -514,10 +516,11 @@
514 if( pIrt ){
515 @ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
516 @ %d(pIrt->sid)</a>
517 }
518 }
 
519 isPrivate = content_is_private(fpid);
520 sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
521 if( isPrivate && !g.perm.ModForum && !sameUser ){
522 @ <p><span class="modpending">Awaiting Moderator Approval</span></p>
523 }else{
@@ -1014,18 +1017,18 @@
1014 if( zMimetype==0 ) zMimetype = fossil_strdup(pPost->zMimetype);
1015 if( zTitle==0 && pPost->zThreadTitle!=0 ){
1016 zTitle = fossil_strdup(pPost->zThreadTitle);
1017 }
1018 style_header("Edit %s", zTitle ? "Post" : "Reply");
1019 @ <h1>Original Post:</h1>
1020 forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
1021 "forumEdit");
1022 if( P("preview") ){
1023 @ <h1>Preview of Edited Post:</h1>
1024 forum_render(zTitle, zMimetype, zContent,"forumEdit");
1025 }
1026 @ <h1>Revised Message:</h1>
1027 @ <form action="%R/forume2" method="POST">
1028 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1029 @ <input type="hidden" name="edit" value="1">
1030 forum_from_line();
1031 forum_entry_widget(zTitle, zMimetype, zContent);
@@ -1032,23 +1035,23 @@
1032 }else{
1033 /* Reply */
1034 zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
1035 zContent = PDT("content","");
1036 style_header("Reply");
1037 @ <h1>Replying To:</h1>
1038 if( pRootPost->zThreadTitle ){
1039 @ <h3>%h(pRootPost->zThreadTitle)</h3>
1040 }
 
1041 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
1042 @ <p>%h(pPost->zThreadTitle ? "Post" : "Reply") by %h(pPost->zUser) on %h(zDate)
1043 fossil_free(zDate);
1044 forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit");
1045 if( P("preview") ){
1046 @ <h1>Preview:</h1>
1047 forum_render(0, zMimetype,zContent, "forumEdit");
1048 }
1049 @ <h1>Enter Reply:</h1>
1050 @ <form action="%R/forume2" method="POST">
1051 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1052 @ <input type="hidden" name="reply" value="1">
1053 forum_from_line();
1054 forum_entry_widget(0, zMimetype, zContent);
1055
--- src/forum.c
+++ src/forum.c
@@ -362,11 +362,11 @@
362 }
363 if( pPost->zThreadTitle ){
364 @ <h1>%h(pPost->zThreadTitle)</h1>
365 }
366 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
367 @ <h3 class='forumPostHdr'>(%d(p->sid)) By %h(pPost->zUser) on %h(zDate)
368 fossil_free(zDate);
369 if( p->pEdit ){
370 @ edit of %z(href("%R/forumpost/%S?t=c",p->pEdit->zUuid))\
371 @ %d(p->pEdit->sid)</a>
372 }
@@ -392,10 +392,11 @@
392 if( fossil_strcmp(pPost->zMimetype,"text/plain")!=0 ){
393 @ %z(href("%R/forumpost/%S?raw",p->zUuid))[source]</a>
394 }
395 isPrivate = content_is_private(p->fpid);
396 sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
397 @ </h3>
398 if( isPrivate && !g.perm.ModForum && !sameUser ){
399 @ <p><span class="modpending">Awaiting Moderator Approval</span></p>
400 }else{
401 forum_render(0, pPost->zMimetype, pPost->zWiki, 0);
402 }
@@ -480,11 +481,12 @@
481 if( pPost==0 ) continue;
482 if( pPost->zThreadTitle ){
483 @ <h1>%h(pPost->zThreadTitle)</h1>
484 }
485 zDate = db_text(0, "SELECT datetime(%.17g)", pOPost->rDate);
486 @ <h3 class='forumPostHdr'>\
487 @ (%d(p->pLeaf?p->pLeaf->sid:p->sid)) By %h(pOPost->zUser) on %h(zDate)
488 fossil_free(zDate);
489 if( g.perm.Debug ){
490 @ <span class="debug">\
491 @ <a href="%R/artifact/%h(p->zUuid)">(artifact)</a></span>
492 }
@@ -514,10 +516,11 @@
516 if( pIrt ){
517 @ in reply to %z(href("%R/forumpost/%S?t=h",pIrt->zUuid))\
518 @ %d(pIrt->sid)</a>
519 }
520 }
521 @ </h3>
522 isPrivate = content_is_private(fpid);
523 sameUser = notAnon && fossil_strcmp(pPost->zUser, g.zLogin)==0;
524 if( isPrivate && !g.perm.ModForum && !sameUser ){
525 @ <p><span class="modpending">Awaiting Moderator Approval</span></p>
526 }else{
@@ -1014,18 +1017,18 @@
1017 if( zMimetype==0 ) zMimetype = fossil_strdup(pPost->zMimetype);
1018 if( zTitle==0 && pPost->zThreadTitle!=0 ){
1019 zTitle = fossil_strdup(pPost->zThreadTitle);
1020 }
1021 style_header("Edit %s", zTitle ? "Post" : "Reply");
1022 @ <h2>Original Post:</h2>
1023 forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki,
1024 "forumEdit");
1025 if( P("preview") ){
1026 @ <h2>Preview of Edited Post:</h2>
1027 forum_render(zTitle, zMimetype, zContent,"forumEdit");
1028 }
1029 @ <h2>Revised Message:</h2>
1030 @ <form action="%R/forume2" method="POST">
1031 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1032 @ <input type="hidden" name="edit" value="1">
1033 forum_from_line();
1034 forum_entry_widget(zTitle, zMimetype, zContent);
@@ -1032,23 +1035,23 @@
1035 }else{
1036 /* Reply */
1037 zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
1038 zContent = PDT("content","");
1039 style_header("Reply");
 
1040 if( pRootPost->zThreadTitle ){
1041 @ <h1>Thread: %h(pRootPost->zThreadTitle)</h1>
1042 }
1043 @ <h2>Replying To:</h2>
1044 zDate = db_text(0, "SELECT datetime(%.17g)", pPost->rDate);
1045 @ <h3 class='forumPostHdr'>By %h(pPost->zUser) on %h(zDate)</h3>
1046 fossil_free(zDate);
1047 forum_render(0, pPost->zMimetype, pPost->zWiki, "forumEdit");
1048 if( P("preview") ){
1049 @ <h2>Preview:</h2>
1050 forum_render(0, zMimetype,zContent, "forumEdit");
1051 }
1052 @ <h2>Enter Reply:</h2>
1053 @ <form action="%R/forume2" method="POST">
1054 @ <input type="hidden" name="fpid" value="%h(P("fpid"))">
1055 @ <input type="hidden" name="reply" value="1">
1056 forum_from_line();
1057 forum_entry_widget(0, zMimetype, zContent);
1058

Keyboard Shortcuts

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