Fossil SCM

/stats_report byuser user hyperlinks now link to bymonth (seems more useful) and links from by-user data to the timeline now filter the timeline on that user name. Minor word case changes.

stephan 2013-05-08 21:34 trunk
Commit 78bdddfb807f20fb08fc7b3facebd5d02bf29f25
1 file changed +11 -5
+11 -5
--- src/timeline.c
+++ src/timeline.c
@@ -1853,11 +1853,13 @@
18531853
int nEventsPerYear = 0; /* Total even count for the
18541854
current year */
18551855
char showYearTotal = 0; /* Flag telling us when to show
18561856
the per-year event totals */
18571857
Blob header = empty_blob; /* Page header text */
1858
- blob_appendf(&header, "Timeline Events by %s", zTimeLabel);
1858
+
1859
+ blob_appendf(&header, "Timeline Events by year%s",
1860
+ (includeMonth ? "/month" : ""));
18591861
blob_appendf(&sql,
18601862
"SELECT substr(date(mtime),1,%d) AS timeframe, "
18611863
"count(*) AS eventCount "
18621864
"FROM event ",
18631865
includeMonth ? 7 : 4);
@@ -1910,15 +1912,20 @@
19101912
nEventTotal += nCount;
19111913
nEventsPerYear += nCount;
19121914
@<tr class='row%d(rowClass)'>
19131915
@ <td>
19141916
if(includeMonth){
1915
- @ <a href="%s(g.zTop)/timeline?ym=%s(zTimeframe)&n=%d(nCount)"
1917
+ cgi_printf("<a href='%s/timeline?"
1918
+ "ym=%t&n=%d",
1919
+ g.zTop, zTimeframe, nCount );
19161920
/* Reminder: n=nCount is not actually correct for bymonth unless
19171921
that was the only user who caused events.
19181922
*/
1919
- @ target="_new">%s(zTimeframe)</a>
1923
+ if( zUserName && *zUserName ){
1924
+ cgi_printf("&u=%t", zUserName);
1925
+ }
1926
+ cgi_printf("' target='_new'>%s</a>",zTimeframe);
19201927
}else {
19211928
@ %s(zTimeframe)
19221929
}
19231930
@ </td><td>%d(nCount)</td>
19241931
@ <td>
@@ -1939,11 +1946,10 @@
19391946
@ <tr class='row%d(rowClass)'>
19401947
@ <td></td>
19411948
@ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
19421949
@</tr>
19431950
}
1944
-
19451951
#if 0
19461952
rowClass = ++nRowNumber % 2;
19471953
@ <tr class='row%d(rowClass)'>
19481954
@ <td colspan='3'>Total events: %d(nEventTotal)</td>
19491955
@ </tr>
@@ -1989,11 +1995,11 @@
19891995
if(!nCount) continue /* arguable! */;
19901996
rowClass = ++nRowNumber % 2;
19911997
nEventTotal += nCount;
19921998
@<tr class='row%d(rowClass)'>
19931999
@ <td>
1994
- @ <a href="?view=byyear&user=%h(zUser)" target="_new">%h(zUser)</a>
2000
+ @ <a href="?view=bymonth&user=%h(zUser)" target="_new">%h(zUser)</a>
19952001
@ </td><td>%d(nCount)</td>
19962002
@ <td>
19972003
@ <div class='statistics-report-graph-line'
19982004
@ style='height:16px;width:%d(nSize)px;'>
19992005
@ </div></td>
20002006
--- src/timeline.c
+++ src/timeline.c
@@ -1853,11 +1853,13 @@
1853 int nEventsPerYear = 0; /* Total even count for the
1854 current year */
1855 char showYearTotal = 0; /* Flag telling us when to show
1856 the per-year event totals */
1857 Blob header = empty_blob; /* Page header text */
1858 blob_appendf(&header, "Timeline Events by %s", zTimeLabel);
 
 
1859 blob_appendf(&sql,
1860 "SELECT substr(date(mtime),1,%d) AS timeframe, "
1861 "count(*) AS eventCount "
1862 "FROM event ",
1863 includeMonth ? 7 : 4);
@@ -1910,15 +1912,20 @@
1910 nEventTotal += nCount;
1911 nEventsPerYear += nCount;
1912 @<tr class='row%d(rowClass)'>
1913 @ <td>
1914 if(includeMonth){
1915 @ <a href="%s(g.zTop)/timeline?ym=%s(zTimeframe)&n=%d(nCount)"
 
 
1916 /* Reminder: n=nCount is not actually correct for bymonth unless
1917 that was the only user who caused events.
1918 */
1919 @ target="_new">%s(zTimeframe)</a>
 
 
 
1920 }else {
1921 @ %s(zTimeframe)
1922 }
1923 @ </td><td>%d(nCount)</td>
1924 @ <td>
@@ -1939,11 +1946,10 @@
1939 @ <tr class='row%d(rowClass)'>
1940 @ <td></td>
1941 @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
1942 @</tr>
1943 }
1944
1945 #if 0
1946 rowClass = ++nRowNumber % 2;
1947 @ <tr class='row%d(rowClass)'>
1948 @ <td colspan='3'>Total events: %d(nEventTotal)</td>
1949 @ </tr>
@@ -1989,11 +1995,11 @@
1989 if(!nCount) continue /* arguable! */;
1990 rowClass = ++nRowNumber % 2;
1991 nEventTotal += nCount;
1992 @<tr class='row%d(rowClass)'>
1993 @ <td>
1994 @ <a href="?view=byyear&user=%h(zUser)" target="_new">%h(zUser)</a>
1995 @ </td><td>%d(nCount)</td>
1996 @ <td>
1997 @ <div class='statistics-report-graph-line'
1998 @ style='height:16px;width:%d(nSize)px;'>
1999 @ </div></td>
2000
--- src/timeline.c
+++ src/timeline.c
@@ -1853,11 +1853,13 @@
1853 int nEventsPerYear = 0; /* Total even count for the
1854 current year */
1855 char showYearTotal = 0; /* Flag telling us when to show
1856 the per-year event totals */
1857 Blob header = empty_blob; /* Page header text */
1858
1859 blob_appendf(&header, "Timeline Events by year%s",
1860 (includeMonth ? "/month" : ""));
1861 blob_appendf(&sql,
1862 "SELECT substr(date(mtime),1,%d) AS timeframe, "
1863 "count(*) AS eventCount "
1864 "FROM event ",
1865 includeMonth ? 7 : 4);
@@ -1910,15 +1912,20 @@
1912 nEventTotal += nCount;
1913 nEventsPerYear += nCount;
1914 @<tr class='row%d(rowClass)'>
1915 @ <td>
1916 if(includeMonth){
1917 cgi_printf("<a href='%s/timeline?"
1918 "ym=%t&n=%d",
1919 g.zTop, zTimeframe, nCount );
1920 /* Reminder: n=nCount is not actually correct for bymonth unless
1921 that was the only user who caused events.
1922 */
1923 if( zUserName && *zUserName ){
1924 cgi_printf("&u=%t", zUserName);
1925 }
1926 cgi_printf("' target='_new'>%s</a>",zTimeframe);
1927 }else {
1928 @ %s(zTimeframe)
1929 }
1930 @ </td><td>%d(nCount)</td>
1931 @ <td>
@@ -1939,11 +1946,10 @@
1946 @ <tr class='row%d(rowClass)'>
1947 @ <td></td>
1948 @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
1949 @</tr>
1950 }
 
1951 #if 0
1952 rowClass = ++nRowNumber % 2;
1953 @ <tr class='row%d(rowClass)'>
1954 @ <td colspan='3'>Total events: %d(nEventTotal)</td>
1955 @ </tr>
@@ -1989,11 +1995,11 @@
1995 if(!nCount) continue /* arguable! */;
1996 rowClass = ++nRowNumber % 2;
1997 nEventTotal += nCount;
1998 @<tr class='row%d(rowClass)'>
1999 @ <td>
2000 @ <a href="?view=bymonth&user=%h(zUser)" target="_new">%h(zUser)</a>
2001 @ </td><td>%d(nCount)</td>
2002 @ <td>
2003 @ <div class='statistics-report-graph-line'
2004 @ style='height:16px;width:%d(nSize)px;'>
2005 @ </div></td>
2006

Keyboard Shortcuts

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