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.
Commit
cf71d6777f06544ab8047228c74a32c73c5cddf1
Parent
747bca14c02a9fb…
1 file changed
+7
-6
+7
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1870,10 +1870,11 @@ | ||
| 1870 | 1870 | ** else the "byyear" report. If zUserName is not NULL and not empty |
| 1871 | 1871 | ** then the report is restricted to events created by the named user |
| 1872 | 1872 | ** account. |
| 1873 | 1873 | */ |
| 1874 | 1874 | static void stats_report_by_month_year(char includeMonth, |
| 1875 | + char includeWeeks, | |
| 1875 | 1876 | char const * zUserName){ |
| 1876 | 1877 | Stmt query = empty_Stmt; |
| 1877 | 1878 | int const nPixelsPerEvent = 1; /* for sizing the "graph" part */ |
| 1878 | 1879 | int nRowNumber = 0; /* current TR number */ |
| 1879 | 1880 | int nEventTotal = 0; /* Total event count */ |
| @@ -1964,11 +1965,11 @@ | ||
| 1964 | 1965 | @ <td> |
| 1965 | 1966 | @ <div class='statistics-report-graph-line' |
| 1966 | 1967 | @ style='height:16px;width:%d(nSize)px;'> |
| 1967 | 1968 | @ </div></td> |
| 1968 | 1969 | @</tr> |
| 1969 | - if(!includeMonth){ | |
| 1970 | + if(includeWeeks){ | |
| 1970 | 1971 | /* This part works fine for months but it terribly slow (4.5s on my PC), |
| 1971 | 1972 | so it's only shown for by-year for now. Suggestions/patches for |
| 1972 | 1973 | a better/faster layout are welcomed. */ |
| 1973 | 1974 | @ <tr class='row%d(rowClass)'> |
| 1974 | 1975 | @ <td colspan='2' class='statistics-report-week-number-label'>Week #:</td> |
| @@ -2067,11 +2068,11 @@ | ||
| 2067 | 2068 | char const * zYear = P("y"); |
| 2068 | 2069 | int nYear = zYear ? strlen(zYear) : 0; |
| 2069 | 2070 | int i = 0; |
| 2070 | 2071 | Stmt qYears = empty_Stmt; |
| 2071 | 2072 | char * zDefaultYear = NULL; |
| 2072 | - cgi_printf("Select a year: "); | |
| 2073 | + cgi_printf("Select year: "); | |
| 2073 | 2074 | db_prepare(&qYears, |
| 2074 | 2075 | "SELECT DISTINCT substr(date(mtime),1,4) AS y " |
| 2075 | 2076 | "FROM event GROUP BY y ORDER BY y"); |
| 2076 | 2077 | while( SQLITE_ROW == db_step(&qYears) ){ |
| 2077 | 2078 | char const * zT = db_column_text(&qYears, 0); |
| @@ -2096,11 +2097,11 @@ | ||
| 2096 | 2097 | zYear); |
| 2097 | 2098 | cgi_printf("<table class='statistics-report-table-events' " |
| 2098 | 2099 | "border='0' cellpadding='2' " |
| 2099 | 2100 | "cellspacing='0' id='statsTable'>"); |
| 2100 | 2101 | cgi_printf("<thead><tr>" |
| 2101 | - "<th>Week #</th>" | |
| 2102 | + "<th>Week</th>" | |
| 2102 | 2103 | "<th>Events</th>" |
| 2103 | 2104 | "<th><!-- relative commits graph --></th>" |
| 2104 | 2105 | "</tr></thead>" |
| 2105 | 2106 | "<tbody>"); |
| 2106 | 2107 | db_prepare(&stWeek, |
| @@ -2126,13 +2127,13 @@ | ||
| 2126 | 2127 | graphSize); |
| 2127 | 2128 | } |
| 2128 | 2129 | cgi_printf("</td></tr>"); |
| 2129 | 2130 | } |
| 2130 | 2131 | db_finalize(&stWeek); |
| 2132 | + free(zDefaultYear); | |
| 2131 | 2133 | cgi_printf("</tbody></table>"); |
| 2132 | 2134 | output_table_sorting_javascript("statsTable","tnx"); |
| 2133 | - free(zDefaultYear); | |
| 2134 | 2135 | } |
| 2135 | 2136 | } |
| 2136 | 2137 | |
| 2137 | 2138 | /* |
| 2138 | 2139 | ** WEBPAGE: stats_report |
| @@ -2159,13 +2160,13 @@ | ||
| 2159 | 2160 | timeline_submenu(&url, "By Week", "view", "byweek", 0); |
| 2160 | 2161 | timeline_submenu(&url, "By User", "view", "byuser", "user"); |
| 2161 | 2162 | url_reset(&url); |
| 2162 | 2163 | style_header("Activity Reports"); |
| 2163 | 2164 | if(0==fossil_strcmp(zView,"byyear")){ |
| 2164 | - stats_report_by_month_year(0, zUserName); | |
| 2165 | + stats_report_by_month_year(0, 0, zUserName); | |
| 2165 | 2166 | }else if(0==fossil_strcmp(zView,"bymonth")){ |
| 2166 | - stats_report_by_month_year(1, zUserName); | |
| 2167 | + stats_report_by_month_year(1, 0, zUserName); | |
| 2167 | 2168 | }else if(0==fossil_strcmp(zView,"byweek")){ |
| 2168 | 2169 | stats_report_year_weeks(); |
| 2169 | 2170 | }else if(0==fossil_strcmp(zView,"byuser")){ |
| 2170 | 2171 | stats_report_by_user(); |
| 2171 | 2172 | }else{ |
| 2172 | 2173 |
| --- 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 |