Fossil

Check-in [adbebbd1]
Login

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

Overview
Comment:Further improvements to the yw= banner. More flexible handling of ymd=.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: adbebbd1e815944c9df40bff4535792e8d306fabdd0bf0e8f3f69fa5c345867b
User & Date: drh 2018-04-26 19:39:06
Context
2018-04-26
19:53
Add the days= query parameter to /timeline check-in: cd11e359 user: drh tags: trunk
19:39
Further improvements to the yw= banner. More flexible handling of ymd=. check-in: adbebbd1 user: drh tags: trunk
19:23
Merge in the latest 3.24.0 alpha version of SQLite including the ORDER BY LIMIT performance enhancement. check-in: 7b159988 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/timeline.c.

  1732   1732       if( advancedMenu ){
  1733   1733         style_submenu_checkbox("unhide", "Unhide", 0, 0);
  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);
  1745   1745         tmFlags |= TIMELINE_DISJOINT;
  1746   1746       }
................................................................................
  1777   1777                "SELECT strftime('%%Y-%%W','now','-6 days','weekday 1')");
  1778   1778           }
  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"
  1790   1794           " WHERE %s AND tagtype>0 AND rid=blob.rid)\n", zTagSql/*safe-for-%s*/);
  1791   1795   
................................................................................
  1852   1856           blob_append_sql(&cond, ")");
  1853   1857         }
  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' ){
  1865   1869           zEType = "tag";
  1866   1870         }
................................................................................
  1927   1931         blob_append_sql(&sql, " ORDER BY event.mtime DESC");
  1928   1932       }
  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       }
  1945   1949       if( zUses ){
  1946   1950         char *zFilenames = names_of_file(zUses);
................................................................................
  2060   2064     if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
  2061   2065     if( useDividers && zMark && zMark[0] ){
  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       @ <p class="generalError">%h(zError)</p>
  2073   2080     }