Fossil SCM

Removed the week list from the byyear report (now obsolete?), refactored how it is displayed so it can be turned on later. Minor text touch-ups.

stephan 2013-07-16 20:43 UTC stats-report-weekly
Commit cf71d6777f06544ab8047228c74a32c73c5cddf1
1 file changed +7 -6
+7 -6
--- src/timeline.c
+++ src/timeline.c
@@ -1870,10 +1870,11 @@
18701870
** else the "byyear" report. If zUserName is not NULL and not empty
18711871
** then the report is restricted to events created by the named user
18721872
** account.
18731873
*/
18741874
static void stats_report_by_month_year(char includeMonth,
1875
+ char includeWeeks,
18751876
char const * zUserName){
18761877
Stmt query = empty_Stmt;
18771878
int const nPixelsPerEvent = 1; /* for sizing the "graph" part */
18781879
int nRowNumber = 0; /* current TR number */
18791880
int nEventTotal = 0; /* Total event count */
@@ -1964,11 +1965,11 @@
19641965
@ <td>
19651966
@ <div class='statistics-report-graph-line'
19661967
@ style='height:16px;width:%d(nSize)px;'>
19671968
@ </div></td>
19681969
@</tr>
1969
- if(!includeMonth){
1970
+ if(includeWeeks){
19701971
/* This part works fine for months but it terribly slow (4.5s on my PC),
19711972
so it's only shown for by-year for now. Suggestions/patches for
19721973
a better/faster layout are welcomed. */
19731974
@ <tr class='row%d(rowClass)'>
19741975
@ <td colspan='2' class='statistics-report-week-number-label'>Week #:</td>
@@ -2067,11 +2068,11 @@
20672068
char const * zYear = P("y");
20682069
int nYear = zYear ? strlen(zYear) : 0;
20692070
int i = 0;
20702071
Stmt qYears = empty_Stmt;
20712072
char * zDefaultYear = NULL;
2072
- cgi_printf("Select a year: ");
2073
+ cgi_printf("Select year: ");
20732074
db_prepare(&qYears,
20742075
"SELECT DISTINCT substr(date(mtime),1,4) AS y "
20752076
"FROM event GROUP BY y ORDER BY y");
20762077
while( SQLITE_ROW == db_step(&qYears) ){
20772078
char const * zT = db_column_text(&qYears, 0);
@@ -2096,11 +2097,11 @@
20962097
zYear);
20972098
cgi_printf("<table class='statistics-report-table-events' "
20982099
"border='0' cellpadding='2' "
20992100
"cellspacing='0' id='statsTable'>");
21002101
cgi_printf("<thead><tr>"
2101
- "<th>Week #</th>"
2102
+ "<th>Week</th>"
21022103
"<th>Events</th>"
21032104
"<th><!-- relative commits graph --></th>"
21042105
"</tr></thead>"
21052106
"<tbody>");
21062107
db_prepare(&stWeek,
@@ -2126,13 +2127,13 @@
21262127
graphSize);
21272128
}
21282129
cgi_printf("</td></tr>");
21292130
}
21302131
db_finalize(&stWeek);
2132
+ free(zDefaultYear);
21312133
cgi_printf("</tbody></table>");
21322134
output_table_sorting_javascript("statsTable","tnx");
2133
- free(zDefaultYear);
21342135
}
21352136
}
21362137
21372138
/*
21382139
** WEBPAGE: stats_report
@@ -2159,13 +2160,13 @@
21592160
timeline_submenu(&url, "By Week", "view", "byweek", 0);
21602161
timeline_submenu(&url, "By User", "view", "byuser", "user");
21612162
url_reset(&url);
21622163
style_header("Activity Reports");
21632164
if(0==fossil_strcmp(zView,"byyear")){
2164
- stats_report_by_month_year(0, zUserName);
2165
+ stats_report_by_month_year(0, 0, zUserName);
21652166
}else if(0==fossil_strcmp(zView,"bymonth")){
2166
- stats_report_by_month_year(1, zUserName);
2167
+ stats_report_by_month_year(1, 0, zUserName);
21672168
}else if(0==fossil_strcmp(zView,"byweek")){
21682169
stats_report_year_weeks();
21692170
}else if(0==fossil_strcmp(zView,"byuser")){
21702171
stats_report_by_user();
21712172
}else{
21722173
--- src/timeline.c
+++ src/timeline.c
@@ -1870,10 +1870,11 @@
1870 ** else the "byyear" report. If zUserName is not NULL and not empty
1871 ** then the report is restricted to events created by the named user
1872 ** account.
1873 */
1874 static void stats_report_by_month_year(char includeMonth,
 
1875 char const * zUserName){
1876 Stmt query = empty_Stmt;
1877 int const nPixelsPerEvent = 1; /* for sizing the "graph" part */
1878 int nRowNumber = 0; /* current TR number */
1879 int nEventTotal = 0; /* Total event count */
@@ -1964,11 +1965,11 @@
1964 @ <td>
1965 @ <div class='statistics-report-graph-line'
1966 @ style='height:16px;width:%d(nSize)px;'>
1967 @ </div></td>
1968 @</tr>
1969 if(!includeMonth){
1970 /* This part works fine for months but it terribly slow (4.5s on my PC),
1971 so it's only shown for by-year for now. Suggestions/patches for
1972 a better/faster layout are welcomed. */
1973 @ <tr class='row%d(rowClass)'>
1974 @ <td colspan='2' class='statistics-report-week-number-label'>Week #:</td>
@@ -2067,11 +2068,11 @@
2067 char const * zYear = P("y");
2068 int nYear = zYear ? strlen(zYear) : 0;
2069 int i = 0;
2070 Stmt qYears = empty_Stmt;
2071 char * zDefaultYear = NULL;
2072 cgi_printf("Select a year: ");
2073 db_prepare(&qYears,
2074 "SELECT DISTINCT substr(date(mtime),1,4) AS y "
2075 "FROM event GROUP BY y ORDER BY y");
2076 while( SQLITE_ROW == db_step(&qYears) ){
2077 char const * zT = db_column_text(&qYears, 0);
@@ -2096,11 +2097,11 @@
2096 zYear);
2097 cgi_printf("<table class='statistics-report-table-events' "
2098 "border='0' cellpadding='2' "
2099 "cellspacing='0' id='statsTable'>");
2100 cgi_printf("<thead><tr>"
2101 "<th>Week #</th>"
2102 "<th>Events</th>"
2103 "<th><!-- relative commits graph --></th>"
2104 "</tr></thead>"
2105 "<tbody>");
2106 db_prepare(&stWeek,
@@ -2126,13 +2127,13 @@
2126 graphSize);
2127 }
2128 cgi_printf("</td></tr>");
2129 }
2130 db_finalize(&stWeek);
 
2131 cgi_printf("</tbody></table>");
2132 output_table_sorting_javascript("statsTable","tnx");
2133 free(zDefaultYear);
2134 }
2135 }
2136
2137 /*
2138 ** WEBPAGE: stats_report
@@ -2159,13 +2160,13 @@
2159 timeline_submenu(&url, "By Week", "view", "byweek", 0);
2160 timeline_submenu(&url, "By User", "view", "byuser", "user");
2161 url_reset(&url);
2162 style_header("Activity Reports");
2163 if(0==fossil_strcmp(zView,"byyear")){
2164 stats_report_by_month_year(0, zUserName);
2165 }else if(0==fossil_strcmp(zView,"bymonth")){
2166 stats_report_by_month_year(1, zUserName);
2167 }else if(0==fossil_strcmp(zView,"byweek")){
2168 stats_report_year_weeks();
2169 }else if(0==fossil_strcmp(zView,"byuser")){
2170 stats_report_by_user();
2171 }else{
2172
--- src/timeline.c
+++ src/timeline.c
@@ -1870,10 +1870,11 @@
1870 ** else the "byyear" report. If zUserName is not NULL and not empty
1871 ** then the report is restricted to events created by the named user
1872 ** account.
1873 */
1874 static void stats_report_by_month_year(char includeMonth,
1875 char includeWeeks,
1876 char const * zUserName){
1877 Stmt query = empty_Stmt;
1878 int const nPixelsPerEvent = 1; /* for sizing the "graph" part */
1879 int nRowNumber = 0; /* current TR number */
1880 int nEventTotal = 0; /* Total event count */
@@ -1964,11 +1965,11 @@
1965 @ <td>
1966 @ <div class='statistics-report-graph-line'
1967 @ style='height:16px;width:%d(nSize)px;'>
1968 @ </div></td>
1969 @</tr>
1970 if(includeWeeks){
1971 /* This part works fine for months but it terribly slow (4.5s on my PC),
1972 so it's only shown for by-year for now. Suggestions/patches for
1973 a better/faster layout are welcomed. */
1974 @ <tr class='row%d(rowClass)'>
1975 @ <td colspan='2' class='statistics-report-week-number-label'>Week #:</td>
@@ -2067,11 +2068,11 @@
2068 char const * zYear = P("y");
2069 int nYear = zYear ? strlen(zYear) : 0;
2070 int i = 0;
2071 Stmt qYears = empty_Stmt;
2072 char * zDefaultYear = NULL;
2073 cgi_printf("Select year: ");
2074 db_prepare(&qYears,
2075 "SELECT DISTINCT substr(date(mtime),1,4) AS y "
2076 "FROM event GROUP BY y ORDER BY y");
2077 while( SQLITE_ROW == db_step(&qYears) ){
2078 char const * zT = db_column_text(&qYears, 0);
@@ -2096,11 +2097,11 @@
2097 zYear);
2098 cgi_printf("<table class='statistics-report-table-events' "
2099 "border='0' cellpadding='2' "
2100 "cellspacing='0' id='statsTable'>");
2101 cgi_printf("<thead><tr>"
2102 "<th>Week</th>"
2103 "<th>Events</th>"
2104 "<th><!-- relative commits graph --></th>"
2105 "</tr></thead>"
2106 "<tbody>");
2107 db_prepare(&stWeek,
@@ -2126,13 +2127,13 @@
2127 graphSize);
2128 }
2129 cgi_printf("</td></tr>");
2130 }
2131 db_finalize(&stWeek);
2132 free(zDefaultYear);
2133 cgi_printf("</tbody></table>");
2134 output_table_sorting_javascript("statsTable","tnx");
 
2135 }
2136 }
2137
2138 /*
2139 ** WEBPAGE: stats_report
@@ -2159,13 +2160,13 @@
2160 timeline_submenu(&url, "By Week", "view", "byweek", 0);
2161 timeline_submenu(&url, "By User", "view", "byuser", "user");
2162 url_reset(&url);
2163 style_header("Activity Reports");
2164 if(0==fossil_strcmp(zView,"byyear")){
2165 stats_report_by_month_year(0, 0, zUserName);
2166 }else if(0==fossil_strcmp(zView,"bymonth")){
2167 stats_report_by_month_year(1, 0, zUserName);
2168 }else if(0==fossil_strcmp(zView,"byweek")){
2169 stats_report_year_weeks();
2170 }else if(0==fossil_strcmp(zView,"byuser")){
2171 stats_report_by_user();
2172 }else{
2173

Keyboard Shortcuts

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