Fossil

Check-in [4290984d]
Login

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

Overview
Comment:Reorganize the elements of the "Overview" section of a check-in view, to give more prominence to the "Download" links.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:4290984dd36877e4544ee997b1f75ac81ed67f2d3d259cd0d1444bf4ade501f5
User & Date: drh 2017-12-06 16:50:54
Context
2017-12-06
17:14
Fix harmless typo in comment. check-in: bf82c41d user: drh tags: trunk
16:50
Reorganize the elements of the "Overview" section of a check-in view, to give more prominence to the "Download" links. check-in: 4290984d user: drh tags: trunk
15:37
Use an HTML5 color chooser dialog in the check-in comment editor. check-in: f8bc3ce8 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/browse.c.

  1075   1075         }else{
  1076   1076           @ %z(href("%R/artifact/%!S",zFUuid))%h(zFile)</a><br />
  1077   1077         }
  1078   1078       }
  1079   1079       db_reset(&q2);
  1080   1080       @ </td>
  1081   1081       @ <td>
  1082         -    @ %z(href("%R/info/%!S",zUuid))[%S(zUuid)]</a>
         1082  +    @ %W(zComment)
         1083  +    @ (check-in:&nbsp;%z(href("%R/ci/%!S",zUuid))%S(zUuid)</a>,
  1083   1084       if( showId ){
  1084         -      @ (%d(mid))
         1085  +      @ id: %d(mid)
  1085   1086       }
  1086         -    @ %W(zComment) (user:
  1087         -    @ %z(href("%R/timeline?u=%t&c=%!S&nd&n=200",zUser,zUuid))%h(zUser)</a>,
  1088         -    @ branch:
  1089         -    @ %z(href("%R/timeline?r=%t&c=%!S&nd&n=200",zBranch,zUuid))%h(zBranch)</a>)
         1087  +    @ user:&nbsp;%z(href("%R/timeline?u=%t&c=%!S&nd",zUser,zUuid))%h(zUser)</a>,
         1088  +    @ branch:&nbsp;\
         1089  +    @ %z(href("%R/timeline?r=%t&c=%!S&nd",zBranch,zUuid))%h(zBranch)</a>)
  1090   1090       @ </td></tr>
  1091   1091       @
  1092   1092       fossil_free(zAge);
  1093   1093     }
  1094   1094     @ </table></div>
  1095   1095     db_finalize(&q1);
  1096   1096     db_finalize(&q2);
  1097   1097     style_footer();
  1098   1098   }

Changes to src/info.c.

   620    620     cookie_link_parameter("diff","diff","2");
   621    621     diffType = atoi(PD("diff","2"));
   622    622     if( db_step(&q1)==SQLITE_ROW ){
   623    623       const char *zUuid = db_column_text(&q1, 0);
   624    624       int nUuid = db_column_bytes(&q1, 0);
   625    625       char *zEUser, *zEComment;
   626    626       const char *zUser;
          627  +    const char *zOrigUser;
   627    628       const char *zComment;
   628    629       const char *zDate;
   629    630       const char *zOrigDate;
   630    631   
   631    632       style_header("Check-in [%S]", zUuid);
   632    633       login_anonymous_available();
   633    634       zEUser = db_text(0,
   634    635                      "SELECT value FROM tagxref"
   635    636                      " WHERE tagid=%d AND rid=%d AND tagtype>0",
   636    637                       TAG_USER, rid);
   637    638       zEComment = db_text(0,
   638    639                      "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
   639    640                      TAG_COMMENT, rid);
   640         -    zUser = db_column_text(&q1, 2);
          641  +    zOrigUser = db_column_text(&q1, 2);
          642  +    zUser = zEUser ? zEUser : zOrigUser;
   641    643       zComment = db_column_text(&q1, 3);
   642    644       zDate = db_column_text(&q1,1);
   643    645       zOrigDate = db_column_text(&q1, 4);
          646  +    if( zOrigDate==0 ) zOrigDate = zDate;
   644    647       @ <div class="section">Overview</div>
   645    648       @ <table class="label-value">
          649  +    @ <tr><th>Comment:</th><td class="infoComment">%!W(zComment)</td></tr>
          650  +
          651  +    /* The Download: line */
          652  +    if( g.perm.Zip  ){
          653  +      char *zPJ = db_get("short-project-name", 0);
          654  +      char *zUrl;
          655  +      Blob projName;
          656  +      int jj;
          657  +      if( zPJ==0 ) zPJ = db_get("project-name", "unnamed");
          658  +      blob_zero(&projName);
          659  +      blob_append(&projName, zPJ, -1);
          660  +      blob_trim(&projName);
          661  +      zPJ = blob_str(&projName);
          662  +      for(jj=0; zPJ[jj]; jj++){
          663  +        if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
          664  +          zPJ[jj] = '_';
          665  +        }
          666  +      }
          667  +      zUrl = mprintf("%R/tarball/%t-%S.tar.gz?name=%s", zPJ, zUuid, zUuid);
          668  +      @ <tr><th>Downloads:</th><td>
          669  +      @ %z(href("%s",zUrl))Tarball</a>
          670  +      @ | %z(href("%R/zip/%t-%S.zip?name=%!S",zPJ,zUuid,zUuid))ZIP archive</a>
          671  +      @ | %z(href("%R/sqlar/%t-%S.sqlar?name=%!S",zPJ,zUuid,zUuid))\
          672  +      @ SQL archive</a></td></tr>
          673  +      fossil_free(zUrl);
          674  +      blob_reset(&projName);
          675  +    }
          676  +
          677  +    @ <tr><th>Timelines:</th><td>
          678  +    @   %z(href("%R/timeline?f=%!S&unhide",zUuid))family</a>
          679  +    if( zParent ){
          680  +      @ | %z(href("%R/timeline?p=%!S&unhide",zUuid))ancestors</a>
          681  +    }
          682  +    if( !isLeaf ){
          683  +      @ | %z(href("%R/timeline?d=%!S&unhide",zUuid))descendants</a>
          684  +    }
          685  +    if( zParent && !isLeaf ){
          686  +      @ | %z(href("%R/timeline?dp=%!S&unhide",zUuid))both</a>
          687  +    }
          688  +    db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
          689  +                   " WHERE rid=%d AND tagtype>0 "
          690  +                   "   AND tag.tagid=tagxref.tagid "
          691  +                   "   AND +tag.tagname GLOB 'sym-*'", rid);
          692  +    while( db_step(&q2)==SQLITE_ROW ){
          693  +      const char *zTagName = db_column_text(&q2, 0);
          694  +      @  | %z(href("%R/timeline?r=%T&unhide",zTagName))%h(zTagName)</a>
          695  +    }
          696  +    db_finalize(&q2);
          697  +    @ </td></tr>
          698  +
          699  +    @ <tr><th>Files:</th>
          700  +    @   <td>
          701  +    @     %z(href("%R/tree?ci=%!S",zUuid))files</a>
          702  +    @   | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
          703  +    @   | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
          704  +    @   </td>
          705  +    @ </tr>
          706  +
   646    707       @ <tr><th>%s(hname_alg(nUuid)):</th><td>%s(zUuid)
   647    708       if( g.perm.Setup ){
   648    709         @ (Record ID: %d(rid))
   649    710       }
   650    711       @ </td></tr>
   651         -    @ <tr><th>Date:</th><td>
          712  +    @ <tr><th>User&nbsp;&amp;&nbsp;Date:</th><td>
          713  +    hyperlink_to_user(zUser,zDate," on ");
   652    714       hyperlink_to_date(zDate, "</td></tr>");
   653         -    if( zOrigDate && fossil_strcmp(zDate, zOrigDate)!=0 ){
   654         -      @ <tr><th>Original&nbsp;Date:</th><td>
   655         -      hyperlink_to_date(zOrigDate, "</td></tr>");
   656         -    }
   657         -    if( zEUser ){
   658         -      @ <tr><th>Edited&nbsp;User:</th><td>
   659         -      hyperlink_to_user(zEUser,zDate,"</td></tr>");
   660         -      @ <tr><th>Original&nbsp;User:</th><td>
   661         -      hyperlink_to_user(zUser,zDate,"</td></tr>");
   662         -    }else{
   663         -      @ <tr><th>User:</th><td>
   664         -      hyperlink_to_user(zUser,zDate,"</td></tr>");
   665         -    }
   666    715       if( zEComment ){
   667         -      @ <tr><th>Edited&nbsp;Comment:</th>
   668         -      @     <td class="infoComment">%!W(zEComment)</td></tr>
   669    716         @ <tr><th>Original&nbsp;Comment:</th>
   670    717         @     <td class="infoComment">%!W(zComment)</td></tr>
   671         -    }else{
   672         -      @ <tr><th>Comment:</th><td class="infoComment">%!W(zComment)</td></tr>
          718  +    }
          719  +    if( fossil_strcmp(zDate, zOrigDate)!=0
          720  +     || fossil_strcmp(zOrigUser, zUser)!=0
          721  +    ){
          722  +      @ <tr><th>Original&nbsp;User&nbsp;&amp;&nbsp;Date:</th><td>
          723  +      hyperlink_to_user(zOrigUser,zOrigDate," on ");
          724  +      hyperlink_to_date(zOrigDate, "</td></tr>");
   673    725       }
   674    726       if( g.perm.Admin ){
   675    727         db_prepare(&q2,
   676    728            "SELECT rcvfrom.ipaddr, user.login, datetime(rcvfrom.mtime)"
   677    729            "  FROM blob JOIN rcvfrom USING(rcvid) LEFT JOIN user USING(uid)"
   678    730            " WHERE blob.rid=%d",
   679    731            rid
................................................................................
   685    737           if( zUser==0 || zUser[0]==0 ) zUser = "unknown";
   686    738           @ <tr><th>Received&nbsp;From:</th>
   687    739           @ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
   688    740         }
   689    741         db_finalize(&q2);
   690    742       }
   691    743       if( g.perm.Hyperlink ){
   692         -      char *zPJ = db_get("short-project-name", 0);
   693         -      Blob projName;
   694         -      int jj;
   695         -      if( zPJ==0 ) zPJ = db_get("project-name", "unnamed");
   696         -      blob_zero(&projName);
   697         -      blob_append(&projName, zPJ, -1);
   698         -      blob_trim(&projName);
   699         -      zPJ = blob_str(&projName);
   700         -      for(jj=0; zPJ[jj]; jj++){
   701         -        if( (zPJ[jj]>0 && zPJ[jj]<' ') || strchr("\"*/:<>?\\|", zPJ[jj]) ){
   702         -          zPJ[jj] = '_';
   703         -        }
   704         -      }
   705         -      @ <tr><th>Timelines:</th><td>
   706         -      @   %z(href("%R/timeline?f=%!S&unhide",zUuid))family</a>
   707         -      if( zParent ){
   708         -        @ | %z(href("%R/timeline?p=%!S&unhide",zUuid))ancestors</a>
   709         -      }
   710         -      if( !isLeaf ){
   711         -        @ | %z(href("%R/timeline?d=%!S&unhide",zUuid))descendants</a>
   712         -      }
   713         -      if( zParent && !isLeaf ){
   714         -        @ | %z(href("%R/timeline?dp=%!S&unhide",zUuid))both</a>
   715         -      }
   716         -      db_prepare(&q2,"SELECT substr(tag.tagname,5) FROM tagxref, tag "
   717         -                     " WHERE rid=%d AND tagtype>0 "
   718         -                     "   AND tag.tagid=tagxref.tagid "
   719         -                     "   AND +tag.tagname GLOB 'sym-*'", rid);
   720         -      while( db_step(&q2)==SQLITE_ROW ){
   721         -        const char *zTagName = db_column_text(&q2, 0);
   722         -        @  | %z(href("%R/timeline?r=%T&unhide",zTagName))%h(zTagName)</a>
   723         -      }
   724         -      db_finalize(&q2);
   725         -
   726         -
   727         -      /* The Download: line */
   728         -      if( g.anon.Zip ){
   729         -        char *zUrl = mprintf("%R/tarball/%t-%S.tar.gz?uuid=%s",
   730         -                             zPJ, zUuid, zUuid);
   731         -        @ </td></tr>
   732         -        @ <tr><th>Downloads:</th><td>
   733         -        @ %z(href("%s",zUrl))Tarball</a>
   734         -        @ | %z(href("%R/zip/%t-%S.zip?uuid=%!S",zPJ,zUuid,zUuid))ZIP archive</a>
   735         -        @ | %z(href("%R/sqlar/%t-%S.sqlar?uuid=%!S",zPJ,zUuid,zUuid))\
   736         -        @ SQL archive</a>
   737         -        fossil_free(zUrl);
   738         -      }
   739         -      @ </td></tr>
   740    744         @ <tr><th>Other&nbsp;Links:</th>
   741    745         @   <td>
   742         -      @     %z(href("%R/tree?ci=%!S",zUuid))files</a>
   743         -      @   | %z(href("%R/fileage?name=%!S",zUuid))file ages</a>
   744         -      @   | %z(href("%R/tree?nofiles&type=tree&ci=%!S",zUuid))folders</a>
   745         -      @   | %z(href("%R/artifact/%!S",zUuid))manifest</a>
          746  +      @   %z(href("%R/artifact/%!S",zUuid))manifest</a>
   746    747         if( g.perm.Admin ){
   747    748           @   | %z(href("%R/mlink?ci=%!S",zUuid))mlink table</a>
   748    749         }
   749    750         if( g.anon.Write ){
   750    751           @   | %z(href("%R/ci_edit?r=%!S",zUuid))edit</a>
   751    752         }
   752    753         @   </td>
   753    754         @ </tr>
   754         -      blob_reset(&projName);
   755    755       }
   756    756       @ </table>
   757    757     }else{
   758    758       style_header("Check-in Information");
   759    759       login_anonymous_available();
   760    760     }
   761    761     db_finalize(&q1);
................................................................................
  2206   2206     }
  2207   2207     @ <tr><th>Ticket:</th>
  2208   2208     @ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a>
  2209   2209     if( zTktTitle ){
  2210   2210           @<br />%h(zTktTitle)
  2211   2211     }
  2212   2212     @</td></tr>
  2213         -  @ <tr><th>Date:</th><td>
         2213  +  @ <tr><th>User&nbsp;&amp;&nbsp;Date:</th><td>
         2214  +  hyperlink_to_user(pTktChng->zUser, zDate, " on ");
  2214   2215     hyperlink_to_date(zDate, "</td></tr>");
  2215         -  @ <tr><th>User:</th><td>
  2216         -  hyperlink_to_user(pTktChng->zUser, zDate, "</td></tr>");
  2217   2216     @ </table>
  2218   2217     free(zDate);
  2219   2218     free(zTktTitle);
  2220   2219   
  2221   2220     if( g.perm.ModTkt && modPending ){
  2222   2221       @ <div class="section">Moderation</div>
  2223   2222       @ <blockquote>