Fossil

Check-in [78bdddfb80]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:/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.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 78bdddfb807f20fb08fc7b3facebd5d02bf29f25
User & Date: stephan 2013-05-08 21:34:30.072
Context
2013-05-09
15:30
Add submenu elements to the web-based "annotate" display to turn features on and off. Make the default depth of an annotation 20. ... (check-in: f4bcdb62fb user: drh tags: trunk)
2013-05-08
21:34
/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. ... (check-in: 78bdddfb80 user: stephan tags: trunk)
20:18
Fixed a logic error in the only-run-once timer init code. ... (check-in: 9fab0f8125 user: stephan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/timeline.c.
1851
1852
1853
1854
1855
1856
1857

1858

1859
1860
1861
1862
1863
1864
1865
  char zPrevYear[5] = {0};           /* For keeping track of when
                                        we change years while looping */
  int nEventsPerYear = 0;            /* Total even count for the
                                        current year */
  char showYearTotal = 0;            /* Flag telling us when to show
                                        the per-year event totals */
  Blob header = empty_blob;          /* Page header text */

  blob_appendf(&header, "Timeline Events by %s", zTimeLabel);

  blob_appendf(&sql,
               "SELECT substr(date(mtime),1,%d) AS timeframe, "
               "count(*) AS eventCount "
               "FROM event ",
               includeMonth ? 7 : 4);
  if(zUserName&&*zUserName){
    blob_appendf(&sql, " WHERE user=%Q ", zUserName);







>
|
>







1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
  char zPrevYear[5] = {0};           /* For keeping track of when
                                        we change years while looping */
  int nEventsPerYear = 0;            /* Total even count for the
                                        current year */
  char showYearTotal = 0;            /* Flag telling us when to show
                                        the per-year event totals */
  Blob header = empty_blob;          /* Page header text */

  blob_appendf(&header, "Timeline Events by year%s",
               (includeMonth ? "/month" : ""));
  blob_appendf(&sql,
               "SELECT substr(date(mtime),1,%d) AS timeframe, "
               "count(*) AS eventCount "
               "FROM event ",
               includeMonth ? 7 : 4);
  if(zUserName&&*zUserName){
    blob_appendf(&sql, " WHERE user=%Q ", zUserName);
1908
1909
1910
1911
1912
1913
1914
1915


1916
1917
1918



1919
1920
1921
1922
1923
1924
1925
1926
    }
    rowClass = ++nRowNumber % 2;
    nEventTotal += nCount;
    nEventsPerYear += nCount;
    @<tr class='row%d(rowClass)'>
    @ <td>
    if(includeMonth){
      @ <a href="%s(g.zTop)/timeline?ym=%s(zTimeframe)&n=%d(nCount)"


      /* Reminder: n=nCount is not actually correct for bymonth unless
         that was the only user who caused events.
      */



      @  target="_new">%s(zTimeframe)</a>
    }else {
      @ %s(zTimeframe)
    }
    @ </td><td>%d(nCount)</td>
    @ <td>
    @ <div class='statistics-report-graph-line'
    @  style='height:16px;width:%d(nSize)px;'>







|
>
>



>
>
>
|







1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
    }
    rowClass = ++nRowNumber % 2;
    nEventTotal += nCount;
    nEventsPerYear += nCount;
    @<tr class='row%d(rowClass)'>
    @ <td>
    if(includeMonth){
      cgi_printf("<a href='%s/timeline?"
                 "ym=%t&n=%d",
                 g.zTop, zTimeframe, nCount );
      /* Reminder: n=nCount is not actually correct for bymonth unless
         that was the only user who caused events.
      */
      if( zUserName && *zUserName ){
        cgi_printf("&u=%t", zUserName);
      }
      cgi_printf("' target='_new'>%s</a>",zTimeframe);
    }else {
      @ %s(zTimeframe)
    }
    @ </td><td>%d(nCount)</td>
    @ <td>
    @ <div class='statistics-report-graph-line'
    @  style='height:16px;width:%d(nSize)px;'>
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
    /* Add final year total separator. */
    rowClass = ++nRowNumber % 2;
    @ <tr class='row%d(rowClass)'>
    @ <td></td>
    @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
    @</tr>    
  }

#if 0
  rowClass = ++nRowNumber % 2;
  @ <tr class='row%d(rowClass)'>
  @   <td colspan='3'>Total events: %d(nEventTotal)</td>
  @ </tr>
#endif
  @ </tbody></table>







<







1944
1945
1946
1947
1948
1949
1950

1951
1952
1953
1954
1955
1956
1957
    /* Add final year total separator. */
    rowClass = ++nRowNumber % 2;
    @ <tr class='row%d(rowClass)'>
    @ <td></td>
    @ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
    @</tr>    
  }

#if 0
  rowClass = ++nRowNumber % 2;
  @ <tr class='row%d(rowClass)'>
  @   <td colspan='3'>Total events: %d(nEventTotal)</td>
  @ </tr>
#endif
  @ </tbody></table>
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
    int const nCount = db_column_int(&query, 1);
    int const nSize = 1+((nPixelsPerEvent * nCount) / 10);
    if(!nCount) continue /* arguable! */;
    rowClass = ++nRowNumber % 2;
    nEventTotal += nCount;
    @<tr class='row%d(rowClass)'>
    @ <td>
    @ <a href="?view=byyear&user=%h(zUser)" target="_new">%h(zUser)</a>
    @ </td><td>%d(nCount)</td>
    @ <td>
    @ <div class='statistics-report-graph-line'
    @  style='height:16px;width:%d(nSize)px;'>
    @ </div></td>
    @</tr>
    /*







|







1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
    int const nCount = db_column_int(&query, 1);
    int const nSize = 1+((nPixelsPerEvent * nCount) / 10);
    if(!nCount) continue /* arguable! */;
    rowClass = ++nRowNumber % 2;
    nEventTotal += nCount;
    @<tr class='row%d(rowClass)'>
    @ <td>
    @ <a href="?view=bymonth&user=%h(zUser)" target="_new">%h(zUser)</a>
    @ </td><td>%d(nCount)</td>
    @ <td>
    @ <div class='statistics-report-graph-line'
    @  style='height:16px;width:%d(nSize)px;'>
    @ </div></td>
    @</tr>
    /*