Fossil SCM

Further improvements to the yw= banner. More flexible handling of ymd=.

drh 2018-04-26 19:39 trunk
Commit adbebbd1e815944c9df40bff4535792e8d306fabdd0bf0e8f3f69fa5c345867b
1 file changed +13 -6
+13 -6
--- src/timeline.c
+++ src/timeline.c
@@ -1734,11 +1734,11 @@
17341734
style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
17351735
}
17361736
}else{
17371737
/* Otherwise, a timeline based on a span of time */
17381738
int n;
1739
- const char *zEType = "timeline item";
1739
+ const char *zEType = "event";
17401740
char *zDate;
17411741
Blob cond;
17421742
blob_zero(&cond);
17431743
if( zChng && *zChng ){
17441744
addFileGlobExclusion(zChng, &cond);
@@ -1779,11 +1779,15 @@
17791779
}
17801780
blob_append_sql(&cond, " AND %Q=strftime('%%Y-%%W',event.mtime) ",
17811781
zYearWeek);
17821782
}
17831783
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) ",
17851789
zDay);
17861790
}
17871791
if( zTagSql ){
17881792
blob_append_sql(&cond,
17891793
" AND (EXISTS(SELECT 1 FROM tagxref NATURAL JOIN tag"
@@ -1854,11 +1858,11 @@
18541858
}else{ /* zType!="all" */
18551859
blob_append_sql(&cond, " AND event.type=%Q", zType);
18561860
if( zType[0]=='c' ){
18571861
zEType = "check-in";
18581862
}else if( zType[0]=='w' ){
1859
- zEType = "wiki edit";
1863
+ zEType = "wiki";
18601864
}else if( zType[0]=='t' ){
18611865
zEType = "ticket change";
18621866
}else if( zType[0]=='e' ){
18631867
zEType = "technical note";
18641868
}else if( zType[0]=='g' ){
@@ -1929,16 +1933,16 @@
19291933
if( nEntry>0 ) blob_append_sql(&sql, " LIMIT %d", nEntry);
19301934
db_multi_exec("%s", blob_sql_text(&sql));
19311935
19321936
n = db_int(0, "SELECT count(*) FROM timeline WHERE etype!='div' /*scan*/");
19331937
if( zYearMonth ){
1934
- blob_appendf(&desc, "%s events for %h", zEType, zYearMonth);
1938
+ blob_appendf(&desc, "%ss for %h", zEType, zYearMonth);
19351939
}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",
19371941
zEType, zYearWeek, zYearWeekStart);
19381942
}else if( zDay ){
1939
- blob_appendf(&desc, "%s events occurring on %h", zEType, zDay);
1943
+ blob_appendf(&desc, "%ss occurring on %h", zEType, zDay);
19401944
}else if( zBefore==0 && zCirca==0 && n>=nEntry && nEntry>0 ){
19411945
blob_appendf(&desc, "%d most recent %ss", n, zEType);
19421946
}else{
19431947
blob_appendf(&desc, "%d %ss", n, zEType);
19441948
}
@@ -2062,10 +2066,13 @@
20622066
double r = symbolic_name_to_mtime(zMark);
20632067
if( r>0.0 ) selectedRid = timeline_add_divider(r);
20642068
}
20652069
blob_zero(&sql);
20662070
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
+ }
20672074
@ <h2>%b(&desc)</h2>
20682075
blob_reset(&desc);
20692076
20702077
/* Report any errors. */
20712078
if( zError ){
20722079
--- 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

Keyboard Shortcuts

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