Fossil SCM

Minor cosmetic tweaks to /activity page. No counts all events, not just commits.

stephan 2013-05-04 21:47 trunk
Commit 2889bfb227e6da1631eede4625c29e75f8f3d4ca
1 file changed +11 -12
+11 -12
--- src/timeline.c
+++ src/timeline.c
@@ -1834,46 +1834,45 @@
18341834
**
18351835
** Shows an activity report for the repository.
18361836
*/
18371837
void activity_page(){
18381838
Stmt query = empty_Stmt;
1839
- int const nPixelsPerCommit = 2;
1839
+ int const nPixelsPerEvent = 1;
18401840
int nRowNumber = 0;
18411841
int nCommitCount = 0;
1842
+ int rowClass = 0;
18421843
style_header("Repository Activity");
18431844
db_prepare(&query,
18441845
"SELECT substr(date(mtime),1,7) AS Month, "
18451846
"count(*) AS Commits FROM event "
1846
- "WHERE type='ci' "
18471847
"GROUP BY Month "
18481848
"ORDER BY Month DESC", -1);
1849
- @ <h1>Commits by Month</h1>
1849
+ @ <h1>Timeline Events by Month</h1>
18501850
@ <table class='activity-table-commits-by-month' border='0' cellpadding='2' cellspacing='0'>
18511851
@ <thead>
18521852
@ <th>Year/Month</th>
1853
- @ <th>Commits</th>
1853
+ @ <th>Events</th>
18541854
@ <th><!-- relative commits graph --></th>
18551855
@ </thead><tbody>
18561856
while( SQLITE_ROW == db_step(&query) ){
18571857
char const * zMonth = db_column_text(&query, 0);
18581858
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;
18651861
nCommitCount += nCount;
18661862
@<tr class='row%d(rowClass)'>
18671863
@ <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>
18691865
@ </td><td>%d(nCount)</td>
18701866
@ <td>
18711867
@ <div class='activity-graph-line' style='height:16px; width:%d(nSize)px;'>
18721868
@ </div></td>
18731869
@</tr>
18741870
}
1871
+ rowClass = ++nRowNumber % 2;
1872
+ @ <tr class='row%d(rowClass)'>
1873
+ @ <td colspan='3'>Total events: %d(nCommitCount)</td>
1874
+ @ </tr>
18751875
@ </tbody></table>
1876
- @ Total commits: %d(nCommitCount)
18771876
db_finalize(&query);
18781877
style_footer();
18791878
}
18801879
--- 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

Keyboard Shortcuts

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