Fossil SCM
Further improvements to the yw= banner. More flexible handling of ymd=.
Commit
adbebbd1e815944c9df40bff4535792e8d306fabdd0bf0e8f3f69fa5c345867b
Parent
7b1599884cba7e0…
1 file changed
+13
-6
+13
-6
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1734,11 +1734,11 @@ | ||
| 1734 | 1734 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1735 | 1735 | } |
| 1736 | 1736 | }else{ |
| 1737 | 1737 | /* Otherwise, a timeline based on a span of time */ |
| 1738 | 1738 | int n; |
| 1739 | - const char *zEType = "timeline item"; | |
| 1739 | + const char *zEType = "event"; | |
| 1740 | 1740 | char *zDate; |
| 1741 | 1741 | Blob cond; |
| 1742 | 1742 | blob_zero(&cond); |
| 1743 | 1743 | if( zChng && *zChng ){ |
| 1744 | 1744 | addFileGlobExclusion(zChng, &cond); |
| @@ -1779,11 +1779,15 @@ | ||
| 1779 | 1779 | } |
| 1780 | 1780 | blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1781 | 1781 | zYearWeek); |
| 1782 | 1782 | } |
| 1783 | 1783 | else if( zDay ){ |
| 1784 | - blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%m-%%d',event.mtime) ", | |
| 1784 | + zDay = db_text(0, "SELECT date(%Q)", zDay); | |
| 1785 | + if( zDay==0 || zDay[0]==0 ){ | |
| 1786 | + zDay = db_text(0, "SELECT date('now')"); | |
| 1787 | + } | |
| 1788 | + blob_append_sql(&cond, " AND %Q=date(event.mtime) ", | |
| 1785 | 1789 | zDay); |
| 1786 | 1790 | } |
| 1787 | 1791 | if( zTagSql ){ |
| 1788 | 1792 | blob_append_sql(&cond, |
| 1789 | 1793 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| @@ -1854,11 +1858,11 @@ | ||
| 1854 | 1858 | }else{ /* zType!="all" */ |
| 1855 | 1859 | blob_append_sql(&cond, " AND event.type=%Q", zType); |
| 1856 | 1860 | if( zType[0]=='c' ){ |
| 1857 | 1861 | zEType = "check-in"; |
| 1858 | 1862 | }else if( zType[0]=='w' ){ |
| 1859 | - zEType = "wiki edit"; | |
| 1863 | + zEType = "wiki"; | |
| 1860 | 1864 | }else if( zType[0]=='t' ){ |
| 1861 | 1865 | zEType = "ticket change"; |
| 1862 | 1866 | }else if( zType[0]=='e' ){ |
| 1863 | 1867 | zEType = "technical note"; |
| 1864 | 1868 | }else if( zType[0]=='g' ){ |
| @@ -1929,16 +1933,16 @@ | ||
| 1929 | 1933 | if( nEntry>0 ) blob_append_sql(&sql, " LIMIT %d", nEntry); |
| 1930 | 1934 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1931 | 1935 | |
| 1932 | 1936 | n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/"); |
| 1933 | 1937 | if( zYearMonth ){ |
| 1934 | - blob_appendf(&desc, "%s events for %h", zEType, zYearMonth); | |
| 1938 | + blob_appendf(&desc, "%ss for %h", zEType, zYearMonth); | |
| 1935 | 1939 | }else if( zYearWeek ){ |
| 1936 | - blob_appendf(&desc, "%s events for week %h (the week starting %h)", | |
| 1940 | + blob_appendf(&desc, "%ss for week %h beginning on %h", | |
| 1937 | 1941 | zEType, zYearWeek, zYearWeekStart); |
| 1938 | 1942 | }else if( zDay ){ |
| 1939 | - blob_appendf(&desc, "%s events occurring on %h", zEType, zDay); | |
| 1943 | + blob_appendf(&desc, "%ss occurring on %h", zEType, zDay); | |
| 1940 | 1944 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1941 | 1945 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1942 | 1946 | }else{ |
| 1943 | 1947 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1944 | 1948 | } |
| @@ -2062,10 +2066,13 @@ | ||
| 2062 | 2066 | double r = symbolic_name_to_mtime(zMark); |
| 2063 | 2067 | if( r>0.0 ) selectedRid = timeline_add_divider(r); |
| 2064 | 2068 | } |
| 2065 | 2069 | blob_zero(&sql); |
| 2066 | 2070 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 2071 | + if( fossil_islower(desc.aData[0]) ){ | |
| 2072 | + desc.aData[0] = fossil_toupper(desc.aData[0]); | |
| 2073 | + } | |
| 2067 | 2074 | @ <h2>%b(&desc)</h2> |
| 2068 | 2075 | blob_reset(&desc); |
| 2069 | 2076 | |
| 2070 | 2077 | /* Report any errors. */ |
| 2071 | 2078 | if( zError ){ |
| 2072 | 2079 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1734,11 +1734,11 @@ | |
| 1734 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1735 | } |
| 1736 | }else{ |
| 1737 | /* Otherwise, a timeline based on a span of time */ |
| 1738 | int n; |
| 1739 | const char *zEType = "timeline item"; |
| 1740 | char *zDate; |
| 1741 | Blob cond; |
| 1742 | blob_zero(&cond); |
| 1743 | if( zChng && *zChng ){ |
| 1744 | addFileGlobExclusion(zChng, &cond); |
| @@ -1779,11 +1779,15 @@ | |
| 1779 | } |
| 1780 | blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1781 | zYearWeek); |
| 1782 | } |
| 1783 | else if( zDay ){ |
| 1784 | blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%m-%%d',event.mtime) ", |
| 1785 | zDay); |
| 1786 | } |
| 1787 | if( zTagSql ){ |
| 1788 | blob_append_sql(&cond, |
| 1789 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| @@ -1854,11 +1858,11 @@ | |
| 1854 | }else{ /* zType!="all" */ |
| 1855 | blob_append_sql(&cond, " AND event.type=%Q", zType); |
| 1856 | if( zType[0]=='c' ){ |
| 1857 | zEType = "check-in"; |
| 1858 | }else if( zType[0]=='w' ){ |
| 1859 | zEType = "wiki edit"; |
| 1860 | }else if( zType[0]=='t' ){ |
| 1861 | zEType = "ticket change"; |
| 1862 | }else if( zType[0]=='e' ){ |
| 1863 | zEType = "technical note"; |
| 1864 | }else if( zType[0]=='g' ){ |
| @@ -1929,16 +1933,16 @@ | |
| 1929 | if( nEntry>0 ) blob_append_sql(&sql, " LIMIT %d", nEntry); |
| 1930 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1931 | |
| 1932 | n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/"); |
| 1933 | if( zYearMonth ){ |
| 1934 | blob_appendf(&desc, "%s events for %h", zEType, zYearMonth); |
| 1935 | }else if( zYearWeek ){ |
| 1936 | blob_appendf(&desc, "%s events for week %h (the week starting %h)", |
| 1937 | zEType, zYearWeek, zYearWeekStart); |
| 1938 | }else if( zDay ){ |
| 1939 | blob_appendf(&desc, "%s events occurring on %h", zEType, zDay); |
| 1940 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1941 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1942 | }else{ |
| 1943 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1944 | } |
| @@ -2062,10 +2066,13 @@ | |
| 2062 | double r = symbolic_name_to_mtime(zMark); |
| 2063 | if( r>0.0 ) selectedRid = timeline_add_divider(r); |
| 2064 | } |
| 2065 | blob_zero(&sql); |
| 2066 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 2067 | @ <h2>%b(&desc)</h2> |
| 2068 | blob_reset(&desc); |
| 2069 | |
| 2070 | /* Report any errors. */ |
| 2071 | if( zError ){ |
| 2072 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -1734,11 +1734,11 @@ | |
| 1734 | style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0); |
| 1735 | } |
| 1736 | }else{ |
| 1737 | /* Otherwise, a timeline based on a span of time */ |
| 1738 | int n; |
| 1739 | const char *zEType = "event"; |
| 1740 | char *zDate; |
| 1741 | Blob cond; |
| 1742 | blob_zero(&cond); |
| 1743 | if( zChng && *zChng ){ |
| 1744 | addFileGlobExclusion(zChng, &cond); |
| @@ -1779,11 +1779,15 @@ | |
| 1779 | } |
| 1780 | blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%W',event.mtime) ", |
| 1781 | zYearWeek); |
| 1782 | } |
| 1783 | else if( zDay ){ |
| 1784 | zDay = db_text(0, "SELECT date(%Q)", zDay); |
| 1785 | if( zDay==0 || zDay[0]==0 ){ |
| 1786 | zDay = db_text(0, "SELECT date('now')"); |
| 1787 | } |
| 1788 | blob_append_sql(&cond, " AND %Q=date(event.mtime) ", |
| 1789 | zDay); |
| 1790 | } |
| 1791 | if( zTagSql ){ |
| 1792 | blob_append_sql(&cond, |
| 1793 | " AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag" |
| @@ -1854,11 +1858,11 @@ | |
| 1858 | }else{ /* zType!="all" */ |
| 1859 | blob_append_sql(&cond, " AND event.type=%Q", zType); |
| 1860 | if( zType[0]=='c' ){ |
| 1861 | zEType = "check-in"; |
| 1862 | }else if( zType[0]=='w' ){ |
| 1863 | zEType = "wiki"; |
| 1864 | }else if( zType[0]=='t' ){ |
| 1865 | zEType = "ticket change"; |
| 1866 | }else if( zType[0]=='e' ){ |
| 1867 | zEType = "technical note"; |
| 1868 | }else if( zType[0]=='g' ){ |
| @@ -1929,16 +1933,16 @@ | |
| 1933 | if( nEntry>0 ) blob_append_sql(&sql, " LIMIT %d", nEntry); |
| 1934 | db_multi_exec("%s", blob_sql_text(&sql)); |
| 1935 | |
| 1936 | n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/"); |
| 1937 | if( zYearMonth ){ |
| 1938 | blob_appendf(&desc, "%ss for %h", zEType, zYearMonth); |
| 1939 | }else if( zYearWeek ){ |
| 1940 | blob_appendf(&desc, "%ss for week %h beginning on %h", |
| 1941 | zEType, zYearWeek, zYearWeekStart); |
| 1942 | }else if( zDay ){ |
| 1943 | blob_appendf(&desc, "%ss occurring on %h", zEType, zDay); |
| 1944 | }else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){ |
| 1945 | blob_appendf(&desc, "%d most recent %ss", n, zEType); |
| 1946 | }else{ |
| 1947 | blob_appendf(&desc, "%d %ss", n, zEType); |
| 1948 | } |
| @@ -2062,10 +2066,13 @@ | |
| 2066 | double r = symbolic_name_to_mtime(zMark); |
| 2067 | if( r>0.0 ) selectedRid = timeline_add_divider(r); |
| 2068 | } |
| 2069 | blob_zero(&sql); |
| 2070 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 2071 | if( fossil_islower(desc.aData[0]) ){ |
| 2072 | desc.aData[0] = fossil_toupper(desc.aData[0]); |
| 2073 | } |
| 2074 | @ <h2>%b(&desc)</h2> |
| 2075 | blob_reset(&desc); |
| 2076 | |
| 2077 | /* Report any errors. */ |
| 2078 | if( zError ){ |
| 2079 |