Fossil SCM

Render forumpost attachment list between the post's collapsible body and its buttons. The list would ideally be in the collapsible box but forum_render(), which has many callers, isn't currently structured to make that easy.

stephan 2026-05-22 21:16 UTC forum-attachments
Commit c3bb903212a5fb6c6c0391ba530013e252c2021a8ed2f5d76209a09bac38eaaa
2 files changed +2 +5
--- src/attach.c
+++ src/attach.c
@@ -509,10 +509,12 @@
509509
}
510510
511511
/*
512512
** WEBPAGE: ainfo
513513
** URL: /ainfo?name=ARTIFACTID
514
+**
515
+** name=ATTACHMENT_ARTIFACT_UUID
514516
**
515517
** Show the details of an attachment artifact.
516518
*/
517519
void ainfo_page(void){
518520
int rid; /* RID for the control artifact */
519521
--- src/attach.c
+++ src/attach.c
@@ -509,10 +509,12 @@
509 }
510
511 /*
512 ** WEBPAGE: ainfo
513 ** URL: /ainfo?name=ARTIFACTID
 
 
514 **
515 ** Show the details of an attachment artifact.
516 */
517 void ainfo_page(void){
518 int rid; /* RID for the control artifact */
519
--- src/attach.c
+++ src/attach.c
@@ -509,10 +509,12 @@
509 }
510
511 /*
512 ** WEBPAGE: ainfo
513 ** URL: /ainfo?name=ARTIFACTID
514 **
515 ** name=ATTACHMENT_ARTIFACT_UUID
516 **
517 ** Show the details of an attachment artifact.
518 */
519 void ainfo_page(void){
520 int rid; /* RID for the control artifact */
521
--- src/forum.c
+++ src/forum.c
@@ -778,10 +778,14 @@
778778
if( pToFree ) manifest_destroy(pToFree);
779779
if( p->zDisplayName==0 ) return "(unknown)";
780780
return p->zDisplayName;
781781
}
782782
783
+static void forum_render_attachment_list(ForumPost *p){
784
+ while( p->pEditPrev ) p = p->pEditPrev;
785
+ attachment_list(p->zUuid, "Attachments", 1);
786
+}
783787
784788
/*
785789
** Display a single post in a forum thread.
786790
*/
787791
static void forum_display_post(
@@ -923,10 +927,11 @@
923927
zMimetype = "text/plain";
924928
}else{
925929
zMimetype = pManifest->zMimetype;
926930
}
927931
forum_render(0, zMimetype, pManifest->zWiki, 0, !bRaw);
932
+ forum_render_attachment_list(p);
928933
}
929934
930935
/* When not in raw mode, finish creating the border around the post. */
931936
if( !bRaw ){
932937
/* If the user is able to write to the forum and if this post has not been
933938
--- src/forum.c
+++ src/forum.c
@@ -778,10 +778,14 @@
778 if( pToFree ) manifest_destroy(pToFree);
779 if( p->zDisplayName==0 ) return "(unknown)";
780 return p->zDisplayName;
781 }
782
 
 
 
 
783
784 /*
785 ** Display a single post in a forum thread.
786 */
787 static void forum_display_post(
@@ -923,10 +927,11 @@
923 zMimetype = "text/plain";
924 }else{
925 zMimetype = pManifest->zMimetype;
926 }
927 forum_render(0, zMimetype, pManifest->zWiki, 0, !bRaw);
 
928 }
929
930 /* When not in raw mode, finish creating the border around the post. */
931 if( !bRaw ){
932 /* If the user is able to write to the forum and if this post has not been
933
--- src/forum.c
+++ src/forum.c
@@ -778,10 +778,14 @@
778 if( pToFree ) manifest_destroy(pToFree);
779 if( p->zDisplayName==0 ) return "(unknown)";
780 return p->zDisplayName;
781 }
782
783 static void forum_render_attachment_list(ForumPost *p){
784 while( p->pEditPrev ) p = p->pEditPrev;
785 attachment_list(p->zUuid, "Attachments", 1);
786 }
787
788 /*
789 ** Display a single post in a forum thread.
790 */
791 static void forum_display_post(
@@ -923,10 +927,11 @@
927 zMimetype = "text/plain";
928 }else{
929 zMimetype = pManifest->zMimetype;
930 }
931 forum_render(0, zMimetype, pManifest->zWiki, 0, !bRaw);
932 forum_render_attachment_list(p);
933 }
934
935 /* When not in raw mode, finish creating the border around the post. */
936 if( !bRaw ){
937 /* If the user is able to write to the forum and if this post has not been
938

Keyboard Shortcuts

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