Fossil SCM
Add the thread=HASH query parameter to /timeline. Link to this from the /forumpost page.
Commit
f1bf008a04e03ba1612c48a5accdd57fe6c5647d5e0e134359865b7513cea2d4
Parent
96004cd024a30b8…
2 files changed
+1
+32
+1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1832,10 +1832,11 @@ | ||
| 1832 | 1832 | style_submenu_element("Hierarchical", "%R/%s/%s?t=h%s%s", g.zPath, zName, |
| 1833 | 1833 | bUnf ? "&unf" : "", bHist ? "&hist" : ""); |
| 1834 | 1834 | } |
| 1835 | 1835 | style_submenu_checkbox("unf", "Unformatted", 0, 0); |
| 1836 | 1836 | style_submenu_checkbox("hist", "History", 0, 0); |
| 1837 | + style_submenu_element("Timeline", "%R/timeline?thread=%t", zName); | |
| 1837 | 1838 | if( g.perm.Admin ){ |
| 1838 | 1839 | style_submenu_element("Artifacts", "%R/forumthreadhashlist/%t", zName); |
| 1839 | 1840 | } |
| 1840 | 1841 | |
| 1841 | 1842 | /* Display the thread. */ |
| 1842 | 1843 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1832,10 +1832,11 @@ | |
| 1832 | style_submenu_element("Hierarchical", "%R/%s/%s?t=h%s%s", g.zPath, zName, |
| 1833 | bUnf ? "&unf" : "", bHist ? "&hist" : ""); |
| 1834 | } |
| 1835 | style_submenu_checkbox("unf", "Unformatted", 0, 0); |
| 1836 | style_submenu_checkbox("hist", "History", 0, 0); |
| 1837 | if( g.perm.Admin ){ |
| 1838 | style_submenu_element("Artifacts", "%R/forumthreadhashlist/%t", zName); |
| 1839 | } |
| 1840 | |
| 1841 | /* Display the thread. */ |
| 1842 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1832,10 +1832,11 @@ | |
| 1832 | style_submenu_element("Hierarchical", "%R/%s/%s?t=h%s%s", g.zPath, zName, |
| 1833 | bUnf ? "&unf" : "", bHist ? "&hist" : ""); |
| 1834 | } |
| 1835 | style_submenu_checkbox("unf", "Unformatted", 0, 0); |
| 1836 | style_submenu_checkbox("hist", "History", 0, 0); |
| 1837 | style_submenu_element("Timeline", "%R/timeline?thread=%t", zName); |
| 1838 | if( g.perm.Admin ){ |
| 1839 | style_submenu_element("Artifacts", "%R/forumthreadhashlist/%t", zName); |
| 1840 | } |
| 1841 | |
| 1842 | /* Display the thread. */ |
| 1843 |
+32
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1758,10 +1758,14 @@ | ||
| 1758 | 1758 | ** nowiki Do not show wiki associated with branch or tag |
| 1759 | 1759 | ** ms=MATCHSTYLE Set tag name match algorithm. One of "exact", "glob", |
| 1760 | 1760 | ** "like", or "regexp". |
| 1761 | 1761 | ** u=USER Only show items associated with USER |
| 1762 | 1762 | ** y=TYPE 'ci', 'w', 't', 'n', 'e', 'f', 'h', or 'all'. |
| 1763 | +** thread=POST Show the complete history of the forum thread that | |
| 1764 | +** contains POST, including all edits, replies, and | |
| 1765 | +** tags. POST is a hash prefix or timestamp for any | |
| 1766 | +** post, reply, or edit within the thread. | |
| 1763 | 1767 | ** status=NAME With y=f or y=h, show only forum posts or threads |
| 1764 | 1768 | ** whose thread has status NAME. See the |
| 1765 | 1769 | ** forum-statuses setting. |
| 1766 | 1770 | ** ss=VIEWSTYLE c: "Compact", v: "Verbose", m: "Modern", j: "Columnar", |
| 1767 | 1771 | ** x: "Classic". |
| @@ -1856,10 +1860,11 @@ | ||
| 1856 | 1860 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1857 | 1861 | const char *zYear = P("year"); /* Events for the year YYYY */ |
| 1858 | 1862 | const char *zNDays = P("days"); /* Show events over the previous N days */ |
| 1859 | 1863 | int nDays = 0; /* Numeric value for zNDays */ |
| 1860 | 1864 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1865 | + const char *zThread = P("thread"); /* Show the forum thread holding this */ | |
| 1861 | 1866 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1862 | 1867 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1863 | 1868 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1864 | 1869 | int bisectLocal = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1865 | 1870 | const char *zBisect = P("bid"); /* Bisect description */ |
| @@ -2257,10 +2262,37 @@ | ||
| 2257 | 2262 | to_rid = from_rid; |
| 2258 | 2263 | blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ", |
| 2259 | 2264 | P("from"), from_to_mode==1 ? "forward" : "back", zTo); |
| 2260 | 2265 | } |
| 2261 | 2266 | } |
| 2267 | + if( zThread && g.perm.RdForum ){ | |
| 2268 | + /* If thread= is present, show every post, edit, reply, and tag | |
| 2269 | + ** associated with the forum thread that contains the post identified | |
| 2270 | + ** by thread=. Other parameters except vfx= are ignored. */ | |
| 2271 | + int fpid = symbolic_name_to_rid(zThread, "f"); | |
| 2272 | + int froot = 0; | |
| 2273 | + if( fpid>0 ){ | |
| 2274 | + froot = db_int(0, "SELECT froot FROM forumpost WHERE fpid=%d", fpid); | |
| 2275 | + } | |
| 2276 | + if( froot==0 ){ | |
| 2277 | + blob_appendf(&desc, "No such forum post: \"%h\"", zThread); | |
| 2278 | + }else{ | |
| 2279 | + char *zUuid; | |
| 2280 | + int n; | |
| 2281 | + forum_thread_artifacts("fthread", froot, 1, 0); | |
| 2282 | + blob_append_sql(&sql, " AND event.objid IN (SELECT rid FROM fthread)"); | |
| 2283 | + db_multi_exec("%s", blob_sql_text(&sql)); | |
| 2284 | + if( useDividers && !selectedRid ) selectedRid = fpid; | |
| 2285 | + n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div'"); | |
| 2286 | + zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", froot); | |
| 2287 | + blob_appendf(&desc, "%d event%s in the history of forum thread %z%S</a>", | |
| 2288 | + n, n==1 ? "" : "s", | |
| 2289 | + href("%R/forumthread/%!S", zUuid), zUuid); | |
| 2290 | + fossil_free(zUuid); | |
| 2291 | + } | |
| 2292 | + style_submenu_checkbox("vfx", "Content", 0, 0); | |
| 2293 | + }else | |
| 2262 | 2294 | if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){ |
| 2263 | 2295 | /* If from= and to= are present, display all nodes on a path connecting |
| 2264 | 2296 | ** the two */ |
| 2265 | 2297 | PathNode *p = 0; |
| 2266 | 2298 | const char *zFrom = 0; |
| 2267 | 2299 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1758,10 +1758,14 @@ | |
| 1758 | ** nowiki Do not show wiki associated with branch or tag |
| 1759 | ** ms=MATCHSTYLE Set tag name match algorithm. One of "exact", "glob", |
| 1760 | ** "like", or "regexp". |
| 1761 | ** u=USER Only show items associated with USER |
| 1762 | ** y=TYPE 'ci', 'w', 't', 'n', 'e', 'f', 'h', or 'all'. |
| 1763 | ** status=NAME With y=f or y=h, show only forum posts or threads |
| 1764 | ** whose thread has status NAME. See the |
| 1765 | ** forum-statuses setting. |
| 1766 | ** ss=VIEWSTYLE c: "Compact", v: "Verbose", m: "Modern", j: "Columnar", |
| 1767 | ** x: "Classic". |
| @@ -1856,10 +1860,11 @@ | |
| 1856 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1857 | const char *zYear = P("year"); /* Events for the year YYYY */ |
| 1858 | const char *zNDays = P("days"); /* Show events over the previous N days */ |
| 1859 | int nDays = 0; /* Numeric value for zNDays */ |
| 1860 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1861 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1862 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1863 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1864 | int bisectLocal = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1865 | const char *zBisect = P("bid"); /* Bisect description */ |
| @@ -2257,10 +2262,37 @@ | |
| 2257 | to_rid = from_rid; |
| 2258 | blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ", |
| 2259 | P("from"), from_to_mode==1 ? "forward" : "back", zTo); |
| 2260 | } |
| 2261 | } |
| 2262 | if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){ |
| 2263 | /* If from= and to= are present, display all nodes on a path connecting |
| 2264 | ** the two */ |
| 2265 | PathNode *p = 0; |
| 2266 | const char *zFrom = 0; |
| 2267 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1758,10 +1758,14 @@ | |
| 1758 | ** nowiki Do not show wiki associated with branch or tag |
| 1759 | ** ms=MATCHSTYLE Set tag name match algorithm. One of "exact", "glob", |
| 1760 | ** "like", or "regexp". |
| 1761 | ** u=USER Only show items associated with USER |
| 1762 | ** y=TYPE 'ci', 'w', 't', 'n', 'e', 'f', 'h', or 'all'. |
| 1763 | ** thread=POST Show the complete history of the forum thread that |
| 1764 | ** contains POST, including all edits, replies, and |
| 1765 | ** tags. POST is a hash prefix or timestamp for any |
| 1766 | ** post, reply, or edit within the thread. |
| 1767 | ** status=NAME With y=f or y=h, show only forum posts or threads |
| 1768 | ** whose thread has status NAME. See the |
| 1769 | ** forum-statuses setting. |
| 1770 | ** ss=VIEWSTYLE c: "Compact", v: "Verbose", m: "Modern", j: "Columnar", |
| 1771 | ** x: "Classic". |
| @@ -1856,10 +1860,11 @@ | |
| 1860 | const char *zDay = P("ymd"); /* Check-ins for the day YYYY-MM-DD */ |
| 1861 | const char *zYear = P("year"); /* Events for the year YYYY */ |
| 1862 | const char *zNDays = P("days"); /* Show events over the previous N days */ |
| 1863 | int nDays = 0; /* Numeric value for zNDays */ |
| 1864 | const char *zChng = P("chng"); /* List of GLOBs for files that changed */ |
| 1865 | const char *zThread = P("thread"); /* Show the forum thread holding this */ |
| 1866 | int useDividers = P("nd")==0; /* Show dividers if "nd" is missing */ |
| 1867 | int renameOnly = P("namechng")!=0; /* Show only check-ins that rename files */ |
| 1868 | int forkOnly = PB("forks"); /* Show only forks and their children */ |
| 1869 | int bisectLocal = PB("bisect"); /* Show the check-ins of the bisect */ |
| 1870 | const char *zBisect = P("bid"); /* Bisect description */ |
| @@ -2257,10 +2262,37 @@ | |
| 2262 | to_rid = from_rid; |
| 2263 | blob_appendf(&desc, "There is no path from %h %s to %h.<br>Instead: ", |
| 2264 | P("from"), from_to_mode==1 ? "forward" : "back", zTo); |
| 2265 | } |
| 2266 | } |
| 2267 | if( zThread && g.perm.RdForum ){ |
| 2268 | /* If thread= is present, show every post, edit, reply, and tag |
| 2269 | ** associated with the forum thread that contains the post identified |
| 2270 | ** by thread=. Other parameters except vfx= are ignored. */ |
| 2271 | int fpid = symbolic_name_to_rid(zThread, "f"); |
| 2272 | int froot = 0; |
| 2273 | if( fpid>0 ){ |
| 2274 | froot = db_int(0, "SELECT froot FROM forumpost WHERE fpid=%d", fpid); |
| 2275 | } |
| 2276 | if( froot==0 ){ |
| 2277 | blob_appendf(&desc, "No such forum post: \"%h\"", zThread); |
| 2278 | }else{ |
| 2279 | char *zUuid; |
| 2280 | int n; |
| 2281 | forum_thread_artifacts("fthread", froot, 1, 0); |
| 2282 | blob_append_sql(&sql, " AND event.objid IN (SELECT rid FROM fthread)"); |
| 2283 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 2284 | if( useDividers && !selectedRid ) selectedRid = fpid; |
| 2285 | n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div'"); |
| 2286 | zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", froot); |
| 2287 | blob_appendf(&desc, "%d event%s in the history of forum thread %z%S</a>", |
| 2288 | n, n==1 ? "" : "s", |
| 2289 | href("%R/forumthread/%!S", zUuid), zUuid); |
| 2290 | fossil_free(zUuid); |
| 2291 | } |
| 2292 | style_submenu_checkbox("vfx", "Content", 0, 0); |
| 2293 | }else |
| 2294 | if( ((from_rid && to_rid) || (me_rid && you_rid)) && g.perm.Read ){ |
| 2295 | /* If from= and to= are present, display all nodes on a path connecting |
| 2296 | ** the two */ |
| 2297 | PathNode *p = 0; |
| 2298 | const char *zFrom = 0; |
| 2299 |