Fossil SCM
Minor cosmetic tweaks to /activity page. No counts all events, not just commits.
Commit
2889bfb227e6da1631eede4625c29e75f8f3d4ca
Parent
d16c09f8c106965…
1 file changed
+11
-12
+11
-12
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1834,46 +1834,45 @@ | ||
| 1834 | 1834 | ** |
| 1835 | 1835 | ** Shows an activity report for the repository. |
| 1836 | 1836 | */ |
| 1837 | 1837 | void activity_page(){ |
| 1838 | 1838 | Stmt query = empty_Stmt; |
| 1839 | - int const nPixelsPerCommit = 2; | |
| 1839 | + int const nPixelsPerEvent = 1; | |
| 1840 | 1840 | int nRowNumber = 0; |
| 1841 | 1841 | int nCommitCount = 0; |
| 1842 | + int rowClass = 0; | |
| 1842 | 1843 | style_header("Repository Activity"); |
| 1843 | 1844 | db_prepare(&query, |
| 1844 | 1845 | "SELECT substr(date(mtime),1,7) AS Month, " |
| 1845 | 1846 | "count(*) AS Commits FROM event " |
| 1846 | - "WHERE type='ci' " | |
| 1847 | 1847 | "GROUP BY Month " |
| 1848 | 1848 | "ORDER BY Month DESC", -1); |
| 1849 | - @ <h1>Commits by Month</h1> | |
| 1849 | + @ <h1>Timeline Events by Month</h1> | |
| 1850 | 1850 | @ <table class='activity-table-commits-by-month' border='0' cellpadding='2' cellspacing='0'> |
| 1851 | 1851 | @ <thead> |
| 1852 | 1852 | @ <th>Year/Month</th> |
| 1853 | - @ <th>Commits</th> | |
| 1853 | + @ <th>Events</th> | |
| 1854 | 1854 | @ <th><!-- relative commits graph --></th> |
| 1855 | 1855 | @ </thead><tbody> |
| 1856 | 1856 | while( SQLITE_ROW == db_step(&query) ){ |
| 1857 | 1857 | char const * zMonth = db_column_text(&query, 0); |
| 1858 | 1858 | int const nCount = db_column_int(&query, 1); |
| 1859 | - int const nSize = nPixelsPerCommit * nCount; | |
| 1860 | - char const rowClass = ++nRowNumber % 2; | |
| 1861 | - int const nTimelineCount = | |
| 1862 | - db_int(200, "SELECT COUNT(*) FROM event WHERE " | |
| 1863 | - "substr(date(mtime),1,7)=%Q", | |
| 1864 | - zMonth); | |
| 1859 | + int const nSize = nPixelsPerEvent * nCount; | |
| 1860 | + rowClass = ++nRowNumber % 2; | |
| 1865 | 1861 | nCommitCount += nCount; |
| 1866 | 1862 | @<tr class='row%d(rowClass)'> |
| 1867 | 1863 | @ <td> |
| 1868 | - @ <a href="%s(g.zTop)/timeline?ym=%s(zMonth)&n=%d(nTimelineCount)" target="_new">%s(zMonth)</a> | |
| 1864 | + @ <a href="%s(g.zTop)/timeline?ym=%s(zMonth)&n=%d(nCount)" target="_new">%s(zMonth)</a> | |
| 1869 | 1865 | @ </td><td>%d(nCount)</td> |
| 1870 | 1866 | @ <td> |
| 1871 | 1867 | @ <div class='activity-graph-line' style='height:16px; width:%d(nSize)px;'> |
| 1872 | 1868 | @ </div></td> |
| 1873 | 1869 | @</tr> |
| 1874 | 1870 | } |
| 1871 | + rowClass = ++nRowNumber % 2; | |
| 1872 | + @ <tr class='row%d(rowClass)'> | |
| 1873 | + @ <td colspan='3'>Total events: %d(nCommitCount)</td> | |
| 1874 | + @ </tr> | |
| 1875 | 1875 | @ </tbody></table> |
| 1876 | - @ Total commits: %d(nCommitCount) | |
| 1877 | 1876 | db_finalize(&query); |
| 1878 | 1877 | style_footer(); |
| 1879 | 1878 | } |
| 1880 | 1879 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1834,46 +1834,45 @@ | |
| 1834 | ** |
| 1835 | ** Shows an activity report for the repository. |
| 1836 | */ |
| 1837 | void activity_page(){ |
| 1838 | Stmt query = empty_Stmt; |
| 1839 | int const nPixelsPerCommit = 2; |
| 1840 | int nRowNumber = 0; |
| 1841 | int nCommitCount = 0; |
| 1842 | style_header("Repository Activity"); |
| 1843 | db_prepare(&query, |
| 1844 | "SELECT substr(date(mtime),1,7) AS Month, " |
| 1845 | "count(*) AS Commits FROM event " |
| 1846 | "WHERE type='ci' " |
| 1847 | "GROUP BY Month " |
| 1848 | "ORDER BY Month DESC", -1); |
| 1849 | @ <h1>Commits by Month</h1> |
| 1850 | @ <table class='activity-table-commits-by-month' border='0' cellpadding='2' cellspacing='0'> |
| 1851 | @ <thead> |
| 1852 | @ <th>Year/Month</th> |
| 1853 | @ <th>Commits</th> |
| 1854 | @ <th><!-- relative commits graph --></th> |
| 1855 | @ </thead><tbody> |
| 1856 | while( SQLITE_ROW == db_step(&query) ){ |
| 1857 | char const * zMonth = db_column_text(&query, 0); |
| 1858 | int const nCount = db_column_int(&query, 1); |
| 1859 | int const nSize = nPixelsPerCommit * nCount; |
| 1860 | char const rowClass = ++nRowNumber % 2; |
| 1861 | int const nTimelineCount = |
| 1862 | db_int(200, "SELECT COUNT(*) FROM event WHERE " |
| 1863 | "substr(date(mtime),1,7)=%Q", |
| 1864 | zMonth); |
| 1865 | nCommitCount += nCount; |
| 1866 | @<tr class='row%d(rowClass)'> |
| 1867 | @ <td> |
| 1868 | @ <a href="%s(g.zTop)/timeline?ym=%s(zMonth)&n=%d(nTimelineCount)" target="_new">%s(zMonth)</a> |
| 1869 | @ </td><td>%d(nCount)</td> |
| 1870 | @ <td> |
| 1871 | @ <div class='activity-graph-line' style='height:16px; width:%d(nSize)px;'> |
| 1872 | @ </div></td> |
| 1873 | @</tr> |
| 1874 | } |
| 1875 | @ </tbody></table> |
| 1876 | @ Total commits: %d(nCommitCount) |
| 1877 | db_finalize(&query); |
| 1878 | style_footer(); |
| 1879 | } |
| 1880 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1834,46 +1834,45 @@ | |
| 1834 | ** |
| 1835 | ** Shows an activity report for the repository. |
| 1836 | */ |
| 1837 | void activity_page(){ |
| 1838 | Stmt query = empty_Stmt; |
| 1839 | int const nPixelsPerEvent = 1; |
| 1840 | int nRowNumber = 0; |
| 1841 | int nCommitCount = 0; |
| 1842 | int rowClass = 0; |
| 1843 | style_header("Repository Activity"); |
| 1844 | db_prepare(&query, |
| 1845 | "SELECT substr(date(mtime),1,7) AS Month, " |
| 1846 | "count(*) AS Commits FROM event " |
| 1847 | "GROUP BY Month " |
| 1848 | "ORDER BY Month DESC", -1); |
| 1849 | @ <h1>Timeline Events by Month</h1> |
| 1850 | @ <table class='activity-table-commits-by-month' border='0' cellpadding='2' cellspacing='0'> |
| 1851 | @ <thead> |
| 1852 | @ <th>Year/Month</th> |
| 1853 | @ <th>Events</th> |
| 1854 | @ <th><!-- relative commits graph --></th> |
| 1855 | @ </thead><tbody> |
| 1856 | while( SQLITE_ROW == db_step(&query) ){ |
| 1857 | char const * zMonth = db_column_text(&query, 0); |
| 1858 | int const nCount = db_column_int(&query, 1); |
| 1859 | int const nSize = nPixelsPerEvent * nCount; |
| 1860 | rowClass = ++nRowNumber % 2; |
| 1861 | nCommitCount += nCount; |
| 1862 | @<tr class='row%d(rowClass)'> |
| 1863 | @ <td> |
| 1864 | @ <a href="%s(g.zTop)/timeline?ym=%s(zMonth)&n=%d(nCount)" target="_new">%s(zMonth)</a> |
| 1865 | @ </td><td>%d(nCount)</td> |
| 1866 | @ <td> |
| 1867 | @ <div class='activity-graph-line' style='height:16px; width:%d(nSize)px;'> |
| 1868 | @ </div></td> |
| 1869 | @</tr> |
| 1870 | } |
| 1871 | rowClass = ++nRowNumber % 2; |
| 1872 | @ <tr class='row%d(rowClass)'> |
| 1873 | @ <td colspan='3'>Total events: %d(nCommitCount)</td> |
| 1874 | @ </tr> |
| 1875 | @ </tbody></table> |
| 1876 | db_finalize(&query); |
| 1877 | style_footer(); |
| 1878 | } |
| 1879 |