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.
Commit
c3bb903212a5fb6c6c0391ba530013e252c2021a8ed2f5d76209a09bac38eaaa
Parent
1e10be4821dff1f…
2 files changed
+2
+5
+2
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -509,10 +509,12 @@ | ||
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | /* |
| 512 | 512 | ** WEBPAGE: ainfo |
| 513 | 513 | ** URL: /ainfo?name=ARTIFACTID |
| 514 | +** | |
| 515 | +** name=ATTACHMENT_ARTIFACT_UUID | |
| 514 | 516 | ** |
| 515 | 517 | ** Show the details of an attachment artifact. |
| 516 | 518 | */ |
| 517 | 519 | void ainfo_page(void){ |
| 518 | 520 | int rid; /* RID for the control artifact */ |
| 519 | 521 |
| --- 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 |
+5
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -778,10 +778,14 @@ | ||
| 778 | 778 | if( pToFree ) manifest_destroy(pToFree); |
| 779 | 779 | if( p->zDisplayName==0 ) return "(unknown)"; |
| 780 | 780 | return p->zDisplayName; |
| 781 | 781 | } |
| 782 | 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 | +} | |
| 783 | 787 | |
| 784 | 788 | /* |
| 785 | 789 | ** Display a single post in a forum thread. |
| 786 | 790 | */ |
| 787 | 791 | static void forum_display_post( |
| @@ -923,10 +927,11 @@ | ||
| 923 | 927 | zMimetype = "text/plain"; |
| 924 | 928 | }else{ |
| 925 | 929 | zMimetype = pManifest->zMimetype; |
| 926 | 930 | } |
| 927 | 931 | forum_render(0, zMimetype, pManifest->zWiki, 0, !bRaw); |
| 932 | + forum_render_attachment_list(p); | |
| 928 | 933 | } |
| 929 | 934 | |
| 930 | 935 | /* When not in raw mode, finish creating the border around the post. */ |
| 931 | 936 | if( !bRaw ){ |
| 932 | 937 | /* If the user is able to write to the forum and if this post has not been |
| 933 | 938 |
| --- 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 |