Changes On Branch wolfgangFormat2CSS
Not logged in

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

Changes In Branch wolfgangFormat2CSS Excluding Merge-Ins

This is equivalent to a diff from 08aa440a3d to 7d2fe13c82

2010-09-13
23:40
Merge the CSS and XHTML fixes from the wolfgangFormat2CSS branch into the trunk. check-in: 3243e63bba user: drh tags: trunk
23:37
Fix some rendering issues with the new wiki formatter.    Closed-Leaf check-in: 7d2fe13c82 user: drh tags: wolfgangFormat2CSS
22:15
Fix a compiler warning of an unused variable. check-in: d35608836e user: drh tags: wolfgangFormat2CSS
2010-09-12
15:39
merged win dmc make build changes from [08aa440a3d],.. check-in: 642f4dcfa2 user: wolfgang tags: wolfgangFormat2CSS
15:23
(more type's) solves ticket [5e9f1b1cd8] check-in: 08aa440a3d user: renez tags: trunk
15:18
(delete 1 character{*} to much in dmc) solves ticket [5e9f1b1cd8] check-in: 2862ed5979 user: renez tags: trunk

Changes to src/attach.c.

    73     73       for(i=0; zFilename[i]; i++){
    74     74         if( zFilename[i]=='/' && zFilename[i+1]!=0 ){ 
    75     75           zFilename = &zFilename[i+1];
    76     76           i = -1;
    77     77         }
    78     78       }
    79     79       if( strlen(zTarget)==UUID_SIZE && validate16(zTarget,UUID_SIZE) ){
    80         -      zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename);
           80  +      zUrlTail = mprintf("tkt=%s&file=%t", zTarget, zFilename);
    81     81       }else{
    82         -      zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
           82  +      zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
    83     83       }
    84     84       @
    85     85       @ <p><a href="/attachview?%s(zUrlTail)">%h(zFilename)</a>
    86         -    @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br>
           86  +    @ [<a href="/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br />
    87     87       if( zComment ) while( isspace(zComment[0]) ) zComment++;
    88     88       if( zComment && zComment[0] ){
    89         -      @ %w(zComment)<br>
           89  +      @ %w(zComment)<br />
    90     90       }
    91     91       if( zPage==0 && zTkt==0 ){
    92     92         if( zSrc==0 || zSrc[0]==0 ){
    93     93           zSrc = "Deleted from";
    94     94         }else {
    95     95           zSrc = "Added to";
    96     96         }
................................................................................
   271    271       cgi_redirect(zFrom);
   272    272     }
   273    273     style_header("Add Attachment");
   274    274     @ <h2>Add Attachment To %s(zTargetType)</h2>
   275    275     @ <form action="%s(g.zBaseURL)/attachadd" method="POST"
   276    276     @  enctype="multipart/form-data">
   277    277     @ File to Attach:
   278         -  @ <input type="file" name="f" size="60"><br>
   279         -  @ Description:<br>
   280         -  @ <textarea name="comment" cols=80 rows=5 wrap="virtual"></textarea><br>
          278  +  @ <input type="file" name="f" size="60"><br />
          279  +  @ Description:<br />
          280  +  @ <textarea name="comment" cols=80 rows=5 wrap="virtual"></textarea><br />
   281    281     if( zTkt ){
   282    282       @ <input type="hidden" name="tkt" value="%h(zTkt)">
   283    283     }else{
   284    284       @ <input type="hidden" name="page" value="%h(zPage)">
   285    285     }
   286    286     @ <input type="hidden" name="from" value="%h(zFrom)">
   287    287     @ <input type="submit" name="ok" value="Add Attachment">
................................................................................
   349    349       manifest_crosslink(rid, &manifest);
   350    350       db_end_transaction(0);
   351    351       cgi_redirect(zFrom);
   352    352     }    
   353    353     style_header("Delete Attachment");
   354    354     @ <form action="%s(g.zBaseURL)/attachdelete" method="POST">
   355    355     @ <p>Confirm that you want to delete the attachment named
   356         -  @ "%h(zFile)" on %s(zTkt?"ticket":"wiki page") %h(zTarget):<br>
          356  +  @ "%h(zFile)" on %s(zTkt?"ticket":"wiki page") %h(zTarget):<br />
   357    357     if( zTkt ){
   358    358       @ <input type="hidden" name="tkt" value="%h(zTkt)">
   359    359     }else{
   360    360       @ <input type="hidden" name="page" value="%h(zPage)">
   361    361     }
   362    362     @ <input type="hidden" name="file" value="%h(zFile)">
   363    363     @ <input type="hidden" name="from" value="%h(zFrom)">
   364    364     @ <input type="submit" name="confirm" value="Delete">
   365    365     @ <input type="submit" name="cancel" value="Cancel">
   366    366     @ </form>
   367    367     style_footer();
   368    368   
   369    369   }

Changes to src/branch.c.

   229    229     }else{
   230    230       style_submenu_element("Closed","Closed","brlist?closed");
   231    231     }
   232    232     login_anonymous_available();
   233    233     compute_leaves(0, 1);
   234    234     style_sidebox_begin("Nomenclature:", "33%");
   235    235     @ <ol>
   236         -  @ <li> An <a href="brlist">open branch</a> is a branch that has one or
          236  +  @ <li> An <div class="sideboxDescribed"><a href="brlist">
          237  +  @ open branch</a></div> is a branch that has one or
   237    238     @ more <a href="leaves">open leaves.</a>
   238    239     @ The presence of open leaves presumably means
   239    240     @ that the branch is still being extended with new check-ins.</li>
   240         -  @ <li> A <a href="brlist?closed">closed branch</a> is a branch with only
   241         -  @ <a href="leaves?closed">closed leaves</a>.
          241  +  @ <li> A <div class="sideboxDescribed"><a href="brlist?closed">
          242  +  @ closed branch</a></div> is a branch with only
          243  +  @ <div class="sideboxDescribed"><a href="leaves?closed">
          244  +  @ closed leaves</a></div>.
   242    245     @ Closed branches are fixed and do not change (unless they are first
   243    246     @ reopened)</li>
   244    247     @ </ol>
   245    248     style_sidebox_end();
   246    249   
   247    250     cnt = 0;
   248    251     if( !showClosed ){
................................................................................
   282    285         @ <li><b>%h(zBr)</b></li>
   283    286       }
   284    287     }
   285    288     if( cnt ){
   286    289       @ </ul>
   287    290     }
   288    291     db_finalize(&q);
   289         -  @ </ul>
   290         -  @ <br clear="both">
   291         -  @ <script>
          292  +  @ <script  type="text/JavaScript">
   292    293     @ function xin(id){
   293    294     @ }
   294    295     @ function xout(id){
   295    296     @ }
   296    297     @ </script>
   297    298     style_footer();
   298    299   }
................................................................................
   339    340       "%s AND blob.rid IN (SELECT rid FROM tagxref"
   340    341       "                     WHERE tagtype>0 AND tagid=%d AND srcid!=0)"
   341    342       " ORDER BY event.mtime DESC",
   342    343       timeline_query_for_www(), TAG_BRANCH
   343    344     );
   344    345     www_print_timeline(&q, 0, brtimeline_extra);
   345    346     db_finalize(&q);
   346         -  @ <br clear="both">
   347         -  @ <script>
          347  +  @ <script  type="text/JavaScript">
   348    348     @ function xin(id){
   349    349     @ }
   350    350     @ function xout(id){
   351    351     @ }
   352    352     @ </script>
   353    353     style_footer();
   354    354   }

Changes to src/browse.c.

   142    142     if( zCI ){
   143    143       char *zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", rid);
   144    144       char zShort[20];
   145    145       memcpy(zShort, zUuid, 10);
   146    146       zShort[10] = 0;
   147    147       @ <h2>Files of check-in [<a href="vinfo?name=%T(zUuid)">%s(zShort)</a>]
   148    148       @ %s(blob_str(&dirname))</h2>
   149         -    zSubdirLink = mprintf("%s/dir?ci=%S&name=%T", g.zTop, zUuid, zPrefix);
          149  +    zSubdirLink = mprintf("%s/dir?ci=%S&amp;name=%T", g.zTop, zUuid, zPrefix);
   150    150       if( zD ){
   151    151         style_submenu_element("Top", "Top", "%s/dir?ci=%S", g.zTop, zUuid);
   152    152         style_submenu_element("All", "All", "%s/dir?name=%t", g.zTop, zD);
   153    153       }else{
   154    154         style_submenu_element("All", "All", "%s/dir", g.zBaseURL);
   155    155       }
   156    156     }else{
   157    157       @ <h2>The union of all files from all check-ins
   158    158       @ %s(blob_str(&dirname))</h2>
   159    159       zSubdirLink = mprintf("%s/dir?name=%T", g.zBaseURL, zPrefix);
   160    160       if( zD ){
   161    161         style_submenu_element("Top", "Top", "%s/dir", g.zBaseURL);
   162         -      style_submenu_element("Tip", "Tip", "%s/dir?name=%t&ci=tip",
          162  +      style_submenu_element("Tip", "Tip", "%s/dir?name=%t&amp;ci=tip",
   163    163                               g.zBaseURL, zD);
   164         -      style_submenu_element("Trunk", "Trunk", "%s/dir?name=%t&ci=trunk",
          164  +      style_submenu_element("Trunk", "Trunk", "%s/dir?name=%t&amp;ci=trunk",
   165    165                                g.zBaseURL,zD);
   166    166       }else{
   167    167         style_submenu_element("Tip", "Tip", "%s/dir?ci=tip", g.zBaseURL);
   168    168         style_submenu_element("Trunk", "Trunk", "%s/dir?ci=trunk", g.zBaseURL);
   169    169       }
   170    170     }
   171    171   
................................................................................
   214    214     ** directory.
   215    215     */
   216    216     mxLen = db_int(12, "SELECT max(length(x)) FROM localfiles /*scan*/");
   217    217     cnt = db_int(0, "SELECT count(*) FROM localfiles /*scan*/");
   218    218     nCol = 4;
   219    219     nRow = (cnt+nCol-1)/nCol;
   220    220     db_prepare(&q, "SELECT x, u FROM localfiles ORDER BY x /*scan*/");
   221         -  @ <table border="0" width="100%%"><tr><td valign="top" width="25%%">
          221  +  @ <table class="browser"><tr><td class="browser"><ul class="browser">
   222    222     i = 0;
   223    223     while( db_step(&q)==SQLITE_ROW ){
   224    224       const char *zFN;
   225    225       if( i==nRow ){
   226         -      @ </td><td valign="top" width="25%%">
          226  +      @ </ul></td><td class="browser"><ul class="browser">
   227    227         i = 0;
   228    228       }
   229    229       i++;
   230    230       zFN = db_column_text(&q, 0);
   231    231       if( zFN[0]=='/' ){
   232    232         zFN++;
   233    233         @ <li><a href="%s(zSubdirLink)%T(zFN)">%h(zFN)/</a></li>
   234    234       }else if( zCI ){
   235    235         const char *zUuid = db_column_text(&q, 1);
   236         -      @ <li><a href="%s(g.zBaseURL)/artifact?name=%s(zUuid)">%h(zFN)</a>
          236  +      @ <li><a href="%s(g.zBaseURL)/artifact?name=%s(zUuid)">%h(zFN)</a></li>
   237    237       }else{
   238         -      @ <li><a href="%s(g.zBaseURL)/finfo?name=%T(zPrefix)%T(zFN)">%h(zFN)</a>
          238  +      @ <li><a href="%s(g.zBaseURL)/finfo?name=%T(zPrefix)%T(zFN)">%h(zFN)
          239  +      @     </a></li>
   239    240       }
   240    241     }
   241    242     db_finalize(&q);
   242         -  @ </td></tr></table>
          243  +  @ </ul></td></tr></table>
   243    244     style_footer();
   244    245   }

Changes to src/db.c.

   662    662       fossil_fatal("cannot locate home directory - "
   663    663                    "please set the HOME environment variable");
   664    664     }
   665    665   #endif
   666    666     if( file_isdir(zHome)!=1 ){
   667    667       fossil_fatal("invalid home directory: %s", zHome);
   668    668     }
   669         -#ifndef __MINGW32__
          669  +#ifndef _WIN32
   670    670     if( access(zHome, W_OK) ){
   671    671       fossil_fatal("home directory %s must be writeable", zHome);
   672    672     }
   673    673   #endif
   674    674     g.zHome = mprintf("%/", zHome);
   675    675   #if defined(_WIN32)
   676    676     /* . filenames give some window systems problems and many apps problems */

Changes to src/descendants.c.

   316    316       style_submenu_element("Open", "Open", "leaves");
   317    317     }
   318    318     style_header("Leaves");
   319    319     login_anonymous_available();
   320    320     compute_leaves(0, showAll ? 0 : showClosed ? 2 : 1);
   321    321     style_sidebox_begin("Nomenclature:", "33%");
   322    322     @ <ol>
   323         -  @ <li> A <b>leaf</b> is a check-in with no descendants.</li>
   324         -  @ <li> An <b>open leaf</b> is a leaf that does not have a "closed" tag
          323  +  @ <li> A <div class="sideboxDescribed">leaf</div>
          324  +  @ is a check-in with no descendants.</li>
          325  +  @ <li> An <div class="sideboxDescribed">open leaf</div>
          326  +  @ is a leaf that does not have a "closed" tag
   325    327     @ and is thus assumed to still be in use.</li>
   326         -  @ <li> A <b>closed leaf</b> has a "closed" tag and is thus assumed to
          328  +  @ <li> A <div class="sideboxDescribed">closed leaf</div>
          329  +  @ has a "closed" tag and is thus assumed to
   327    330     @ be historical and no longer in active use.</li>
   328    331     @ </ol>
   329    332     style_sidebox_end();
   330    333   
   331    334     if( showAll ){
   332    335       @ <h1>All leaves, both open and closed:</h1>
   333    336     }else if( showClosed ){
................................................................................
   339    342       "%s"
   340    343       "   AND blob.rid IN leaves"
   341    344       " ORDER BY event.mtime DESC",
   342    345       timeline_query_for_www()
   343    346     );
   344    347     www_print_timeline(&q, TIMELINE_LEAFONLY, leaves_extra);
   345    348     db_finalize(&q);
   346         -  @ <br clear="both">
   347         -  @ <script>
          349  +  @ <br />
          350  +  @ <script  type="text/JavaScript">
   348    351     @ function xin(id){
   349    352     @ }
   350    353     @ function xout(id){
   351    354     @ }
   352    355     @ </script>
   353    356     style_footer();
   354    357   }

Changes to src/finfo.c.

   134    134     blob_zero(&title);
   135    135     blob_appendf(&title, "History of ");
   136    136     hyperlinked_path(zFilename, &title);
   137    137     @ <h2>%b(&title)</h2>
   138    138     blob_reset(&title);
   139    139     pGraph = graph_init();
   140    140     @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
   141         -  @ <table cellspacing=0 border=0 cellpadding=0>
          141  +  @ <table class="timelineTable">
   142    142     while( db_step(&q)==SQLITE_ROW ){
   143    143       const char *zDate = db_column_text(&q, 0);
   144    144       const char *zCom = db_column_text(&q, 1);
   145    145       const char *zUser = db_column_text(&q, 2);
   146    146       int fpid = db_column_int(&q, 3);
   147    147       int frid = db_column_int(&q, 4);
   148    148       const char *zPUuid = db_column_text(&q, 5);
................................................................................
   155    155       char zShort[20];
   156    156       char zShortCkin[20];
   157    157       if( zBr==0 ) zBr = "trunk";
   158    158       gidx = graph_add_row(pGraph, frid, fpid>0 ? 1 : 0, &fpid, zBr, zBgClr);
   159    159       if( memcmp(zDate, zPrevDate, 10) ){
   160    160         sprintf(zPrevDate, "%.10s", zDate);
   161    161         @ <tr><td>
   162         -      @   <div class="divider"><nobr>%s(zPrevDate)</nobr></div>
          162  +      @   <div class="divider">%s(zPrevDate)</div>
   163    163         @ </td></tr>
   164    164       }
   165    165       memcpy(zTime, &zDate[11], 5);
   166    166       zTime[5] = 0;
   167         -    @ <tr><td valign="top" align="right">
          167  +    @ <tr><td class="timelineTime">
   168    168       @ <a href="%s(g.zTop)/timeline?c=%t(zDate)">%s(zTime)</a></td>
   169         -    @ <td width="20" align="left" valign="top"><div id="m%d(gidx)"></div></td>
          169  +    @ <td class="timelineGraph"><div id="m%d(gidx)"></div></td>
   170    170       if( zBgClr && zBgClr[0] ){
   171         -      @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
          171  +      @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
   172    172       }else{
   173         -      @ <td valign="top" align="left">
          173  +      @ <td class="timelineTableCell">
   174    174       }
   175    175       sqlite3_snprintf(sizeof(zShort), zShort, "%.10s", zUuid);
   176    176       sqlite3_snprintf(sizeof(zShortCkin), zShortCkin, "%.10s", zCkin);
   177    177       if( zUuid ){
   178    178         if( g.okHistory ){
   179    179           @ <a href="%s(g.zTop)/artifact/%s(zUuid)">[%S(zUuid)]</a>
   180    180         }else{
................................................................................
   185    185         @ <b>Deleted</b> by check-in
   186    186       }
   187    187       hyperlink_to_uuid(zShortCkin);
   188    188       @ %h(zCom) (user: 
   189    189       hyperlink_to_user(zUser, zDate, "");
   190    190       @ branch: %h(zBr))
   191    191       if( g.okHistory && zUuid ){
          192  +      const char *z = zFilename;
   192    193         if( fpid ){
   193    194           @ <a href="%s(g.zTop)/fdiff?v1=%s(zPUuid)&amp;v2=%s(zUuid)">[diff]</a>
   194    195         }
   195         -      @ <a href="%s(g.zTop)/annotate?checkin=%S(zCkin)&amp;filename=%h(zFilename)">
          196  +      @ <a href="%s(g.zTop)/annotate?checkin=%S(zCkin)&amp;filename=%h(z)">
   196    197         @ [annotate]</a>
   197    198       }
   198         -    @ </td>
          199  +    @ </td></tr>
   199    200     }
   200    201     db_finalize(&q);
   201    202     if( pGraph ){
   202    203       graph_finish(pGraph, 1);
   203    204       if( pGraph->nErr ){
   204    205         graph_free(pGraph);
   205    206         pGraph = 0;
   206    207       }else{
   207         -      @ <tr><td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div>
          208  +      @ <tr><td></td><td><div style="width:%d(pGraph->mxRail*20+30)px;"></div>
          209  +      @     </td></tr>
   208    210       }
   209    211     }
   210    212     @ </table>
   211    213     timeline_output_graph_javascript(pGraph);
   212    214     style_footer();
   213    215   }

Changes to src/info.c.

   192    192       cnt++;
   193    193       if( cnt==1 ){
   194    194         @ <div class="section">Tags And Properties</div>
   195    195         @ <ul>
   196    196       }
   197    197       @ <li>
   198    198       if( tagtype==0 ){
   199         -      @ <b><s>%h(zTagname)</s></b> cancelled
          199  +      @ <span class="infoTagCancelled">%h(zTagname)</span> cancelled
   200    200       }else if( zValue ){
   201         -      @ <b>%h(zTagname)=%h(zValue)</b>
          201  +      @ <span class="infoTag">%h(zTagname)=%h(zValue)</span>
   202    202       }else {
   203         -      @ <b>%h(zTagname)</b>
          203  +      @ <span class="infoTag">%h(zTagname)</span>
   204    204       }
   205    205       if( tagtype==2 ){
   206    206         if( zOrigUuid && zOrigUuid[0] ){
   207    207           @ inherited from
   208    208           hyperlink_to_uuid(zOrigUuid);
   209    209         }else{
   210    210           @ propagates to descendants
................................................................................
   220    220         }else{
   221    221           @ added by
   222    222         }
   223    223         hyperlink_to_uuid(zSrcUuid);
   224    224         @ on
   225    225         hyperlink_to_date(zDate,0);
   226    226       }
          227  +    @ </li>
   227    228     }
   228    229     db_finalize(&q);
   229    230     if( cnt ){
   230    231       @ </ul>
   231    232     }
   232    233   }
   233    234   
................................................................................
   274    275       }
   275    276     }else if( zOld && zNew ){
   276    277       @ <p>Modified <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
   277    278       @ from <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a>
   278    279       @ to <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)].</a>
   279    280       if( !showDiff ){
   280    281         @ &nbsp;&nbsp;
   281         -      @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&v2=%S(zNew)">[diff]</a>
          282  +      @ <a href="%s(g.zTop)/fdiff?v1=%S(zOld)&amp;v2=%S(zNew)">[diff]</a>
   282    283       }else{
   283    284         int rid1 = uuid_to_rid(zOld, 0);
   284    285         int rid2 = uuid_to_rid(zNew, 0);
   285    286         @ <blockquote><pre>
   286    287         append_diff(rid1, rid2);
   287    288         @ </pre></blockquote>
   288    289       }
          290  +    @ </p>
   289    291     }else if( zOld ){
   290    292       @ <p>Deleted <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
   291    293       @ version <a href="%s(g.zTop)/artifact/%s(zOld)">[%S(zOld)]</a></p>
   292    294     }else{
   293    295       @ <p>Added <a href="%s(g.zTop)/finfo?name=%T(zName)">%h(zName)</a>
   294    296       @ version <a href="%s(g.zTop)/artifact/%s(zNew)">[%S(zNew)]</a></p>
   295    297     }
................................................................................
   352    354       zEComment = db_text(0, 
   353    355                      "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d",
   354    356                      TAG_COMMENT, rid);
   355    357       zUser = db_column_text(&q, 2);
   356    358       zComment = db_column_text(&q, 3);
   357    359       zDate = db_column_text(&q,1);
   358    360       @ <div class="section">Overview</div>
   359         -    @ <p><table class="label-value">
          361  +    @ <table class="label-value">
   360    362       @ <tr><th>SHA1&nbsp;Hash:</th><td>%s(zUuid)
   361    363       if( g.okSetup ){
   362    364         @ (Record ID: %d(rid))
   363    365       }
   364    366       @ </td></tr>
   365    367       @ <tr><th>Date:</th><td>
   366    368       hyperlink_to_date(zDate, "</td></tr>");
................................................................................
   395    397           @ <td>%h(zUser) @ %h(zIpAddr) on %s(zDate)</td></tr>
   396    398         }
   397    399         db_finalize(&q);
   398    400       }
   399    401       if( g.okHistory ){
   400    402         const char *zProjName = db_get("project-name", "unnamed");
   401    403         @ <tr><th>Timelines:</th><td>
   402         -      @    <a href="%s(g.zBaseURL)/timeline?p=%S(zUuid)">ancestors</a>
   403         -      @    | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)">descendants</a>
   404         -      @    | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)&p=%S(zUuid)">both</a>
          404  +      @   <a href="%s(g.zBaseURL)/timeline?p=%S(zUuid)">ancestors</a>
          405  +      @ | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)">descendants</a>
          406  +      @ | <a href="%s(g.zBaseURL)/timeline?d=%S(zUuid)&amp;p=%S(zUuid)">both</a>
   405    407         db_prepare(&q, "SELECT substr(tag.tagname,5) FROM tagxref, tag "
   406    408                        " WHERE rid=%d AND tagtype>0 "
   407    409                        "   AND tag.tagid=tagxref.tagid "
   408    410                        "   AND +tag.tagname GLOB 'sym-*'", rid);
   409    411         while( db_step(&q)==SQLITE_ROW ){
   410    412           const char *zTagName = db_column_text(&q, 0);
   411    413           @  | <a href="%s(g.zTop)/timeline?r=%T(zTagName)">%h(zTagName)</a>
................................................................................
   422    424         @   | <a href="%s(g.zTop)/artifact/%S(zUuid)">manifest</a>
   423    425         if( g.okWrite ){
   424    426           @   | <a href="%s(g.zTop)/ci_edit?r=%S(zUuid)">edit</a>
   425    427         }
   426    428         @   </td>
   427    429         @ </tr>
   428    430       }
   429         -    @ </table></p>
          431  +    @ </table>
   430    432     }else{
   431    433       style_header("Check-in Information");
   432    434       login_anonymous_available();
   433    435     }
   434    436     db_finalize(&q);
   435    437     showTags(rid, "");
   436    438     @ <div class="section">Changes</div>
................................................................................
   614    616     }
   615    617     db_finalize(&q);
   616    618   }
   617    619   
   618    620   
   619    621   /*
   620    622   ** WEBPAGE: vdiff
   621         -** URL: /vdiff?from=UUID&to=UUID&detail=BOOLEAN
          623  +** URL: /vdiff?from=UUID&amp;to=UUID&amp;detail=BOOLEAN
   622    624   **
   623    625   ** Show all differences between two checkins.  
   624    626   */
   625    627   void vdiff_page(void){
   626    628     int ridFrom, ridTo;
   627    629     int showDetail = 0;
   628    630     int iFrom, iTo;
................................................................................
   636    638     if( vdiff_parse_manifest("to", &ridTo, &mTo) ) return;
   637    639     showDetail = atoi(PD("detail","0"));
   638    640     style_header("Check-in Differences");
   639    641     @ <h2>Difference From:</h2><blockquote>
   640    642     checkin_description(ridFrom);
   641    643     @ </blockquote><h2>To:</h2><blockquote>
   642    644     checkin_description(ridTo);
   643         -  @ </blockquote><hr><p>
          645  +  @ </blockquote><hr /><p>
   644    646   
   645    647     iFrom = iTo = 0;
   646    648     while( iFrom<mFrom.nFile && iTo<mTo.nFile ){
   647    649       int cmp;
   648    650       if( iFrom>=mFrom.nFile ){
   649    651         cmp = +1;
   650    652       }else if( iTo>=mTo.nFile ){
................................................................................
   878    880     login_check_credentials();
   879    881     if( !g.okRead ){ login_needed(); return; }
   880    882     v1 = name_to_rid_www("v1");
   881    883     v2 = name_to_rid_www("v2");
   882    884     if( v1==0 || v2==0 ) fossil_redirect_home();
   883    885     style_header("Diff");
   884    886     @ <h2>Differences From:</h2>
   885         -  @ <blockquote>
          887  +  @ <blockquote><p>
   886    888     object_description(v1, 1, 0);
   887         -  @ </blockquote>
          889  +  @ </p></blockquote>
   888    890     @ <h2>To:</h2>
   889         -  @ <blockquote>
          891  +  @ <blockquote><p>
   890    892     object_description(v2, 1, 0);
   891         -  @ </blockquote>
   892         -  @ <hr>
          893  +  @ </p></blockquote>
          894  +  @ <hr />
   893    895     @ <blockquote><pre>
   894    896     content_get(v1, &c1);
   895    897     content_get(v2, &c2);
   896    898     blob_zero(&diff);
   897    899     text_diff(&c1, &c2, &diff, 4, 1);
   898    900     blob_reset(&c1);
   899    901     blob_reset(&c2);
................................................................................
   992    994     rid = name_to_rid_www("name");
   993    995     login_check_credentials();
   994    996     if( !g.okRead ){ login_needed(); return; }
   995    997     if( rid==0 ) fossil_redirect_home();
   996    998     if( g.okAdmin ){
   997    999       const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
   998   1000       if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
   999         -      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
         1001  +      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&amp;sub=1",
  1000   1002               g.zTop, zUuid);
  1001   1003       }else{
  1002   1004         style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
  1003   1005               g.zTop, zUuid);
  1004   1006       }
  1005   1007     }
  1006   1008     style_header("Hex Artifact Content");
  1007   1009     zUuid = db_text("?","SELECT uuid FROM blob WHERE rid=%d", rid);
  1008   1010     @ <h2>Artifact %s(zUuid):</h2>
  1009         -  @ <blockquote>
         1011  +  @ <blockquote><p>
  1010   1012     blob_zero(&downloadName);
  1011   1013     object_description(rid, 0, &downloadName);
  1012   1014     style_submenu_element("Download", "Download", 
  1013   1015           "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
  1014         -  @ </blockquote>
  1015         -  @ <hr>
         1016  +  @ </p></blockquote>
         1017  +  @ <hr />
  1016   1018     content_get(rid, &content);
  1017   1019     @ <blockquote><pre>
  1018   1020     hexdump(&content);
  1019   1021     @ </pre></blockquote>
  1020   1022     style_footer();
  1021   1023   }
  1022   1024   
................................................................................
  1074   1076   
  1075   1077     login_check_credentials();
  1076   1078     if( !g.okRead ){ login_needed(); return; }
  1077   1079     if( rid==0 ) fossil_redirect_home();
  1078   1080     if( g.okAdmin ){
  1079   1081       const char *zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
  1080   1082       if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
  1081         -      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
         1083  +      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&amp;sub=1",
  1082   1084               g.zTop, zUuid);
  1083   1085       }else{
  1084   1086         style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
  1085   1087               g.zTop, zUuid);
  1086   1088       }
  1087   1089     }
  1088   1090     style_header("Artifact Content");
  1089   1091     zUuid = db_text("?", "SELECT uuid FROM blob WHERE rid=%d", rid);
  1090   1092     @ <h2>Artifact %s(zUuid)</h2>
  1091         -  @ <blockquote>
         1093  +  @ <blockquote><p>
  1092   1094     blob_zero(&downloadName);
  1093   1095     object_description(rid, 0, &downloadName);
  1094   1096     style_submenu_element("Download", "Download", 
  1095   1097             "%s/raw/%T?name=%s", g.zTop, blob_str(&downloadName), zUuid);
  1096   1098     zMime = mimetype_from_name(blob_str(&downloadName));
  1097   1099     if( zMime ){
  1098   1100       if( strcmp(zMime, "text/html")==0 ){
  1099   1101         if( P("txt") ){
  1100   1102           style_submenu_element("Html", "Html",
  1101   1103                                 "%s/artifact?name=%s", g.zTop, zUuid);
  1102   1104         }else{
  1103   1105           renderAsHtml = 1;
  1104   1106           style_submenu_element("Text", "Text",
  1105         -                              "%s/artifact?name=%s&txt=1", g.zTop, zUuid);
         1107  +                              "%s/artifact?name=%s&amp;txt=1", g.zTop, zUuid);
  1106   1108         }
  1107   1109       }else if( strcmp(zMime, "application/x-fossil-wiki")==0 ){
  1108   1110         if( P("txt") ){
  1109   1111           style_submenu_element("Wiki", "Wiki",
  1110   1112                                 "%s/artifact?name=%s", g.zTop, zUuid);
  1111   1113         }else{
  1112   1114           renderAsWiki = 1;
  1113   1115           style_submenu_element("Text", "Text",
  1114         -                              "%s/artifact?name=%s&txt=1", g.zTop, zUuid);
         1116  +                              "%s/artifact?name=%s&amp;txt=1", g.zTop, zUuid);
  1115   1117         }
  1116   1118       }
  1117   1119     }
  1118         -  @ </blockquote>
  1119         -  @ <hr>
         1120  +  @ </p></blockquote>
         1121  +  @ <hr />
  1120   1122     content_get(rid, &content);
  1121   1123     if( renderAsWiki ){
  1122   1124       wiki_convert(&content, 0, 0);
  1123   1125     }else if( renderAsHtml ){
  1124   1126       @ <div>
  1125   1127       cgi_append_content(blob_buffer(&content), blob_size(&content));
  1126   1128       @ </div>
................................................................................
  1129   1131       @ <blockquote>
  1130   1132       if( zMime==0 ){
  1131   1133         @ <pre>
  1132   1134         @ %h(blob_str(&content))
  1133   1135         @ </pre>
  1134   1136         style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
  1135   1137       }else if( strncmp(zMime, "image/", 6)==0 ){
  1136         -      @ <img src="%s(g.zBaseURL)/raw?name=%s(zUuid)&m=%s(zMime)"></img>
         1138  +      @ <img src="%s(g.zBaseURL)/raw?name=%s(zUuid)&amp;m=%s(zMime)"></img>
  1137   1139         style_submenu_element("Hex","Hex", "%s/hexdump?name=%s", g.zTop, zUuid);
  1138   1140       }else{
  1139   1141         @ <pre>
  1140   1142         hexdump(&content);
  1141   1143         @ </pre>
  1142   1144       }
  1143   1145       @ </blockquote>
................................................................................
  1162   1164     login_check_credentials();
  1163   1165     if( !g.okRdTkt ){ login_needed(); return; }
  1164   1166     rid = name_to_rid_www("name");
  1165   1167     if( rid==0 ){ fossil_redirect_home(); }
  1166   1168     zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", rid);
  1167   1169     if( g.okAdmin ){
  1168   1170       if( db_exists("SELECT 1 FROM shun WHERE uuid='%s'", zUuid) ){
  1169         -      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&sub=1",
         1171  +      style_submenu_element("Unshun","Unshun", "%s/shun?uuid=%s&amp;sub=1",
  1170   1172               g.zTop, zUuid);
  1171   1173       }else{
  1172   1174         style_submenu_element("Shun","Shun", "%s/shun?shun=%s#addshun",
  1173   1175               g.zTop, zUuid);
  1174   1176       }
  1175   1177     }
  1176   1178     content_get(rid, &content);
................................................................................
  1440   1442     if( P("preview") ){
  1441   1443       Blob suffix;
  1442   1444       int nTag = 0;
  1443   1445       @ <b>Preview:</b>
  1444   1446       @ <blockquote>
  1445   1447       @ <table border=0>
  1446   1448       if( zNewColor && zNewColor[0] ){
  1447         -      @ <tr><td bgcolor="%h(zNewColor)">
         1449  +      @ <tr><td style="background-color: %h(zNewColor);">
  1448   1450       }else{
  1449   1451         @ <tr><td>
  1450   1452       }
  1451   1453       wiki_convert(&comment, 0, WIKI_INLINE);
  1452   1454       blob_zero(&suffix);
  1453   1455       blob_appendf(&suffix, "(user: %h", zNewUser);
  1454   1456       db_prepare(&q, "SELECT substr(tagname,5) FROM tagxref, tag"
................................................................................
  1465   1467         nTag++;
  1466   1468       }
  1467   1469       db_finalize(&q);
  1468   1470       blob_appendf(&suffix, ")");
  1469   1471       @ %s(blob_str(&suffix))
  1470   1472       @ </td></tr></table>
  1471   1473       @ </blockquote>
  1472         -    @ <hr>
         1474  +    @ <hr />
  1473   1475       blob_reset(&suffix);
  1474   1476     }
  1475   1477     @ <p>Make changes to attributes of check-in
  1476   1478     @ [<a href="ci?name=%s(zUuid)">%s(zUuid)</a>]:</p>
  1477   1479     @ <form action="%s(g.zBaseURL)/ci_edit" method="POST">
  1478   1480     login_insert_csrf_secret();
  1479   1481     @ <input type="hidden" name="r" value="%S(zUuid)">
................................................................................
  1503   1505     }else{
  1504   1506       @ <input type="checkbox" name="pclr">
  1505   1507     }
  1506   1508     @ Propagate color to descendants</input></td></tr>
  1507   1509     @ <tr>
  1508   1510     for(i=0; i<nColor; i++){
  1509   1511       if( aColor[i].zColor[0] ){
  1510         -      @ <td bgcolor="%h(aColor[i].zColor)">
         1512  +      @ <td style="background-color: %h(aColor[i].zColor);">
  1511   1513       }else{
  1512   1514         @ <td>
  1513   1515       }
  1514   1516       if( strcmp(zNewColor, aColor[i].zColor)==0 ){
  1515   1517         @ <input type="radio" name="clr" value="%h(aColor[i].zColor)" checked>
  1516   1518       }else{
  1517   1519         @ <input type="radio" name="clr" value="%h(aColor[i].zColor)">
................................................................................
  1539   1541     );
  1540   1542     while( db_step(&q)==SQLITE_ROW ){
  1541   1543       int tagid = db_column_int(&q, 0);
  1542   1544       const char *zTagName = db_column_text(&q, 1);
  1543   1545       char zLabel[30];
  1544   1546       sprintf(zLabel, "c%d", tagid);
  1545   1547       if( P(zLabel) ){
  1546         -      @ <br><input type="checkbox" name="c%d(tagid)" checked>
         1548  +      @ <br /><input type="checkbox" name="c%d(tagid)" checked>
  1547   1549       }else{
  1548         -      @ <br><input type="checkbox" name="c%d(tagid)">
         1550  +      @ <br /><input type="checkbox" name="c%d(tagid)">
  1549   1551       }
  1550   1552       if( strncmp(zTagName, "sym-", 4)==0 ){
  1551   1553         @ Cancel tag <b>%h(&zTagName[4])</b>
  1552   1554       }else{
  1553   1555         @ Cancel special tag <b>%h(zTagName)</b>
  1554   1556       }
  1555   1557     }

Changes to src/login.c.

   151    151     if( g.okPassword && zPasswd && (zNew1 = P("n1"))!=0 && (zNew2 = P("n2"))!=0 ){
   152    152       zSha1Pw = sha1_shared_secret(zPasswd, g.zLogin);
   153    153       if( db_int(1, "SELECT 0 FROM user"
   154    154                     " WHERE uid=%d AND (pw=%Q OR pw=%Q)", 
   155    155                     g.userUid, zPasswd, zSha1Pw) ){
   156    156         sleep(1);
   157    157         zErrMsg = 
   158         -         @ <p><font color="red">
          158  +         @ <p><span class="loginError">
   159    159            @ You entered an incorrect old password while attempting to change
   160    160            @ your password.  Your password is unchanged.
   161         -         @ </font></p>
          161  +         @ </span></p>
   162    162         ;
   163    163       }else if( strcmp(zNew1,zNew2)!=0 ){
   164    164         zErrMsg = 
   165         -         @ <p><font color="red">
          165  +         @ <p><span class="loginError">
   166    166            @ The two copies of your new passwords do not match.
   167    167            @ Your password is unchanged.
   168         -         @ </font></p>
          168  +         @ </span></p>
   169    169         ;
   170    170       }else{
   171    171         char *zNewPw = sha1_shared_secret(zNew1, g.zLogin);
   172    172         db_multi_exec(
   173    173            "UPDATE user SET pw=%Q WHERE uid=%d", zNewPw, g.userUid
   174    174         );
   175    175         redirect_to_g();
................................................................................
   204    204           "   AND login NOT IN ('anonymous','nobody','developer','reader')"
   205    205           "   AND (pw=%Q OR pw=%Q)",
   206    206           zUsername, zPasswd, zSha1Pw
   207    207       );
   208    208       if( uid<=0 ){
   209    209         sleep(1);
   210    210         zErrMsg = 
   211         -         @ <p><font color="red">
          211  +         @ <p><span class="loginError">
   212    212            @ You entered an unknown user or an incorrect password.
   213         -         @ </font></p>
          213  +         @ </span></p>
   214    214         ;
   215    215       }else{
   216    216         char *zCookie;
   217    217         const char *zCookieName = login_cookie_name();
   218    218         const char *zExpire = db_get("cookie-expire","8766");
   219    219         int expires = atoi(zExpire)*3600;
   220    220         const char *zIpAddr = PD("REMOTE_ADDR","nil");
................................................................................
   227    227           zCookie, zIpAddr, expires, uid
   228    228         );
   229    229         redirect_to_g();
   230    230       }
   231    231     }
   232    232     style_header("Login/Logout");
   233    233     @ %s(zErrMsg)
   234         -  @ <form action="login" method="POST">
          234  +  @ <form action="login" method="post">
   235    235     if( P("g") ){
   236         -    @ <input type="hidden" name="g" value="%h(P("g"))">
          236  +    @ <input type="hidden" name="g" value="%h(P("g"))" />
   237    237     }
   238         -  @ <table align="left" hspace="10">
          238  +  @ <table class="login_out">
   239    239     @ <tr>
   240         -  @   <td align="right">User ID:</td>
          240  +  @   <td class="login_out_label">User ID:</td>
   241    241     if( anonFlag ){
   242         -    @   <td><input type="text" id="u" name="u" value="anonymous" size=30></td>
          242  +    @ <td><input type="text" id="u" name="u" value="anonymous" size="30" /></td>
   243    243     }else{
   244         -    @   <td><input type="text" id="u" name="u" value="" size=30></td>
          244  +    @ <td><input type="text" id="u" name="u" value="" size="30" /></td>
   245    245     }
   246    246     @ </tr>
   247    247     @ <tr>
   248         -  @  <td align="right">Password:</td>
   249         -  @   <td><input type="password" id="p" name="p" value="" size=30></td>
          248  +  @  <td class="login_out_label">Password:</td>
          249  +  @   <td><input type="password" id="p" name="p" value="" size="30" /></td>
   250    250     @ </tr>
   251    251     if( g.zLogin==0 ){
   252    252       zAnonPw = db_text(0, "SELECT pw FROM user"
   253    253                            " WHERE login='anonymous'"
   254    254                            "   AND cap!=''");
   255    255     }
   256    256     @ <tr>
   257    257     @   <td></td>
   258         -  @   <td><input type="submit" name="in" value="Login"></td>
          258  +  @   <td><input type="submit" name="in" value="Login" /></td>
   259    259     @ </tr>
   260    260     @ </table>
   261         -  @ <script>document.getElementById('u').focus()</script>
          261  +  @ <script type="text/JavaScript">document.getElementById('u').focus()</script>
   262    262     if( g.zLogin==0 ){
   263    263       @ <p>Enter
   264    264     }else{
   265    265       @ <p>You are currently logged in as <b>%h(g.zLogin)</b></p>
   266    266       @ <p>To change your login to a different user, enter
   267    267     }
   268    268     @ your user-id and password at the left and press the
................................................................................
   271    271     @ the login to take.</p>
   272    272     if( zAnonPw ){
   273    273       unsigned int uSeed = captcha_seed();
   274    274       char const *zDecoded = captcha_decode(uSeed);
   275    275       int bAutoCaptcha = db_get_boolean("auto-captcha", 1);
   276    276       char *zCaptcha = captcha_render(zDecoded);
   277    277   
   278         -    @ <input type="hidden" name="cs" value="%u(uSeed)"/>
   279         -    @ <p>Visitors may enter <b>anonymous</b> as the user-ID with
          278  +    @ <p><input type="hidden" name="cs" value="%u(uSeed)" />
          279  +    @ Visitors may enter <b>anonymous</b> as the user-ID with
   280    280       @ the 8-character hexadecimal password shown below:</p>
   281         -    @ <center><table border="1" cellpadding="10"><tr><td><pre>
          281  +    @ <div class="captcha"><table class="captcha"><tr><td><pre>
   282    282       @ %s(zCaptcha)
   283    283       @ </pre></td></tr></table>
   284    284       if( bAutoCaptcha ) {
   285    285           @ <input type="button" value="Fill out captcha"
   286    286           @  onclick="document.getElementById('u').value='anonymous';
   287         -        @           document.getElementById('p').value='%s(zDecoded)';"/>
          287  +        @           document.getElementById('p').value='%s(zDecoded)';" />
   288    288       }
   289         -    @ </center>
          289  +    @ </div>
   290    290       free(zCaptcha);
   291    291     }
   292    292     if( g.zLogin ){
   293         -    @ <br clear="both"><hr>
          293  +    @ <hr />
   294    294       @ <p>To log off the system (and delete your login cookie)
   295         -    @  press the following button:<br>
   296         -    @ <input type="submit" name="out" value="Logout"></p>
          295  +    @  press the following button:<br />
          296  +    @ <input type="submit" name="out" value="Logout" /></p>
   297    297     }
   298    298     @ </form>
   299    299     if( g.okPassword ){
   300         -    @ <br clear="both"><hr>
          300  +    @ <hr />
   301    301       @ <p>To change your password, enter your old password and your
   302    302       @ new password twice below then press the "Change Password"
   303    303       @ button.</p>
   304         -    @ <form action="login" method="POST">
          304  +    @ <form action="login" method="post">
   305    305       @ <table>
   306         -    @ <tr><td align="right">Old Password:</td>
   307         -    @ <td><input type="password" name="p" size=30></td></tr>
   308         -    @ <tr><td align="right">New Password:</td>
   309         -    @ <td><input type="password" name="n1" size=30></td></tr>
   310         -    @ <tr><td align="right">Repeat New Password:</td>
   311         -    @ <td><input type="password" name="n2" size=30></td></tr>
          306  +    @ <tr><td class="login_out_label">Old Password:</td>
          307  +    @ <td><input type="password" name="p" size="30" /></td></tr>
          308  +    @ <tr><td class="login_out_label">New Password:</td>
          309  +    @ <td><input type="password" name="n1" size="30" /></td></tr>
          310  +    @ <tr><td class="login_out_label">Repeat New Password:</td>
          311  +    @ <td><input type="password" name="n2" size="30" /></td></tr>
   312    312       @ <tr><td></td>
   313         -    @ <td><input type="submit" value="Change Password"></td></tr>
          313  +    @ <td><input type="submit" value="Change Password" /></td></tr>
   314    314       @ </table>
   315    315       @ </form>
   316    316     }
   317    317     style_footer();
   318    318   }
   319    319   
   320    320   
................................................................................
   594    594   */
   595    595   void login_anonymous_available(void){
   596    596     if( !g.okHistory &&
   597    597         db_exists("SELECT 1 FROM user"
   598    598                   " WHERE login='anonymous'"
   599    599                   "   AND cap LIKE '%%h%%'") ){
   600    600       const char *zUrl = PD("REQUEST_URI", "index");
   601         -    @ <p>Many <font color="red">hyperlinks are disabled.</font><br />
   602         -    @ Use <a href="%s(g.zTop)/login?anon=1&g=%T(zUrl)">anonymous login</a>
          601  +    @ <p>Many <span class="disabled">hyperlinks are disabled.</span><br />
          602  +    @ Use <a href="%s(g.zTop)/login?anon=1&amp;g=%T(zUrl)">anonymous login</a>
   603    603       @ to enable hyperlinks.</p>
   604    604     }
   605    605   }
   606    606   
   607    607   /*
   608    608   ** While rendering a form, call this routine to add the Anti-CSRF token
   609    609   ** as a hidden element of the form.
   610    610   */
   611    611   void login_insert_csrf_secret(void){
   612         -  @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)">
          612  +  @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)" />
   613    613   }
   614    614   
   615    615   /*
   616    616   ** Before using the results of a form, first call this routine to verify
   617    617   ** that ths Anti-CSRF token is present and is valid.  If the Anti-CSRF token
   618    618   ** is missing or is incorrect, that indicates a cross-site scripting attach
   619    619   ** so emits an error message and abort.

Changes to src/report.c.

   275    275     }
   276    276     zTitle = db_column_text(&q, 0);
   277    277     zSQL = db_column_text(&q, 1);
   278    278     zOwner = db_column_text(&q, 2);
   279    279     zClrKey = db_column_text(&q, 3);
   280    280     @ <table cellpadding=0 cellspacing=0 border=0>
   281    281     @ <tr><td valign="top" align="right">Title:</td><td width=15></td>
   282         -  @ <td colspan=3>%h(zTitle)</td></tr>
          282  +  @ <td colspan="3">%h(zTitle)</td></tr>
   283    283     @ <tr><td valign="top" align="right">Owner:</td><td></td>
   284         -  @ <td colspan=3>%h(zOwner)</td></tr>
          284  +  @ <td colspan="3">%h(zOwner)</td></tr>
   285    285     @ <tr><td valign="top" align="right">SQL:</td><td></td>
   286    286     @ <td valign="top"><pre>
   287    287     @ %h(zSQL)
   288    288     @ </pre></td>
   289    289     @ <td width=15></td><td valign="top">
   290    290     output_color_key(zClrKey, 0, "border=0 cellspacing=0 cellpadding=3");
   291    291     @ </td>
................................................................................
   391    391         zTitle = mprintf("Copy Of %s", zTitle);
   392    392         zOwner = g.zLogin;
   393    393       }
   394    394     }
   395    395     if( zOwner==0 ) zOwner = g.zLogin;
   396    396     style_submenu_element("Cancel", "Cancel", "reportlist");
   397    397     if( rn>0 ){
   398         -    style_submenu_element("Delete", "Delete", "rptedit?rn=%d&del1=1", rn);
          398  +    style_submenu_element("Delete", "Delete", "rptedit?rn=%d&amp;del1=1", rn);
   399    399     }
   400    400     style_header(rn>0 ? "Edit Report Format":"Create New Report Format");
   401    401     if( zErr ){
   402    402       @ <blockquote><font color="#ff0000"><b>%h(zErr)</b></font></blockquote>
   403    403     }
   404    404     @ <form action="rptedit" method="POST">
   405    405     @ <input type="hidden" name="rn" value="%d(rn)">
   406         -  @ <p>Report Title:<br>
          406  +  @ <p>Report Title:<br />
   407    407     @ <input type="text" name="t" value="%h(zTitle)" size="60"></p>
   408         -  @ <p>Enter a complete SQL query statement against the "TICKET" table:<br>
          408  +  @ <p>Enter a complete SQL query statement against the "TICKET" table:<br />
   409    409     @ <textarea name="s" rows="20" cols="80">%h(zSQL)</textarea>
   410    410     @ </p>
   411    411     login_insert_csrf_secret();
   412    412     if( g.okAdmin ){
   413    413       @ <p>Report owner:
   414    414       @ <input type="text" name="w" size="20" value="%h(zOwner)">
   415    415       @ </p>
   416    416     } else {
   417    417       @ <input type="hidden" name="w" value="%h(zOwner)">
   418    418     }
   419    419     @ <p>Enter an optional color key in the following box.  (If blank, no
   420    420     @ color key is displayed.)  Each line contains the text for a single
   421    421     @ entry in the key.  The first token of each line is the background
   422         -  @ color for that line.<br>
          422  +  @ color for that line.<br />
   423    423     @ <textarea name="k" rows="8" cols="50">%h(zClrKey)</textarea>
   424    424     @ </p>
   425    425     if( !g.okAdmin && strcmp(zOwner,g.zLogin)!=0 ){
   426    426       @ <p>This report format is owned by %h(zOwner).  You are not allowed
   427    427       @ to change it.</p>
   428    428       @ </form>
   429    429       report_format_hints();
................................................................................
   446    446   static void report_format_hints(void){
   447    447     char *zSchema;
   448    448     zSchema = db_text(0,"SELECT sql FROM sqlite_master WHERE name='ticket'");
   449    449     if( zSchema==0 ){
   450    450       zSchema = db_text(0,"SELECT sql FROM repository.sqlite_master"
   451    451                           " WHERE name='ticket'");
   452    452     }
   453         -  @ <hr><h3>TICKET Schema</h3>
          453  +  @ <hr /><h3>TICKET Schema</h3>
   454    454     @ <blockquote><pre>
   455    455     @ %h(zSchema)
   456    456     @ </pre></blockquote>
   457    457     @ <h3>Notes</h3>
   458    458     @ <ul>
   459    459     @ <li><p>The SQL must consist of a single SELECT statement</p></li>
   460    460     @
................................................................................
   827    827     zToFree = zSafeKey = mprintf("%h", zClrKey);
   828    828     while( zSafeKey[0] ){
   829    829       while( isspace(*zSafeKey) ) zSafeKey++;
   830    830       for(i=0; zSafeKey[i] && !isspace(zSafeKey[i]); i++){}
   831    831       for(j=i; isspace(zSafeKey[j]); j++){}
   832    832       for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){}
   833    833       if( !horiz ){
   834         -      cgi_printf("<tr bgcolor=\"%.*s\"><td>%.*s</td></tr>\n",
          834  +      cgi_printf("<tr style=\"background-color: %.*s;\"><td>%.*s</td></tr>\n",
   835    835           i, zSafeKey, k-j, &zSafeKey[j]);
   836    836       }else{
   837         -      cgi_printf("<td bgcolor=\"%.*s\">%.*s</td>\n",
          837  +      cgi_printf("<td style=\"background-color: %.*s;\">%.*s</td>\n",
   838    838           i, zSafeKey, k-j, &zSafeKey[j]);
   839    839       }
   840    840       zSafeKey += k;
   841    841     }
   842    842     free(zToFree);
   843    843     if( horiz ){
   844    844       @ </tr>
................................................................................
   905    905   
   906    906     count = 0;
   907    907     if( !tabs ){
   908    908       struct GenerateHTML sState;
   909    909   
   910    910       db_multi_exec("PRAGMA empty_result_callbacks=ON");
   911    911       style_submenu_element("Raw", "Raw", 
   912         -      "rptview?tablist=1&%s", PD("QUERY_STRING",""));
          912  +      "rptview?tablist=1&amp;%s", PD("QUERY_STRING",""));
   913    913       if( g.okAdmin 
   914    914          || (g.okTktFmt && g.zLogin && zOwner && strcmp(g.zLogin,zOwner)==0) ){
   915    915         style_submenu_element("Edit", "Edit", "rptedit?rn=%d", rn);
   916    916       }
   917    917       if( g.okTktFmt ){
   918    918         style_submenu_element("SQL", "SQL", "rptsql?rn=%d",rn);
   919    919       }
   920    920       if( g.okNewTkt ){
   921    921         style_submenu_element("New Ticket", "Create a new ticket",
   922    922           "%s/tktnew", g.zTop);
   923    923       }
   924    924       style_header(zTitle);
   925    925       output_color_key(zClrKey, 1, 
   926         -        "border=0 cellpadding=3 cellspacing=0 class=\"report\"");
   927         -    @ <table border=1 cellpadding=2 cellspacing=0 class="report">
          926  +        "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" class=\"report\"");
          927  +    @ <table border="1" cellpadding="2" cellspacing="0" class="report">
   928    928       sState.rn = rn;
   929    929       sState.nCount = 0;
   930    930       sqlite3_set_authorizer(g.db, report_query_authorizer, (void*)&zErr1);
   931    931       sqlite3_exec(g.db, zSql, generate_html, &sState, &zErr2);
   932    932       sqlite3_set_authorizer(g.db, 0, 0);
   933    933       @ </table>
   934    934       if( zErr1 ){

Changes to src/setup.c.

    97     97     if( !g.okAdmin ){
    98     98       login_needed();
    99     99       return;
   100    100     }
   101    101   
   102    102     style_submenu_element("Add", "Add User", "setup_uedit");
   103    103     style_header("User List");
   104         -  @ <table border="0" cellpadding="0" cellspacing="25">
   105         -  @ <tr><td valign="top">
   106         -  @ <b>Users:</b>
   107         -  @ <table border="1" cellpadding="10"><tr><td>
   108         -  @ <table cellspacing=0 cellpadding=0 border=0>
          104  +  @ <table class="usetupLayoutTable">
          105  +  @ <tr><td class="usetupColumnLayout">
          106  +  @ <span class="note">Users:</span>
          107  +  @ <table class="usetupUserList">
   109    108     @ <tr>
   110         -  @   <th align="right">User&nbsp;ID</th><td width="20">&nbsp;</td>
   111         -  @   <th>Capabilities</th><td width="15">&nbsp;</td>
   112         -  @   <th>Contact&nbsp;Info</th>
          109  +  @   <th class="usetupListUser" style="text-align: right;padding-right: 20px;">User&nbsp;ID</th>
          110  +  @   <th class="usetupListCap" style="text-align: center;padding-right: 15px;">Capabilities</th>
          111  +  @   <th class="usetupListCon"  style="text-align: left;">Contact&nbsp;Info</th>
   113    112     @ </tr>
   114    113     db_prepare(&s, "SELECT uid, login, cap, info FROM user ORDER BY login");
   115    114     while( db_step(&s)==SQLITE_ROW ){
   116    115       const char *zCap = db_column_text(&s, 2);
   117    116       if( strstr(zCap, "s") ) zCap = "s";
   118    117       @ <tr>
   119         -    @ <td align="right">
          118  +    @ <td class="usetupListUser" style="text-align: right;padding-right: 20px;white-space:nowrap;">
   120    119       if( g.okAdmin && (zCap[0]!='s' || g.okSetup) ){
   121    120         @ <a href="setup_uedit?id=%d(db_column_int(&s,0))">
   122    121       }
   123         -    @ <nobr>%h(db_column_text(&s,1))</nobr>
          122  +    @ %h(db_column_text(&s,1))
   124    123       if( g.okAdmin ){
   125    124         @ </a>
   126    125       }
   127         -    @ </td><td>&nbsp;&nbsp;&nbsp;</td>
   128         -    @ <td align="center">%s(zCap)</td>
   129         -    @ <td>&nbsp;&nbsp;&nbsp;</td>
   130         -    @ <td align="left">%s(db_column_text(&s,3))</td>
          126  +    @ </td>
          127  +    @ <td class="usetupListCap" style="text-align: center;padding-right: 15px;">%s(zCap)</td>
          128  +    @ <td  class="usetupListCon"  style="text-align: left;">%s(db_column_text(&s,3))</td>
   131    129       @ </tr>
   132    130     }
   133         -  @ </table></td></tr></table>
   134         -  @ <td valign="top">
   135         -  @ <b>Notes:</b>
          131  +  @ </table>
          132  +  @ </td><td class="usetupColumnLayout">
          133  +  @ <span class="note">Notes:</span>
   136    134     @ <ol>
   137    135     @ <li><p>The permission flags are as follows:</p>
   138    136     @ <table>
   139    137        @ <tr><td valign="top"><b>a</b></td>
   140    138        @   <td><i>Admin:</i> Create and delete users</td></tr>
   141    139        @ <tr><td valign="top"><b>b</b></td>
   142    140        @   <td><i>Attach:</i> Add attachments to wiki or tickets</td></tr>
................................................................................
   179    177        @ <tr><td valign="top"><b>v</b></td>
   180    178        @   <td><i>Developer:</i> Inherit privileges of
   181    179        @   user <tt>developer</tt></td></tr>
   182    180        @ <tr><td valign="top"><b>w</b></td>
   183    181        @   <td><i>Write-Tkt:</i> Edit tickets</td></tr>
   184    182        @ <tr><td valign="top"><b>z</b></td>
   185    183        @   <td><i>Zip download:</i> Download a baseline via the
   186         -     @   <tt>/zip</tt> URL even without check<b>o</b>ut
   187         -     @    and <b>h</b>istory permissions</td></tr>
          184  +     @   <tt>/zip</tt> URL even without 
          185  +     @    check<span class="capability">o</span>ut
          186  +     @    and <span class="capability">h</span>istory permissions</td></tr>
   188    187     @ </table>
   189    188     @ </li>
   190    189     @
   191    190     @ <li><p>
   192         -  @ Every user, logged in or not, inherits the privileges of <b>nobody</b>.
          191  +  @ Every user, logged in or not, inherits the privileges of
          192  +  @ <span class="usertype">nobody</span>.
   193    193     @ </p></li>
   194    194     @
   195    195     @ <li><p>
   196         -  @ Any human can login as <b>anonymous</b> since the password is
   197         -  @ clearly displayed on the login page for them to type.  The purpose
   198         -  @ of requiring anonymous to log in is to prevent access by spiders.
          196  +  @ Any human can login as <span class="usertype">anonymous</span> since the
          197  +  @ password is clearly displayed on the login page for them to type. The
          198  +  @ purpose of requiring anonymous to log in is to prevent access by spiders.
   199    199     @ Every logged-in user inherits the combined privileges of
   200         -  @ <b>anonymous</b> and
   201         -  @ <b>nobody</b>.
          200  +  @ <span class="usertype">anonymous</span> and
          201  +  @ <span class="usertype">nobody</span>.
   202    202     @ </p></li>
   203    203     @
   204    204     @ <li><p>
   205         -  @ Users with privilege <b>v</b> inherit the combined privileges of
   206         -  @ <b>developer</b>, <b>anonymous</b>, and <b>nobody</b>.
          205  +  @ Users with privilege <span class="capability">v</span> inherit the combined
          206  +  @ privileges of <span class="usertype">developer</span>,
          207  +  @ <span class="usertype">anonymous</span>, and
          208  +  @ <span class="usertype">nobody</span>.
   207    209     @ </p></li>
   208    210     @
   209    211     @ </ol>
   210    212     @ </td></tr></table>
   211    213     style_footer();
   212    214   }
   213    215   
................................................................................
   321    323       }else{
   322    324         zPw = db_text(0, "SELECT pw FROM user WHERE uid=%d", uid);
   323    325       }
   324    326       if( uid>0 &&
   325    327           db_exists("SELECT 1 FROM user WHERE login=%Q AND uid!=%d", zLogin, uid)
   326    328       ){
   327    329         style_header("User Creation Error");
   328         -      @ <font color="red">Login "%h(zLogin)" is already used by a different
   329         -      @ user.</font>
          330  +      @ <span class="loginError">Login "%h(zLogin)" is already used by
          331  +      @ a different user.</span>
   330    332         @
   331    333         @ <p><a href="setup_uedit?id=%d(uid)">[Bummer]</a></p>
   332    334         style_footer();
   333    335         return;
   334    336       }
   335    337       login_verify_csrf_secret();
   336    338       db_multi_exec(
................................................................................
   351    353     oaa = oab = oac = oad = oae = oaf = oag = oah = oai = oaj = oak = oam =
   352    354           oan = oao = oap = oar = oas = oat = oau = oav = oaw = oaz = "";
   353    355     if( uid ){
   354    356       zLogin = db_text("", "SELECT login FROM user WHERE uid=%d", uid);
   355    357       zInfo = db_text("", "SELECT info FROM user WHERE uid=%d", uid);
   356    358       zCap = db_text("", "SELECT cap FROM user WHERE uid=%d", uid);
   357    359       zPw = db_text("", "SELECT pw FROM user WHERE uid=%d", uid);
   358         -    if( strchr(zCap, 'a') ) oaa = " checked";
   359         -    if( strchr(zCap, 'b') ) oab = " checked";
   360         -    if( strchr(zCap, 'c') ) oac = " checked";
   361         -    if( strchr(zCap, 'd') ) oad = " checked";
   362         -    if( strchr(zCap, 'e') ) oae = " checked";
   363         -    if( strchr(zCap, 'f') ) oaf = " checked";
   364         -    if( strchr(zCap, 'g') ) oag = " checked";
   365         -    if( strchr(zCap, 'h') ) oah = " checked";
   366         -    if( strchr(zCap, 'i') ) oai = " checked";
   367         -    if( strchr(zCap, 'j') ) oaj = " checked";
   368         -    if( strchr(zCap, 'k') ) oak = " checked";
   369         -    if( strchr(zCap, 'm') ) oam = " checked";
   370         -    if( strchr(zCap, 'n') ) oan = " checked";
   371         -    if( strchr(zCap, 'o') ) oao = " checked";
   372         -    if( strchr(zCap, 'p') ) oap = " checked";
   373         -    if( strchr(zCap, 'r') ) oar = " checked";
   374         -    if( strchr(zCap, 's') ) oas = " checked";
   375         -    if( strchr(zCap, 't') ) oat = " checked";
   376         -    if( strchr(zCap, 'u') ) oau = " checked";
   377         -    if( strchr(zCap, 'v') ) oav = " checked";
   378         -    if( strchr(zCap, 'w') ) oaw = " checked";
   379         -    if( strchr(zCap, 'z') ) oaz = " checked";
          360  +    if( strchr(zCap, 'a') ) oaa = " checked=\"checked\"";
          361  +    if( strchr(zCap, 'b') ) oab = " checked=\"checked\"";
          362  +    if( strchr(zCap, 'c') ) oac = " checked=\"checked\"";
          363  +    if( strchr(zCap, 'd') ) oad = " checked=\"checked\"";
          364  +    if( strchr(zCap, 'e') ) oae = " checked=\"checked\"";
          365  +    if( strchr(zCap, 'f') ) oaf = " checked=\"checked\"";
          366  +    if( strchr(zCap, 'g') ) oag = " checked=\"checked\"";
          367  +    if( strchr(zCap, 'h') ) oah = " checked=\"checked\"";
          368  +    if( strchr(zCap, 'i') ) oai = " checked=\"checked\"";
          369  +    if( strchr(zCap, 'j') ) oaj = " checked=\"checked\"";
          370  +    if( strchr(zCap, 'k') ) oak = " checked=\"checked\"";
          371  +    if( strchr(zCap, 'm') ) oam = " checked=\"checked\"";
          372  +    if( strchr(zCap, 'n') ) oan = " checked=\"checked\"";
          373  +    if( strchr(zCap, 'o') ) oao = " checked=\"checked\"";
          374  +    if( strchr(zCap, 'p') ) oap = " checked=\"checked\"";
          375  +    if( strchr(zCap, 'r') ) oar = " checked=\"checked\"";
          376  +    if( strchr(zCap, 's') ) oas = " checked=\"checked\"";
          377  +    if( strchr(zCap, 't') ) oat = " checked=\"checked\"";
          378  +    if( strchr(zCap, 'u') ) oau = " checked=\"checked\"";
          379  +    if( strchr(zCap, 'v') ) oav = " checked=\"checked\"";
          380  +    if( strchr(zCap, 'w') ) oaw = " checked=\"checked\"";
          381  +    if( strchr(zCap, 'z') ) oaz = " checked=\"checked\"";
   380    382     }
   381    383   
   382    384     /* figure out inherited permissions */
   383    385     memset(inherit, 0, sizeof(inherit));
   384    386     if( strcmp(zLogin, "developer") ){
   385    387       char *z1, *z2;
   386    388       z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='developer'");
   387    389       while( z1 && *z1 ){
   388         -      inherit[0x7f & *(z1++)] = "<font color=\"red\">&bull;</font>";
          390  +      inherit[0x7f & *(z1++)] =
          391  +         "<span class=\"ueditInheritDeveloper\">&bull;</span>";
   389    392       }
   390    393       free(z2);
   391    394     }
   392    395     if( strcmp(zLogin, "reader") ){
   393    396       char *z1, *z2;
   394    397       z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='reader'");
   395    398       while( z1 && *z1 ){
   396         -      inherit[0x7f & *(z1++)] = "<font color=\"black\">&bull;</font>";
          399  +      inherit[0x7f & *(z1++)] =
          400  +          "<span class=\"ueditInheritReader\">&bull;</span>";
   397    401       }
   398    402       free(z2);
   399    403     }
   400    404     if( strcmp(zLogin, "anonymous") ){
   401    405       char *z1, *z2;
   402    406       z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='anonymous'");
   403    407       while( z1 && *z1 ){
   404         -      inherit[0x7f & *(z1++)] = "<font color=\"blue\">&bull;</font>";
          408  +      inherit[0x7f & *(z1++)] =
          409  +           "<span class=\"ueditInheritAnonymous\">&bull;</span>";
   405    410       }
   406    411       free(z2);
   407    412     }
   408    413     if( strcmp(zLogin, "nobody") ){
   409    414       char *z1, *z2;
   410    415       z1 = z2 = db_text(0,"SELECT cap FROM user WHERE login='nobody'");
   411    416       while( z1 && *z1 ){
   412         -      inherit[0x7f & *(z1++)] = "<font color=\"green\">&bull;</font>";
          417  +      inherit[0x7f & *(z1++)] =
          418  +           "<span class=\"ueditInheritNobody\">&bull;</span>";
   413    419       }
   414    420       free(z2);
   415    421     }
   416    422   
   417    423     /* Begin generating the page
   418    424     */
   419    425     style_submenu_element("Cancel", "Cancel", "setup_ulist");
   420    426     if( uid ){
   421    427       style_header(mprintf("Edit User %h", zLogin));
   422    428     }else{
   423    429       style_header("Add A New User");
   424    430     }
   425         -  @ <table align="left" hspace="20" vspace="10"><tr><td>
   426         -  @ <form action="%s(g.zPath)" method="POST">
          431  +  @ <div class="ueditCapBox">
          432  +  @ <form action="%s(g.zPath)" method="post"><div>
   427    433     login_insert_csrf_secret();
   428    434     @ <table>
   429    435     @ <tr>
   430         -  @   <td align="right"><nobr>User ID:</nobr></td>
          436  +  @   <td class="usetupEditLabel">User ID:</td>
   431    437     if( uid ){
   432         -    @   <td>%d(uid) <input type="hidden" name="id" value="%d(uid)"></td>
          438  +    @   <td>%d(uid) <input type="hidden" name="id" value="%d(uid)" /></td>
   433    439     }else{
   434         -    @   <td>(new user)<input type="hidden" name="id" value=0></td>
          440  +    @   <td>(new user)<input type="hidden" name="id" value="0" /></td>
   435    441     }
   436    442     @ </tr>
          443  +  @ <tr>
          444  +  @   <td class="usetupEditLabel">Login:</td>
          445  +  @   <td><input type="text" name="login" value="%h(zLogin)" /></td>
          446  +  @ </tr>
   437    447     @ <tr>
   438         -  @   <td align="right"><nobr>Login:</nobr></td>
   439         -  @   <td><input type="text" name="login" value="%h(zLogin)"></td>
          448  +  @   <td class="usetupEditLabel">Contact&nbsp;Info:</td>
          449  +  @   <td><input type="text" name="info" size="40" value="%h(zInfo)" /></td>
   440    450     @ </tr>
   441    451     @ <tr>
   442         -  @   <td align="right"><nobr>Contact&nbsp;Info:</nobr></td>
   443         -  @   <td><input type="text" name="info" size=40 value="%h(zInfo)"></td>
   444         -  @ </tr>
   445         -  @ <tr>
   446         -  @   <td align="right" valign="top">Capabilities:</td>
          452  +  @   <td class="usetupEditLabel">Capabilities:</td>
   447    453     @   <td>
   448    454   #define B(x) inherit[x]
   449    455     if( g.okSetup ){
   450         -    @    <input type="checkbox" name="as"%s(oas)/>%s(B('s'))Setup<br>
   451         -  }
   452         -  @    <input type="checkbox" name="aa"%s(oaa)/>%s(B('a'))Admin<br>
   453         -  @    <input type="checkbox" name="ad"%s(oad)/>%s(B('d'))Delete<br>
   454         -  @    <input type="checkbox" name="ae"%s(oae)/>%s(B('e'))Email<br>
   455         -  @    <input type="checkbox" name="ap"%s(oap)/>%s(B('p'))Password<br>
   456         -  @    <input type="checkbox" name="ai"%s(oai)/>%s(B('i'))Check-In<br>
   457         -  @    <input type="checkbox" name="ao"%s(oao)/>%s(B('o'))Check-Out<br>
   458         -  @    <input type="checkbox" name="ah"%s(oah)/>%s(B('h'))History<br>
   459         -  @    <input type="checkbox" name="au"%s(oau)/>%s(B('u'))Reader<br>
   460         -  @    <input type="checkbox" name="av"%s(oav)/>%s(B('v'))Developer<br>
   461         -  @    <input type="checkbox" name="ag"%s(oag)/>%s(B('g'))Clone<br>
   462         -  @    <input type="checkbox" name="aj"%s(oaj)/>%s(B('j'))Read Wiki<br>
   463         -  @    <input type="checkbox" name="af"%s(oaf)/>%s(B('f'))New Wiki<br>
   464         -  @    <input type="checkbox" name="am"%s(oam)/>%s(B('m'))Append Wiki<br>
   465         -  @    <input type="checkbox" name="ak"%s(oak)/>%s(B('k'))Write Wiki<br>
   466         -  @    <input type="checkbox" name="ab"%s(oab)/>%s(B('b'))Attachments<br>
   467         -  @    <input type="checkbox" name="ar"%s(oar)/>%s(B('r'))Read Ticket<br>
   468         -  @    <input type="checkbox" name="an"%s(oan)/>%s(B('n'))New Ticket<br>
   469         -  @    <input type="checkbox" name="ac"%s(oac)/>%s(B('c'))Append Ticket<br>
   470         -  @    <input type="checkbox" name="aw"%s(oaw)/>%s(B('w'))Write Ticket<br>
   471         -  @    <input type="checkbox" name="at"%s(oat)/>%s(B('t'))Ticket Report<br>
   472         -  @    <input type="checkbox" name="az"%s(oaz)/>%s(B('z'))Download Zip
          456  +    @    <input type="checkbox" name="as"%s(oas) />%s(B('s'))Setup<br />
          457  +  }
          458  +  @    <input type="checkbox" name="aa"%s(oaa) />%s(B('a'))Admin<br />
          459  +  @    <input type="checkbox" name="ad"%s(oad) />%s(B('d'))Delete<br />
          460  +  @    <input type="checkbox" name="ae"%s(oae) />%s(B('e'))Email<br />
          461  +  @    <input type="checkbox" name="ap"%s(oap) />%s(B('p'))Password<br />
          462  +  @    <input type="checkbox" name="ai"%s(oai) />%s(B('i'))Check-In<br />
          463  +  @    <input type="checkbox" name="ao"%s(oao) />%s(B('o'))Check-Out<br />
          464  +  @    <input type="checkbox" name="ah"%s(oah) />%s(B('h'))History<br />
          465  +  @    <input type="checkbox" name="au"%s(oau) />%s(B('u'))Reader<br />
          466  +  @    <input type="checkbox" name="av"%s(oav) />%s(B('v'))Developer<br />
          467  +  @    <input type="checkbox" name="ag"%s(oag) />%s(B('g'))Clone<br />
          468  +  @    <input type="checkbox" name="aj"%s(oaj) />%s(B('j'))Read Wiki<br />
          469  +  @    <input type="checkbox" name="af"%s(oaf) />%s(B('f'))New Wiki<br />
          470  +  @    <input type="checkbox" name="am"%s(oam) />%s(B('m'))Append Wiki<br />
          471  +  @    <input type="checkbox" name="ak"%s(oak) />%s(B('k'))Write Wiki<br />
          472  +  @    <input type="checkbox" name="ab"%s(oab) />%s(B('b'))Attachments<br />
          473  +  @    <input type="checkbox" name="ar"%s(oar) />%s(B('r'))Read Ticket<br />
          474  +  @    <input type="checkbox" name="an"%s(oan) />%s(B('n'))New Ticket<br />
          475  +  @    <input type="checkbox" name="ac"%s(oac) />%s(B('c'))Append Ticket<br />
          476  +  @    <input type="checkbox" name="aw"%s(oaw) />%s(B('w'))Write Ticket<br />
          477  +  @    <input type="checkbox" name="at"%s(oat) />%s(B('t'))Ticket Report<br />
          478  +  @    <input type="checkbox" name="az"%s(oaz) />%s(B('z'))Download Zip
   473    479     @   </td>
   474    480     @ </tr>
   475    481     @ <tr>
   476    482     @   <td align="right">Password:</td>
   477    483     if( zPw[0] ){
   478    484       /* Obscure the password for all users */
   479         -    @   <td><input type="password" name="pw" value="**********"></td>
          485  +    @   <td><input type="password" name="pw" value="**********" /></td>
   480    486     }else{
   481    487       /* Show an empty password as an empty input field */
   482         -    @   <td><input type="password" name="pw" value=""></td>
          488  +    @   <td><input type="password" name="pw" value="" /></td>
   483    489     }
   484    490     @ </tr>
   485    491     if( !higherUser ){
   486    492       @ <tr>
   487         -    @   <td>&nbsp</td>
   488         -    @   <td><input type="submit" name="submit" value="Apply Changes">
          493  +    @   <td>&nbsp;</td>
          494  +    @   <td><input type="submit" name="submit" value="Apply Changes" /></td>
   489    495       @ </tr>
   490    496     }
   491         -  @ </table></td></tr></table>
          497  +  @ </table>
          498  +  @ </div></form>
          499  +  @ </div>
   492    500     @ <h2>Privileges And Capabilities:</h2>
   493    501     @ <ul>
   494    502     if( higherUser ){
   495    503       @ <li><p><font color="blue"><b>
   496    504       @ User %h(zLogin) has Setup privileges and you only have Admin privileges
   497    505       @ so you are not permitted to make changes to %h(zLogin).
   498    506       @ </b></font></p></li>
   499    507       @
   500    508     }
   501    509     @ <li><p>
   502         -  @ The <b>Setup</b> user can make arbitrary configuration changes.
   503         -  @ An <b>Admin</b> user can add other users and change user privileges
          510  +  @ The <span class="capability">Setup</span> user can make arbitrary
          511  +  @ configuration changes. An <span class="usertype">Admin</span> user
          512  +  @ can add other users and change user privileges
   504    513     @ and reset user passwords.  Both automatically get all other privileges
   505    514     @ listed below.  Use these two settings with discretion.
   506    515     @ </p></li>
   507    516     @
   508    517     @ <li><p>
   509         -  @ The "<font color="green"><big>&bull;</big></font>" mark indicates
   510         -  @ the privileges of "nobody" that are available to all users
   511         -  @ regardless of whether or not they are logged in.
          518  +  @ The "<span class="ueditInheritNobody"><big>&bull;</big></span>" mark
          519  +  @ indicates the privileges of <span class="usertype">nobody</span> that
          520  +  @ are available to all users regardless of whether or not they are logged in.
          521  +  @ </p></li>
          522  +  @
          523  +  @ <li><p>
          524  +  @ The "<span class="ueditInheritAnonymous"><big>&bull;</big></span>" mark
          525  +  @ indicates the privileges of <span class="usertype">anonymous</span> that
          526  +  @ are inherited by all logged-in users.
          527  +  @ </p></li>
          528  +  @
          529  +  @ <li><p>
          530  +  @ The "<span class="ueditInheritDeveloper"><big>&bull;</big></span>" mark
          531  +  @ indicates the privileges of <span class="usertype">developer</span> that
          532  +  @ are inherited by all users with the
          533  +  @ <span class="capability">Developer</span> privilege.
          534  +  @ </p></li>
          535  +  @
          536  +  @ <li><p>
          537  +  @ The "<span class="ueditInheritReader"><big>&bull;</big></span>" mark
          538  +  @ indicates the privileges of <span class="usertype">reader</span> that
          539  +  @ are inherited by all users with the <span class="capability">Reader</span>
          540  +  @ privilege.
          541  +  @ </p></li>
          542  +  @
          543  +  @ <li><p>
          544  +  @ The <span class="capability">Delete</span> privilege give the user the
          545  +  @ ability to erase wiki, tickets, and attachments that have been added
          546  +  @ by anonymous users.  This capability is intended for deletion of spam. 
          547  +  @ The delete capability is only in effect for 24 hours after the item
          548  +  @ is first posted.  The <span class="usertype">Setup</span> user can
          549  +  @ delete anything at any time.
          550  +  @ </p></li>
          551  +  @
          552  +  @ <li><p>
          553  +  @ The <span class="capability">History</span> privilege allows a user
          554  +  @ to see most hyperlinks. This is recommended ON for most logged-in users
          555  +  @ but OFF for user "nobody" to avoid problems with spiders trying to walk
          556  +  @ every historical version of every baseline and file.
          557  +  @ </p></li>
          558  +  @
          559  +  @ <li><p>
          560  +  @ The <span class="capability">Zip</span> privilege allows a user to
          561  +  @ see the "download as ZIP"
          562  +  @ hyperlink and permits access to the <tt>/zip</tt> page.  This allows
          563  +  @ users to download ZIP archives without granting other rights like
          564  +  @ <span class="capability">Read</span> or
          565  +  @ <span class="capability">History</span>.  This privilege is recommended for
          566  +  @ user <span class="usertype">nobody</span> so that automatic package
          567  +  @ downloaders can obtain the sources without going through the login
          568  +  @ procedure.
   512    569     @ </p></li>
   513    570     @
   514    571     @ <li><p>
   515         -  @ The "<font color="blue"><big>&bull;</big></font>" mark indicates
   516         -  @ the privileges of "anonymous" that are inherited by all logged-in users.
          572  +  @ The <span class="capability">Check-in</span> privilege allows remote
          573  +  @ users to "push". The <span class="capability">Check-out</span> privilege
          574  +  @ allows remote users to "pull". The <span class="capability">Clone</span>
          575  +  @ privilege allows remote users to "clone".
   517    576     @ </p></li>
   518    577     @
   519    578     @ <li><p>
   520         -  @ The "<font color="red"><big>&bull;</big></font>" mark indicates
   521         -  @ the privileges of "developer" that are inherited by all users with
   522         -  @ the <b>Developer</b> privilege.
          579  +  @ The <span class="capability">Read Wiki</span>,
          580  +  @ <span class="capability">New Wiki</span>,
          581  +  @ <span class="capability">Append Wiki</span>, and
          582  +  @ <b>Write Wiki</b> privileges control access to wiki pages.  The
          583  +  @ <span class="capability">Read Ticket</span>,
          584  +  @ <span class="capability">New Ticket</span>,
          585  +  @ <span class="capability">Append Ticket</span>, and
          586  +  @ <span class="capability">Write Ticket</span> privileges control access
          587  +  @ to trouble tickets.
          588  +  @ The <span class="capability">Ticket Report</span> privilege allows
          589  +  @ the user to create or edit ticket report formats.
   523    590     @ </p></li>
   524    591     @
   525    592     @ <li><p>
   526         -  @ The "<font color="black"><big>&bull;</big></font>" mark indicates
   527         -  @ the privileges of "reader" that are inherited by all users with
   528         -  @ the <b>Reader</b> privilege.
   529         -  @ </p></li>
   530         -  @
   531         -  @ <li><p>
   532         -  @ The <b>Delete</b> privilege give the user the ability to erase
   533         -  @ wiki, tickets, and attachments that have been added by anonymous
   534         -  @ users.  This capability is intended for deletion of spam.  The
   535         -  @ delete capability is only in effect for 24 hours after the item
   536         -  @ is first posted.  The Setup user can delete anything at any time.
          593  +  @ Users with the <span class="capability">Password</span> privilege
          594  +  @ are allowed to change their own password.  Recommended ON for most
          595  +  @ users but OFF for special users <span class="usertype">developer</span>,
          596  +  @ <span class="usertype">anonymous</span>,
          597  +  @ and <span class="usertype">nobody</span>.
   537    598     @ </p></li>
   538    599     @
   539    600     @ <li><p>
   540         -  @ The <b>History</b> privilege allows a user to see most hyperlinks.
   541         -  @ This is recommended ON for most logged-in users but OFF for
   542         -  @ user "nobody" to avoid problems with spiders trying to walk every
   543         -  @ historical version of every baseline and file.
   544         -  @ </p></li>
   545         -  @
   546         -  @ <li><p>
   547         -  @ The <b>Zip</b> privilege allows a user to see the "download as ZIP"
   548         -  @ hyperlink and permits access to the <tt>/zip</tt> page.  This allows
   549         -  @ users to download ZIP archives without granting other rights like
   550         -  @ <b>Read</b> or <b>History</b>.  This privilege is recommended for
   551         -  @ user <b>nobody</b> so that automatic package downloaders can obtain
   552         -  @ the sources without going through the login procedure.
          601  +  @ The <span class="capability">EMail</span> privilege allows the display of
          602  +  @ sensitive information such as the email address of users and contact
          603  +  @ information on tickets. Recommended OFF for 
          604  +  @ <span class="usertype">anonymousy</span> and for
          605  +  @ <span class="usertype">nobody</span> but ON for
          606  +  @ <span class="usertype">developer</span>.
   553    607     @ </p></li>
   554    608     @
   555    609     @ <li><p>
   556         -  @ The <b>Check-in</b> privilege allows remote users to "push".
   557         -  @ The <b>Check-out</b> privilege allows remote users to "pull".
   558         -  @ The <b>Clone</b> privilege allows remote users to "clone".
   559         -  @ </li><p>
   560         -  @
   561         -  @ <li><p>
   562         -  @ The <b>Read Wiki</b>, <b>New Wiki</b>, <b>Append Wiki</b>, and
   563         -  @ <b>Write Wiki</b> privileges control access to wiki pages.  The
   564         -  @ <b>Read Ticket</b>, <b>New Ticket</b>, <b>Append Ticket</b>, and
   565         -  @ <b>Write Ticket</b> privileges control access to trouble tickets.
   566         -  @ The <b>Ticket Report</b> privilege allows the user to create or edit
   567         -  @ ticket report formats.
          610  +  @ The <span class="capability">Attachment</span> privilege is needed in
          611  +  @ order to add attachments to tickets or wiki.  Write privilege on the
          612  +  @ ticket or wiki is also required.
   568    613     @ </p></li>
   569    614     @
   570         -  @ <li><p>
   571         -  @ Users with the <b>Password</b> privilege are allowed to change their
   572         -  @ own password.  Recommended ON for most users but OFF for special
   573         -  @ users "developer", "anonymous", and "nobody".
   574         -  @ </p></li>
   575         -  @
   576         -  @ <li><p>
   577         -  @ The <b>EMail</b> privilege allows the display of sensitive information
   578         -  @ such as the email address of users and contact information on tickets.
   579         -  @ Recommended OFF for "anonymous" and for "nobody" but ON for
   580         -  @ "developer".
   581         -  @ </p></li>
   582         -  @
   583         -  @ <li><p>
   584         -  @ The <b>Attachment</b> privilege is needed in order to add attachments
   585         -  @ to tickets or wiki.  Write privilege on the ticket or wiki is also
   586         -  @ required.</p></li>
   587         -  @
   588    615     @ <li><p>
   589    616     @ Login is prohibited if the password is an empty string.
   590    617     @ </p></li>
   591    618     @ </ul>
   592    619     @
   593    620     @ <h2>Special Logins</h2>
   594    621     @
   595    622     @ <ul>
   596    623     @ <li><p>
   597         -  @ No login is required for user "<b>nobody</b>".  The capabilities
   598         -  @ of the <b>nobody</b> user are inherited by all users, regardless of
   599         -  @ whether or not they are logged in.  To disable universal access
   600         -  @ to the repository, make sure no user named "<b>nobody</b>" exists or
   601         -  @ that the <b>nobody</b> user has no capabilities enabled.
   602         -  @ The password for <b>nobody</b> is ignore.  To avoid problems with
   603         -  @ spiders overloading the server, it is recommended
   604         -  @ that the 'h' (History) capability be turned off for the <b>nobody</b>
   605         -  @ user.
          624  +  @ No login is required for user <span class="usertype">nobody</span>. The
          625  +  @ capabilities of the <span class="usertype">nobody</span> user are
          626  +  @ inherited by all users, regardless of whether or not they are logged in.
          627  +  @ To disable universal access to the repository, make sure no user named 
          628  +  @ <span class="usertype">nobody</span> exists or that the
          629  +  @ <span class="usertype">nobody</span> user has no capabilities
          630  +  @ enabled. The password for <span class="usertype">nobody</span> is ignore.
          631  +  @ To avoid problems with spiders overloading the server, it is recommended
          632  +  @ that the <span class="capability">h</span> (History) capability be turned 
          633  +  @ off for the <span class="usertype">nobody</span> user.
   606    634     @ </p></li>
   607    635     @
   608    636     @ <li><p>
   609         -  @ Login is required for user "<b>anonymous</b>" but the password
   610         -  @ is displayed on the login screen beside the password entry box
          637  +  @ Login is required for user <span class="usertype">anonymous</span> but the
          638  +  @ password is displayed on the login screen beside the password entry box
   611    639     @ so anybody who can read should be able to login as anonymous.
   612    640     @ On the other hand, spiders and web-crawlers will typically not
   613         -  @ be able to login.  Set the capabilities of the anonymous user
   614         -  @ to things that you want any human to be able to do, but not any
          641  +  @ be able to login.  Set the capabilities of the
          642  +  @ <span class="usertype">anonymous</span>
          643  +  @ user to things that you want any human to be able to do, but not any
   615    644     @ spider.  Every other logged-in user inherits the privileges of
   616         -  @ <b>anonymous</b>.
          645  +  @ <span class="usertype">anonymous</span>.
   617    646     @ </p></li>
   618    647     @
   619    648     @ <li><p>
   620         -  @ The "<b>developer</b>" user is intended as a template for trusted users
   621         -  @ with check-in privileges.  When adding new trusted users, simply
   622         -  @ select the <b>Developer</b> privilege to cause the new user to inherit
   623         -  @ all privileges of the "developer" user.  Similarly, the "<b>reader</b>"
   624         -  @ user is a template for users who are allowed more access than anonymous,
   625         -  @ but less than a developer.
          649  +  @ The <span class="usertype">developer</span> user is intended as a template
          650  +  @ for trusted users with check-in privileges. When adding new trusted users,
          651  +  @ simply select the <span class="capability">developer</span> privilege to
          652  +  @ cause the new user to inherit all privileges of the 
          653  +  @ <span class="usertype">developer</span>
          654  +  @ user.  Similarly, the <span class="usertype">reader</span> user is a 
          655  +  @ template for users who are allowed more access than
          656  +  @ <span class="usertype">anonymous</span>,
          657  +  @ but less than a <span class="usertype">developer</span>.
   626    658     @ </p></li>
   627    659     @ </ul>
   628         -  @ </form>
   629    660     style_footer();
   630    661   }
   631    662   
   632    663   
   633    664   /*
   634    665   ** Generate a checkbox for an attribute.
   635    666   */
................................................................................
   649    680       if( iQ!=iVal ){
   650    681         login_verify_csrf_secret();
   651    682         db_set(zVar, iQ ? "1" : "0", 0);
   652    683         iVal = iQ;
   653    684       }
   654    685     }
   655    686     if( iVal ){
   656         -    @ <input type="checkbox" name="%s(zQParm)" checked><b>%s(zLabel)</b></input>
          687  +    @ <input type="checkbox" name="%s(zQParm)" checked="checked" />
          688  +    @ <b>%s(zLabel)</b>
   657    689     }else{
   658         -    @ <input type="checkbox" name="%s(zQParm)"><b>%s(zLabel)</b></input>
          690  +    @ <input type="checkbox" name="%s(zQParm)" /><b>%s(zLabel)</b>
   659    691     }
   660    692   }
   661    693   
   662    694   /*
   663    695   ** Generate an entry box for an attribute.
   664    696   */
   665    697   void entry_attribute(
................................................................................
   672    704     const char *zVal = db_get(zVar, zDflt);
   673    705     const char *zQ = P(zQParm);
   674    706     if( zQ && strcmp(zQ,zVal)!=0 ){
   675    707       login_verify_csrf_secret();
   676    708       db_set(zVar, zQ, 0);
   677    709       zVal = zQ;
   678    710     }
   679         -  @ <input type="text" name="%s(zQParm)" value="%h(zVal)" size="%d(width)">
          711  +  @ <input type="text" name="%s(zQParm)" value="%h(zVal)" size="%d(width)" />
   680    712     @ <b>%s(zLabel)</b>
   681    713   }
   682    714   
   683    715   /*
   684    716   ** Generate a text box for an attribute.
   685    717   */
   686    718   static void textarea_attribute(
................................................................................
   696    728     if( zQ && strcmp(zQ,z)!=0 ){
   697    729       login_verify_csrf_secret();
   698    730       db_set(zVar, zQ, 0);
   699    731       z = zQ;
   700    732     }
   701    733     if( rows>0 && cols>0 ){
   702    734       @ <textarea name="%s(zQP)" rows="%d(rows)" cols="%d(cols)">%h(z)</textarea>
   703         -    @ <b>%s(zLabel)</b>
          735  +    if (zLabel && *zLabel)
          736  +      @ <span class="textareaLabel">%s(zLabel)</span>
   704    737     }
   705    738   }
   706    739   
   707    740   
   708    741   /*
   709    742   ** WEBPAGE: setup_access
   710    743   */
................................................................................
   712    745     login_check_credentials();
   713    746     if( !g.okSetup ){
   714    747       login_needed();
   715    748     }
   716    749   
   717    750     style_header("Access Control Settings");
   718    751     db_begin_transaction();
   719         -  @ <form action="%s(g.zBaseURL)/setup_access" method="POST">
          752  +  @ <form action="%s(g.zBaseURL)/setup_access" method="post"><div>
   720    753     login_insert_csrf_secret();
   721         -  @ <hr>
          754  +  @ <hr />
   722    755     onoff_attribute("Require password for local access",
   723    756        "localauth", "localauth", 0);
   724    757     @ <p>When enabled, the password sign-in is required for
   725    758     @ web access coming from 127.0.0.1.  When disabled, web access
   726    759     @ from 127.0.0.1 is allows without any login - the user id is selected
   727    760     @ from the ~/.fossil database. Password login is always required
   728    761     @ for incoming web connections on internet addresses other than
   729         -  @ 127.0.0.1.</p></li>
          762  +  @ 127.0.0.1.</p>
   730    763   
   731         -  @ <hr>
          764  +  @ <hr />
   732    765     onoff_attribute("Allow REMOTE_USER authentication",
   733    766        "remote_user_ok", "remote_user_ok", 0);
   734    767     @ <p>When enabled, if the REMOTE_USER environment variable is set to the
   735    768     @ login name of a valid user and no other login credentials are available,
   736    769     @ then the REMOTE_USER is accepted as an authenticated user.
   737         -  @ </p></li>
          770  +  @ </p>
   738    771   
   739         -  @ <hr>
          772  +  @ <hr />
   740    773     entry_attribute("Login expiration time", 6, "cookie-expire", "cex", "8766");
   741    774     @ <p>The number of hours for which a login is valid.  This must be a
   742    775     @ positive number.  The default is 8760 hours which is approximately equal
   743    776     @ to a year.</p>
   744    777   
   745         -  @ <hr>
          778  +  @ <hr />
   746    779     entry_attribute("Download packet limit", 10, "max-download", "mxdwn",
   747    780                     "5000000");
   748    781     @ <p>Fossil tries to limit out-bound sync, clone, and pull packets
   749    782     @ to this many bytes, uncompressed.  If the client requires more data
   750    783     @ than this, then the client will issue multiple HTTP requests.
   751    784     @ Values below 1 million are not recommended.  5 million is a
   752    785     @ reasonable number.</p>
   753    786   
   754         -  @ <hr>
          787  +  @ <hr />
   755    788     onoff_attribute("Show javascript button to fill in CAPTCHA",
   756    789                     "auto-captcha", "autocaptcha", 0);
   757    790     @ <p>When enabled, a button appears on the login screen for user
   758    791     @ "anonymous" that will automatically fill in the CAPTCHA password.
   759    792     @ This is less secure that forcing the user to do it manually, but is
   760    793     @ probably secure enough and it is certainly more convenient for
   761    794     @ anonymous users.</p>
   762    795   
   763         -  @ <hr>
   764         -  @ <p><input type="submit"  name="submit" value="Apply Changes"></p>
   765         -  @ </form>
          796  +  @ <hr />
          797  +  @ <p><input type="submit"  name="submit" value="Apply Changes" /></p>
          798  +  @ </div></form>
   766    799     db_end_transaction(0);
   767    800     style_footer();
   768    801   }
   769    802   
   770    803   /*
   771    804   ** WEBPAGE: setup_timeline
   772    805   */
................................................................................
   774    807     login_check_credentials();
   775    808     if( !g.okSetup ){
   776    809       login_needed();
   777    810     }
   778    811   
   779    812     style_header("Timeline Display Preferences");
   780    813     db_begin_transaction();
   781         -  @ <form action="%s(g.zBaseURL)/setup_timeline" method="POST">
          814  +  @ <form action="%s(g.zBaseURL)/setup_timeline" method="post"><div>
   782    815     login_insert_csrf_secret();
   783    816   
   784         -  @ <hr>
          817  +  @ <hr />
   785    818     onoff_attribute("Allow block-markup in timeline",
   786    819                     "timeline-block-markup", "tbm", 0);
   787    820     @ <p>In timeline displays, check-in comments can be displayed with or
   788    821     @ without block markup (paragraphs, tables, etc.)</p>
   789    822   
   790         -  @ <hr>
          823  +  @ <hr />
   791    824     onoff_attribute("Use Universal Coordinated Time (UTC)",
   792    825                     "timeline-utc", "utc", 1);
   793    826     @ <p>Show times as UTC (also sometimes called Greenwich Mean Time (GMT) or
   794    827     @ Zulu) instead of in local time.</p>
   795    828   
   796         -  @ <hr>
          829  +  @ <hr />
   797    830     onoff_attribute("Show version differences by default",
   798    831                     "show-version-diffs", "vdiff", 0);
   799    832     @ <p>On the version-information pages linked from the timeline can either
   800    833     @ show complete diffs of all file changes, or can just list the names of
   801    834     @ the files that have changed.  Users can get to either page by
   802    835     @ clicking.  This setting selects the default.</p>
   803    836   
   804         -  @ <hr>
          837  +  @ <hr />
   805    838     entry_attribute("Max timeline comment length", 6,
   806    839                     "timeline-max-comment", "tmc", "0");
   807    840     @ <p>The maximum length of a comment to be displayed in a timeline.
   808    841     @ "0" there is no length limit.</p>
   809    842   
   810         -  @ <hr>
   811         -  @ <p><input type="submit"  name="submit" value="Apply Changes"></p>
   812         -  @ </form>
          843  +  @ <hr />
          844  +  @ <p><input type="submit"  name="submit" value="Apply Changes" /></p>
          845  +  @ </div></form>
   813    846     db_end_transaction(0);
   814    847     style_footer();
   815    848   }
   816    849   
   817    850   /*
   818    851   ** WEBPAGE: setup_config
   819    852   */
................................................................................
   821    854     login_check_credentials();
   822    855     if( !g.okSetup ){
   823    856       login_needed();
   824    857     }
   825    858   
   826    859     style_header("WWW Configuration");
   827    860     db_begin_transaction();
   828         -  @ <form action="%s(g.zBaseURL)/setup_config" method="POST">
          861  +  @ <form action="%s(g.zBaseURL)/setup_config" method="post"><div>
   829    862     login_insert_csrf_secret();
   830    863     @ <hr />
   831    864     entry_attribute("Project Name", 60, "project-name", "pn", "");
   832    865     @ <p>Give your project a name so visitors know what this site is about.
   833    866     @ The project name will also be used as the RSS feed title.</p>
   834    867     @ <hr />
   835    868     textarea_attribute("Project Description", 5, 60,
................................................................................
   838    871     @ engines as well as a short RSS description.</p>
   839    872     @ <hr />
   840    873     entry_attribute("Index Page", 60, "index-page", "idxpg", "/home");
   841    874     @ <p>Enter the pathname of the page to display when the "Home" menu
   842    875     @ option is selected and when no pathname is
   843    876     @ specified in the URL.  For example, if you visit the url:</p>
   844    877     @
   845         -  @ <blockquote>%h(g.zBaseURL)</blockquote>
          878  +  @ <blockquote><p>%h(g.zBaseURL)</p></blockquote>
   846    879     @
   847    880     @ <p>And you have specified an index page of "/home" the above will
   848    881     @ automatically redirect to:</p>
   849    882     @
   850         -  @ <blockquote>%h(g.zBaseURL)/home</blockquote>
          883  +  @ <blockquote><p>%h(g.zBaseURL)/home</p></blockquote>
   851    884     @
   852    885     @ <p>The default "/home" page displays a Wiki page with the same name
   853    886     @ as the Project Name specified above.  Some sites prefer to redirect
   854    887     @ to a documentation page (ex: "/doc/tip/index.wiki") or to "/timeline".</p>
   855    888     @ <hr />
   856    889     onoff_attribute("Use HTML as wiki markup language",
   857    890       "wiki-use-html", "wiki-use-html", 0);
   858         -  @ <p>Use HTML as the wiki markup language. Wiki links will still be parsed but
   859         -  @ all other wiki formatting will be ignored. This option is helpful if you have
   860         -  @ chosen to use a rich HTML editor for wiki markup such as TinyMCE.</p>
          891  +  @ <p>Use HTML as the wiki markup language. Wiki links will still be parsed
          892  +  @ but all other wiki formatting will be ignored. This option is helpful
          893  +  @ if you have chosen to use a rich HTML editor for wiki markup such as
          894  +  @ TinyMCE.</p>
   861    895     @ <p><strong>CAUTION:</strong> when
   862    896     @ enabling, <i>all</i> HTML tags and attributes are accepted in the wiki.
   863    897     @ No sanitization is done. This means that it is very possible for malicious
   864    898     @ users to inject dangerous HTML, CSS and JavaScript code into your wiki.</p>
   865    899     @ <p>This should <strong>only</strong> be enabled when wiki editing is limited
   866    900     @ to trusted users. It should <strong>not</strong> be used on a publically
   867    901     @ editable wiki.</p>
   868    902     @ <hr />
   869         -  @ <p><input type="submit"  name="submit" value="Apply Changes"></p>
   870         -  @ </form>
          903  +  @ <p><input type="submit"  name="submit" value="Apply Changes" /></p>
          904  +  @ </div></form>
   871    905     db_end_transaction(0);
   872    906     style_footer();
   873    907   }
   874    908   
   875    909   /*
   876    910   ** WEBPAGE: setup_editcss
   877    911   */
................................................................................
   890    924       textarea_attribute(0, 0, 0, "css", "css", zDefaultCSS);
   891    925     }
   892    926     if( P("submit")!=0 ){
   893    927       db_end_transaction(0);
   894    928       cgi_redirect("setup_editcss");
   895    929     }
   896    930     style_header("Edit CSS");
   897         -  @ <form action="%s(g.zBaseURL)/setup_editcss" method="POST">
          931  +  @ <form action="%s(g.zBaseURL)/setup_editcss" method="post"><div>
   898    932     login_insert_csrf_secret();
   899    933     @ Edit the CSS below:<br />
   900    934     textarea_attribute("", 40, 80, "css", "css", zDefaultCSS);
   901    935     @ <br />
   902         -  @ <input type="submit" name="submit" value="Apply Changes">
   903         -  @ <input type="submit" name="clear" value="Revert To Default">
   904         -  @ </form>
   905         -  @ <p><b>Note:</b> Press your browser Reload button after modifying the
   906         -  @ CSS in order to pull in the modified CSS file.</p>
   907         -  @ <hr>
          936  +  @ <input type="submit" name="submit" value="Apply Changes" />
          937  +  @ <input type="submit" name="clear" value="Revert To Default" />
          938  +  @ </div></form>
          939  +  @ <p><span class="note">Note:</span> Press your browser Reload button after
          940  +  @ modifying the CSS in order to pull in the modified CSS file.</p>
          941  +  @ <hr />
   908    942     @ The default CSS is shown below for reference.  Other examples
   909    943     @ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
   910    944     @ See also the <a href="setup_header">header</a> and
   911    945     @ <a href="setup_footer">footer</a> editing screens.
   912    946     @ <blockquote><pre>
   913         -  @ %h(zDefaultCSS)
   914         -  @ %h(zTableLabelValueCSS)
   915         -  @ %h(zDivSidebox)
   916         -  @ %h(zDivSideboxTitle)
          947  +  cgi_append_default_css();
   917    948     @ </pre></blockquote>
   918    949     style_footer();
   919    950     db_end_transaction(0);
   920    951   }
   921    952   
   922    953   /*
   923    954   ** WEBPAGE: setup_header
................................................................................
   931    962     if( P("clear")!=0 ){
   932    963       db_multi_exec("DELETE FROM config WHERE name='header'");
   933    964       cgi_replace_parameter("header", zDefaultHeader);
   934    965     }else{
   935    966       textarea_attribute(0, 0, 0, "header", "header", zDefaultHeader);
   936    967     }
   937    968     style_header("Edit Page Header");
   938         -  @ <form action="%s(g.zBaseURL)/setup_header" method="POST">
          969  +  @ <form action="%s(g.zBaseURL)/setup_header" method="post"><div>
   939    970     login_insert_csrf_secret();
   940    971     @ <p>Edit HTML text with embedded TH1 (a TCL dialect) that will be used to
   941    972     @ generate the beginning of every page through start of the main
   942    973     @ menu.</p>
   943    974     textarea_attribute("", 40, 80, "header", "header", zDefaultHeader);
   944    975     @ <br />
   945         -  @ <input type="submit" name="submit" value="Apply Changes">
   946         -  @ <input type="submit" name="clear" value="Revert To Default">
   947         -  @ </form>
   948         -  @ <hr>
          976  +  @ <input type="submit" name="submit" value="Apply Changes" />
          977  +  @ <input type="submit" name="clear" value="Revert To Default" />
          978  +  @ </div></form>
          979  +  @ <hr />
   949    980     @ The default header is shown below for reference.  Other examples
   950    981     @ of headers can be seen on the <a href="setup_skin">skins page</a>.
   951    982     @ See also the <a href="setup_editcss">CSS</a> and
   952    983     @ <a href="setup_footer">footer</a> editing screeens.
   953    984     @ <blockquote><pre>
   954    985     @ %h(zDefaultHeader)
   955    986     @ </pre></blockquote>
................................................................................
   969   1000     if( P("clear")!=0 ){
   970   1001       db_multi_exec("DELETE FROM config WHERE name='footer'");
   971   1002       cgi_replace_parameter("footer", zDefaultFooter);
   972   1003     }else{
   973   1004       textarea_attribute(0, 0, 0, "footer", "footer", zDefaultFooter);
   974   1005     }
   975   1006     style_header("Edit Page Footer");
   976         -  @ <form action="%s(g.zBaseURL)/setup_footer" method="POST">
         1007  +  @ <form action="%s(g.zBaseURL)/setup_footer" method="post"><div>
   977   1008     login_insert_csrf_secret();
   978   1009     @ <p>Edit HTML text with embedded TH1 (a TCL dialect) that will be used to
   979   1010     @ generate the end of every page.</p>
   980   1011     textarea_attribute("", 20, 80, "footer", "footer", zDefaultFooter);
   981   1012     @ <br />
   982         -  @ <input type="submit" name="submit" value="Apply Changes">
   983         -  @ <input type="submit" name="clear" value="Revert To Default">
   984         -  @ </form>
   985         -  @ <hr>
         1013  +  @ <input type="submit" name="submit" value="Apply Changes" />
         1014  +  @ <input type="submit" name="clear" value="Revert To Default" />
         1015  +  @ </div></form>
         1016  +  @ <hr />
   986   1017     @ The default footer is shown below for reference.  Other examples
   987   1018     @ of footers can be seen on the <a href="setup_skin">skins page</a>.
   988   1019     @ See also the <a href="setup_editcss">CSS</a> and
   989   1020     @ <a href="setup_header">header</a> editing screens.
   990   1021     @ <blockquote><pre>
   991   1022     @ %h(zDefaultFooter)
   992   1023     @ </pre></blockquote>
................................................................................
  1032   1063       );
  1033   1064       db_end_transaction(0);
  1034   1065       cgi_redirect("setup_logo");
  1035   1066     }
  1036   1067     style_header("Edit Project Logo");
  1037   1068     @ <p>The current project logo has a MIME-Type of <b>%h(zMime)</b> and looks
  1038   1069     @ like this:</p>
  1039         -  @ <blockquote><img src="%s(g.zTop)/logo" alt="logo"></blockquote>
         1070  +  @ <blockquote><p><img src="%s(g.zTop)/logo" alt="logo" /></p></blockquote>
  1040   1071     @
  1041   1072     @ <p>The logo is accessible to all users at this URL:
  1042   1073     @ <a href="%s(g.zBaseURL)/logo">%s(g.zBaseURL)/logo</a>.
  1043   1074     @ The logo may or may not appear on each
  1044   1075     @ page depending on the <a href="setup_editcss">CSS</a> and
  1045   1076     @ <a href="setup_header">header setup</a>.</p>
  1046   1077     @
  1047         -  @ <form action="%s(g.zBaseURL)/setup_logo" method="POST"
  1048         -  @  enctype="multipart/form-data">
         1078  +  @ <form action="%s(g.zBaseURL)/setup_logo" method="post"
         1079  +  @  enctype="multipart/form-data"><div>
  1049   1080     @ <p>To set a new logo image, select a file to use as the logo using
  1050   1081     @ the entry box below and then press the "Change Logo" button.</p>
  1051   1082     login_insert_csrf_secret();
  1052   1083     @ Logo Image file:
  1053         -  @ <input type="file" name="im" size="60" accepts="image/*"><br>
  1054         -  @ <input type="submit" name="set" value="Change Logo">
  1055         -  @ <input type="submit" name="clr" value="Revert To Default">
  1056         -  @ </form>
         1084  +  @ <input type="file" name="im" size="60" accept="image/*" /><br />
         1085  +  @ <input type="submit" name="set" value="Change Logo" />
         1086  +  @ <input type="submit" name="clr" value="Revert To Default" />
         1087  +  @ </div></form>
  1057   1088     @
  1058         -  @ <p><b>Note:</b>  Your browser has probably cached the logo image, so
  1059         -  @ you will probably need to press the Reload button on your browser after
  1060         -  @ changing the logo to provoke your browser to reload the new logo image.
  1061         -  @ </p>
         1089  +  @ <p><span class="note">Note:</span>  Your browser has probably cached the
         1090  +  @ logo image, so you will probably need to press the Reload button on your
         1091  +  @ browser after changing the logo to provoke your browser to reload the new
         1092  +  @ logo image. </p>
  1062   1093     style_footer();
  1063   1094     db_end_transaction(0);
  1064   1095   }

Changes to src/shun.c.

   110    110     @ from the repository.  Inappropriate content includes such things as
   111    111     @ spam added to Wiki, files that violate copyright or patent agreements,
   112    112     @ or artifacts that by design or accident interfere with the processing
   113    113     @ of the repository.  Do not shun artifacts merely to remove them from
   114    114     @ sight - set the "hidden" tag on such artifacts instead.</p>
   115    115     @ 
   116    116     @ <blockquote>
   117         -  @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
          117  +  @ <form method="post" action="%s(g.zBaseURL)/%s(g.zPath)"><div>
   118    118     login_insert_csrf_secret();
   119         -  @ <input type="text" name="uuid" value="%h(PD("shun",""))" size="50">
   120         -  @ <input type="submit" name="add" value="Shun">
   121         -  @ </form>
          119  +  @ <input type="text" name="uuid" value="%h(PD("shun",""))" size="50" />
          120  +  @ <input type="submit" name="add" value="Shun" />
          121  +  @ </div></form>
   122    122     @ </blockquote>
   123    123     @
   124    124     @ <p>Enter the UUID of a previous shunned artifact to cause it to be
   125    125     @ accepted again in the repository.  The artifact content is not
   126    126     @ restored because the content is unknown.  The only change is that
   127    127     @ the formerly shunned artifact will be accepted on subsequent sync
   128    128     @ operations.</p>
   129    129     @
   130    130     @ <blockquote>
   131         -  @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
          131  +  @ <form method="post" action="%s(g.zBaseURL)/%s(g.zPath)"><div>
   132    132     login_insert_csrf_secret();
   133         -  @ <input type="text" name="uuid" size="50">
   134         -  @ <input type="submit" name="sub" value="Accept">
   135         -  @ </form>
          133  +  @ <input type="text" name="uuid" size="50" />
          134  +  @ <input type="submit" name="sub" value="Accept" />
          135  +  @ </div></form>
   136    136     @ </blockquote>
   137    137     @
   138    138     @ <p>Press the Rebuild button below to rebuild the respository.  The
   139    139     @ content of newly shunned artifacts is not purged until the repository
   140    140     @ is rebuilt.  On larger repositories, the rebuild may take minute or
   141    141     @ two, so be patient after pressing the button.</p>
   142    142     @
   143    143     @ <blockquote>
   144         -  @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
          144  +  @ <form method="post" action="%s(g.zBaseURL)/%s(g.zPath)"><div>
   145    145     login_insert_csrf_secret();
   146         -  @ <input type="submit" name="rebuild" value="Rebuild">
   147         -  @ </form>
          146  +  @ <input type="submit" name="rebuild" value="Rebuild" />
          147  +  @ </div></form>
   148    148     @ </blockquote>
   149    149     @ 
   150         -  @ <hr><p>Shunned Artifacts:</p>
   151         -  @ <blockquote>
          150  +  @ <hr /><p>Shunned Artifacts:</p>
          151  +  @ <blockquote><p>
   152    152     db_prepare(&q, 
   153    153        "SELECT uuid, EXISTS(SELECT 1 FROM blob WHERE blob.uuid=shun.uuid)"
   154    154        "  FROM shun ORDER BY uuid");
   155    155     while( db_step(&q)==SQLITE_ROW ){
   156    156       const char *zUuid = db_column_text(&q, 0);
   157    157       int stillExists = db_column_int(&q, 1);
   158    158       cnt++;
   159    159       if( stillExists ){
   160         -      @ <b><a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a></b><br>
          160  +      @ <b><a href="%s(g.zBaseURL)/artifact/%s(zUuid)">%s(zUuid)</a></b><br />
   161    161       }else{
   162         -      @ <b>%s(zUuid)</b><br>
          162  +      @ <b>%s(zUuid)</b><br />
   163    163       }
   164    164     }
   165    165     if( cnt==0 ){
   166    166       @ <i>no artifacts are shunned on this server</i>
   167    167     }
   168    168     db_finalize(&q);
   169         -  @ </blockquote>
          169  +  @ </p></blockquote>
   170    170     style_footer();
   171    171   }
   172    172   
   173    173   /*
   174    174   ** Remove from the BLOB table all artifacts that are in the SHUN table.
   175    175   */
   176    176   void shun_artifacts(void){
................................................................................
   227    227     @ finding and fixing attempts to inject illicit content into the
   228    228     @ repository.</p>
   229    229     @
   230    230     @ <p>Click on the "rcvid" to show a list of specific artifacts received
   231    231     @ by a transaction.  After identifying illicit artifacts, remove them
   232    232     @ using the "Shun" feature.</p>
   233    233     @
   234         -  @ <table cellpadding=0 cellspacing=0 border=0>
   235         -  @ <tr><th>rcvid</th><th width=15>
   236         -  @     <th>Date</th><th width=15><th>User</th>
   237         -  @     <th width=15><th>IP&nbsp;Address</th></tr>
          234  +  @ <table cellpadding="0" cellspacing="0" border="0">
          235  +  @ <tr><th style="padding-right: 15px;text-align: right;">rcvid</th>
          236  +  @     <th style="padding-right: 15px;text-align: left;">Date</th>
          237  +  @     <th style="padding-right: 15px;text-align: left;">User</th>
          238  +  @     <th style="text-align: left;">IP&nbsp;Address</th></tr>
   238    239     cnt = 0;
   239    240     while( db_step(&q)==SQLITE_ROW ){
   240    241       int rcvid = db_column_int(&q, 0);
   241    242       const char *zUser = db_column_text(&q, 1);
   242    243       const char *zDate = db_column_text(&q, 2);
   243    244       const char *zIpAddr = db_column_text(&q, 3);
   244    245       if( cnt==30 ){
   245    246         style_submenu_element("Older", "Older",
   246    247            "rcvfromlist?ofst=%d", ofst+30);
   247    248       }else{
   248    249         cnt++;
   249    250         @ <tr>
   250         -      @ <td><a href="rcvfrom?rcvid=%d(rcvid)">%d(rcvid)</a></td><td>
   251         -      @ <td>%s(zDate)</td><td>
   252         -      @ <td>%h(zUser)</td><td>
   253         -      @ <td>&nbsp;%s(zIpAddr)&nbsp</td>
          251  +      @ <td style="padding-right: 15px;text-align: right;"><a href="rcvfrom?rcvid=%d(rcvid)">%d(rcvid)</a></td>
          252  +      @ <td style="padding-right: 15px;text-align: left;">%s(zDate)</td>
          253  +      @ <td style="padding-right: 15px;text-align: left;">%h(zUser)</td>
          254  +      @ <td style="text-align: left;">%s(zIpAddr)</td>
   254    255         @ </tr>
   255    256       }
   256    257     }
   257    258     db_finalize(&q);
   258    259     @ </table>
   259    260     style_footer();
   260    261   }
................................................................................
   275    276     style_header("Content Source %d", rcvid);
   276    277     db_prepare(&q, 
   277    278       "SELECT login, datetime(rcvfrom.mtime), rcvfrom.ipaddr"
   278    279       "  FROM rcvfrom LEFT JOIN user USING(uid)"
   279    280       " WHERE rcvid=%d",
   280    281       rcvid
   281    282     );
   282         -  @ <table cellspacing=15 cellpadding=0 border=0>
          283  +  @ <table cellspacing="15" cellpadding="0" border="0">
   283    284     @ <tr><td valign="top" align="right"><b>rcvid:</b></td>
   284    285     @ <td valign="top">%d(rcvid)</td></tr>
   285    286     if( db_step(&q)==SQLITE_ROW ){
   286    287       const char *zUser = db_column_text(&q, 0);
   287    288       const char *zDate = db_column_text(&q, 1);
   288    289       const char *zIpAddr = db_column_text(&q, 2);
   289    290       @ <tr><td valign="top" align="right"><b>User:</b></td>
................................................................................
   300    301     @ <tr><td valign="top" align="right"><b>Artifacts:</b></td>
   301    302     @ <td valign="top">
   302    303     while( db_step(&q)==SQLITE_ROW ){
   303    304       int rid = db_column_int(&q, 0);
   304    305       const char *zUuid = db_column_text(&q, 1);
   305    306       int size = db_column_int(&q, 2);
   306    307       @ <a href="%s(g.zBaseURL)/info/%s(zUuid)">%s(zUuid)</a>
   307         -    @ (rid: %d(rid), size: %d(size))<br>
          308  +    @ (rid: %d(rid), size: %d(size))<br />
   308    309     }
   309    310     @ </td></tr>
   310    311     @ </table>
          312  +  db_finalize(&q);
          313  +  style_footer();
   311    314   }

Changes to src/skins.c.

   163    163   @       media="screen">
   164    164   @ </head>
   165    165   @ <body>
   166    166   @ <div class="header">
   167    167   @   <div class="logo">
   168    168   @     <img src="$baseurl/logo" alt="logo">
   169    169   @   </div>
   170         -@   <div class="title"><small>$<project_name></small><br>$<title></div>
          170  +@   <div class="title"><small>$<project_name></small><br />$<title></div>
   171    171   @   <div class="status"><nobr><th1>
   172    172   @      if {[info exists login]} {
   173    173   @        puts "Logged in as $login"
   174    174   @      } else {
   175    175   @        puts "Not logged in"
   176    176   @      }
   177    177   @   </th1></nobr></div>
................................................................................
   598    598   @ <link rel="stylesheet" href="$baseurl/style.css?black2" type="text/css"
   599    599   @       media="screen">
   600    600   @ </head>
   601    601   @ <body>
   602    602   @ <div class="header">
   603    603   @   <div class="logo">
   604    604   @     <!-- <img src="$baseurl/logo" alt="logo"> -->
   605         -@     <br><nobr>$<project_name></nobr>
          605  +@     <br /><nobr>$<project_name></nobr>
   606    606   @   </div>
   607    607   @   <div class="title">$<title></div>
   608    608   @   <div class="status"><nobr><th1>
   609    609   @      if {[info exists login]} {
   610    610   @        puts "Logged in as $login"
   611    611   @      } else {
   612    612   @        puts "Not logged in"
................................................................................
   729    729       login_needed();
   730    730     }
   731    731     db_begin_transaction();
   732    732   
   733    733     /* Process requests to delete a user-defined skin */
   734    734     if( P("del1") && (zName = skinVarName(P("sn"), 1))!=0 ){
   735    735       style_header("Confirm Custom Skin Delete");
   736         -    @ <form action="%s(g.zBaseURL)/setup_skin" method="POST">
          736  +    @ <form action="%s(g.zBaseURL)/setup_skin" method="post"><div>
   737    737       @ <p>Deletion of a custom skin is a permanent action that cannot
   738    738       @ be undone.  Please confirm that this is what you want to do:</p>
   739         -    @ <input type="hidden" name="sn" value="%h(P("sn"))">
   740         -    @ <input type="submit" name="del2" value="Confirm - Delete The Skin">
   741         -    @ <input type="submit" name="cancel" value="Cancel - Do Not Delete">
          739  +    @ <input type="hidden" name="sn" value="%h(P("sn"))" />
          740  +    @ <input type="submit" name="del2" value="Confirm - Delete The Skin" />
          741  +    @ <input type="submit" name="cancel" value="Cancel - Do Not Delete" />
   742    742       login_insert_csrf_secret();
   743         -    @ </form>
          743  +    @ </div></form>
   744    744       style_footer();
   745    745       return;
   746    746     }
   747    747     if( P("del2")!=0 && (zName = skinVarName(P("sn"), 1))!=0 ){
   748    748       db_multi_exec("DELETE FROM config WHERE name=%Q", zName);
   749    749     }
   750    750   
................................................................................
   810    810     @ <h2>Available Skins:</h2>
   811    811     @ <ol>
   812    812     for(i=0; i<sizeof(aBuiltinSkin)/sizeof(aBuiltinSkin[0]); i++){
   813    813       z = aBuiltinSkin[i].zName;
   814    814       if( strcmp(aBuiltinSkin[i].zValue, zCurrent)==0 ){
   815    815         @ <li><p>%h(z).&nbsp;&nbsp; <b>Currently In Use</b></p>
   816    816       }else{
   817         -      @ <li><form action="%s(g.zBaseURL)/setup_skin" method="POST">
          817  +      @ <li><form action="%s(g.zBaseURL)/setup_skin" method="post"><div>
   818    818         @ %h(z).&nbsp;&nbsp; 
   819         -      @ <input type="hidden" name="sn" value="%h(z)">
   820         -      @ <input type="submit" name="load" value="Use This Skin">
   821         -      @ </form></li>
          819  +      @ <input type="hidden" name="sn" value="%h(z)" />
          820  +      @ <input type="submit" name="load" value="Use This Skin" />
          821  +      @ </div></form></li>
   822    822       }
   823    823     }
   824    824     db_prepare(&q,
   825    825        "SELECT substr(name, 6), value FROM config"
   826    826        " WHERE name GLOB 'skin:*'"
   827    827        " ORDER BY name"
   828    828     );

Changes to src/stat.c.

    26     26   ** WEBPAGE: stat
    27     27   **
    28     28   ** Show statistics and global information about the repository.
    29     29   */
    30     30   void stat_page(void){
    31     31     i64 t;
    32     32     int n, m, fsize;
           33  +  int szMax, szAvg;
    33     34     char zBuf[100];
           35  +
    34     36     login_check_credentials();
    35     37     if( !g.okRead ){ login_needed(); return; }
    36     38     style_header("Repository Statistics");
    37         -  @ <p><table class="label-value">
           39  +  @ <table class="label-value">
    38     40     @ <tr><th>Repository&nbsp;Size:</th><td>
    39     41     fsize = file_size(g.zRepositoryName);
    40     42     @ %d(fsize) bytes
    41     43     @ </td></tr>
    42     44     @ <tr><th>Number&nbsp;Of&nbsp;Artifacts:</th><td>
    43     45     n = db_int(0, "SELECT count(*) FROM blob");
    44     46     m = db_int(0, "SELECT count(*) FROM delta");
    45     47     @ %d(n) (stored as %d(n-m) full text and %d(m) delta blobs)
    46     48     @ </td></tr>
    47     49     if( n>0 ){
    48     50       int a, b;
           51  +    Stmt q;
    49     52       @ <tr><th>Uncompressed&nbsp;Artifact&nbsp;Size:</th><td>
    50         -    t = db_int64(0, "SELECT total(size) FROM blob WHERE size>0");
           53  +    db_prepare(&q, "SELECT total(size), avg(size), max(size)"
           54  +                   " FROM blob WHERE size>0");
           55  +    db_step(&q);
           56  +    t = db_column_int64(&q, 0);
           57  +    szAvg = db_column_int(&q, 1);
           58  +    szMax = db_column_int(&q, 2);
           59  +    db_finalize(&q);
    51     60       sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", t);
    52         -    @ %d((int)(((double)t)/(double)n)) bytes average, %s(zBuf) bytes total
           61  +    @ %d(szAvg) bytes average, %d(szMax) bytes max, %s(zBuf) bytes total
    53     62       @ </td></tr>
    54     63       @ <tr><th>Compression&nbsp;Ratio:</th><td>
    55     64       if( t/fsize < 5 ){
    56     65         b = 10;
    57     66         fsize /= 10;
    58     67       }else{
    59     68         b = 1;
................................................................................
    80     89                   " WHERE +tagname GLOB 'tkt-*'");
    81     90     @ %d(n)
    82     91     @ </td></tr>
    83     92     @ <tr><th>Duration&nbsp;Of&nbsp;Project:</th><td>
    84     93     n = db_int(0, "SELECT julianday('now') - (SELECT min(mtime) FROM event)"
    85     94                   " + 0.99");
    86     95     @ %d(n) days
           96  +  sqlite3_snprintf(sizeof(zBuf), zBuf, "%.2f", n/365.24);
           97  +  @ or approximately %s(zBuf) years
    87     98     @ </td></tr>
    88     99     @ <tr><th>Project&nbsp;ID:</th><td>
    89    100     @ %h(db_get("project-code",""))
    90    101     @ </td></tr>
    91    102     @ <tr><th>Server&nbsp;ID:</th><td>
    92    103     @ %h(db_get("server-code",""))
    93    104     @ </td></tr>
    94    105   
    95    106     @ <tr><th>Fossil&nbsp;Version:</th><td>
    96    107     @ %h(MANIFEST_DATE) %h(MANIFEST_VERSION)
    97    108     @ </td></tr>
    98    109     @ <tr><th>SQLite&nbsp;Version:</th><td>
    99         -  @ %h(db_text(0, "SELECT substr(sqlite_source_id(),1,30)"))
   100         -  @ (%h(SQLITE_VERSION))
          110  +  sqlite3_snprintf(sizeof(zBuf), zBuf, "%.19s [%.10s] (%s)",
          111  +                   SQLITE_SOURCE_ID, &SQLITE_SOURCE_ID[20], SQLITE_VERSION);
          112  +  @ %s(zBuf)
   101    113     @ </td></tr>
   102    114     @ <tr><th>Database&nbsp;Stats:</th><td>
   103    115     @ %d(db_int(0, "PRAGMA %s.page_count", g.zRepoDb)) pages,
   104    116     @ %d(db_int(0, "PRAGMA %s.page_size", g.zRepoDb)) bytes/page,
   105    117     @ %d(db_int(0, "PRAGMA %s.freelist_count", g.zRepoDb)) free pages,
   106    118     @ %s(db_text(0, "PRAGMA %s.encoding", g.zRepoDb)),
   107    119     @ %s(db_text(0, "PRAGMA %s.journal_mode", g.zRepoDb)) mode
   108    120     @ </td></tr>
   109    121   
   110         -  @ </table></p>
          122  +  @ </table>
   111    123     style_footer();
   112    124   }

Changes to src/style.c.

   137    137       }
   138    138       @ </div>
   139    139     }
   140    140     @ <div class="content">
   141    141     cgi_destination(CGI_BODY);
   142    142   
   143    143     /* Put the footer at the bottom of the page.
          144  +  ** the additional clear/both is needed to extend the content
          145  +  ** part to the end of an optional sidebox.
   144    146     */
   145         -  @ </div><br clear="both"/>
          147  +  @ <div style="clear: both;"></div>
          148  +  @ </div>
   146    149     zFooter = db_get("footer", (char*)zDefaultFooter);
   147    150     if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1);
   148    151     Th_Render(zFooter);
   149    152     if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1);
   150    153     
   151    154     /* Render trace log if TH1 tracing is enabled. */
   152    155     if( g.thTrace ){
   153         -    cgi_append_content("<font color=\"red\"><hr>\n", -1);
          156  +    cgi_append_content("<font color=\"red\"><hr />\n", -1);
   154    157       cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog));
   155    158       cgi_append_content("</font>\n", -1);
   156    159     }
   157    160   }
   158    161   
   159    162   /*
   160    163   ** Begin a side-box on the right-hand side of a page.  The title and
................................................................................
   177    180   ** The default page header.
   178    181   */
   179    182   const char zDefaultHeader[] = 
   180    183   @ <html>
   181    184   @ <head>
   182    185   @ <title>$<project_name>: $<title></title>
   183    186   @ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
   184         -@       href="$baseurl/timeline.rss">
          187  +@       href="$baseurl/timeline.rss" />
   185    188   @ <link rel="stylesheet" href="$baseurl/style.css?default" type="text/css"
   186         -@       media="screen">
          189  +@       media="screen" />
   187    190   @ </head>
   188    191   @ <body>
   189    192   @ <div class="header">
   190    193   @   <div class="logo">
   191    194   @     <img src="$baseurl/logo" alt="logo">
   192    195   @   </div>
   193         -@   <div class="title"><small>$<project_name></small><br>$<title></div>
   194         -@   <div class="status"><nobr><th1>
          196  +@   <div class="title"><small>$<project_name></small><br />$<title></div>
          197  +@   <div class="status"><th1>
   195    198   @      if {[info exists login]} {
   196    199   @        puts "Logged in as $login"
   197    200   @      } else {
   198    201   @        puts "Not logged in"
   199    202   @      }
   200         -@   </th1></nobr></div>
          203  +@   </th1></div>
   201    204   @ </div>
   202    205   @ <div class="mainmenu"><th1>
   203    206   @ html "<a href='$baseurl$index_page'>Home</a> "
   204    207   @ if {[anycap jor]} {
   205    208   @   html "<a href='$baseurl/timeline'>Timeline</a> "
   206    209   @ }
   207    210   @ if {[hascap oh]} {
................................................................................
   272    275   @   display: table-cell;
   273    276   @   font-size: 2em;
   274    277   @   font-weight: bold;
   275    278   @   text-align: center;
   276    279   @   padding: 0 0 0 1em;
   277    280   @   color: #558195;
   278    281   @   vertical-align: bottom;
   279         -@   width: 100%;
          282  +@   width: 100% ;
   280    283   @ }
   281    284   @
   282    285   @ /* The login status message in the top right-hand corner */
   283    286   @ div.status {
   284    287   @   display: table-cell;
   285    288   @   text-align: right;
   286    289   @   vertical-align: bottom;
   287    290   @   color: #558195;
   288    291   @   font-size: 0.8em;
   289    292   @   font-weight: bold;
   290    293   @   min-width: 200px;
          294  +@   white-space: nowrap;
   291    295   @ }
   292    296   @
   293    297   @ /* The header across the top of the page */
   294    298   @ div.header {
   295    299   @   display: table;
   296         -@   width: 100%;
          300  +@   width: 100% ;
   297    301   @ }
   298    302   @
   299    303   @ /* The main menu bar that appears at the top of the page beneath
   300    304   @ ** the header */
   301    305   @ div.mainmenu {
   302    306   @   padding: 5px 10px 5px 10px;
   303    307   @   font-size: 0.9em;
................................................................................
   337    341   @   margin-bottom: 0px;
   338    342   @   margin-top: 1em;
   339    343   @   padding: 1px 1px 1px 1px;
   340    344   @   font-size: 1.2em;
   341    345   @   font-weight: bold;
   342    346   @   background-color: #558195;
   343    347   @   color: white;
          348  +@   white-space: nowrap;
   344    349   @ }
   345    350   @
   346    351   @ /* The "Date" that occurs on the left hand side of timelines */
   347    352   @ div.divider {
   348    353   @   background: #a1c4d4;
   349    354   @   border: 2px #558195 solid;
   350    355   @   font-size: 1em; font-weight: normal;
................................................................................
   366    371   @
   367    372   @ /* Hyperlink colors in the footer */
   368    373   @ div.footer a { color: white; }
   369    374   @ div.footer a:link { color: white; }
   370    375   @ div.footer a:visited { color: white; }
   371    376   @ div.footer a:hover { background-color: white; color: #558195; }
   372    377   @ 
   373         -@ /* <verbatim> blocks */
          378  +@ /* verbatim blocks */
   374    379   @ pre.verbatim {
   375    380   @    background-color: #f5f5f5;
   376    381   @    padding: 0.5em;
   377    382   @}
   378    383   @
   379         -;
   380         -const char zTableLabelValueCSS[] = 
   381    384   @ /* The label/value pairs on (for example) the ci page */
   382    385   @ table.label-value th {
   383    386   @   vertical-align: top;
   384    387   @   text-align: right;
   385    388   @   padding: 0.2ex 2ex;
   386    389   @ }
   387         -;
   388         -const char zDivSidebox[] =
   389         -@ /* The nomenclature sidebox for branches,.. */
   390         -@ div.sidebox {
   391         -@   float: right;
   392         -@   border-width: medium;
   393         -@   border-style: double;
   394         -@   margin: 10;
   395         -@ }
   396         -;
   397         -const char zDivSideboxTitle[] =
   398         -@ /* The nomenclature title in sideboxes for branches,.. */
   399         -@ div.sideboxTitle {
   400         -@   display: inline;
   401         -@   font-weight: bold;
   402         -@ }
          390  +@
   403    391   ;
   404    392   
   405    393   
   406         -/* The following table holds the names of CSS elements and the CSS
   407         -** text that implements those elements.
          394  +/* The following table contains bits of default CSS that must
          395  +** be included if they are not found in the application-defined
          396  +** CSS.
   408    397   */
   409         -static const struct {
   410         -  const char *zElement;   /* Name of the CSS element */
   411         -  const char *zText;      /* Text of the element */
   412         -} cssElements[] = {
   413         -  { "table.label-value", zTableLabelValueCSS },
   414         -  { "div.sidebox",       zDivSidebox         },
   415         -  { "div.sideboxTitle",  zDivSideboxTitle    },
          398  +const struct strctCssDefaults {
          399  +  char const * const elementClass;  /* Name of element needed */
          400  +  char const * const comment;       /* Comment text */
          401  +  char const * const value;         /* CSS text */
          402  +} cssDefaultList[] = {
          403  +  { "",
          404  +    "",
          405  +    zDefaultCSS
          406  +  },
          407  +  { "div.sidebox",
          408  +    "The nomenclature sidebox for branches,..",
          409  +    @   float: right;
          410  +    @   background-color: white;
          411  +    @   border-width: medium;
          412  +    @   border-style: double;
          413  +    @   margin: 10;
          414  +  },
          415  +  { "div.sideboxTitle",
          416  +    "The nomenclature title in sideboxes for branches,..",
          417  +    @   display: inline;
          418  +    @   font-weight: bold;
          419  +  },
          420  +  { "div.sideboxDescribed",
          421  +    "The defined element in sideboxes for branches,..",
          422  +    @   display: inline;
          423  +    @   font-weight: bold;
          424  +  },
          425  +  { "span.disabled",
          426  +    "The defined element in sideboxes for branches,..",
          427  +    @   color: red;
          428  +  },
          429  +  { "span.timelineDisabled",
          430  +    "The suppressed duplicates lines in timeline, ..",
          431  +    @   font-style: italic;
          432  +    @   font-size: small;
          433  +  },
          434  +  { "table.timelineTable",
          435  +    "the format for the timeline data table",
          436  +    @   cellspacing: 0;
          437  +    @   border: 0;
          438  +    @   cellpadding: 0
          439  +  },
          440  +  { "td.timelineTableCell",
          441  +    "the format for the timeline data cells",
          442  +    @   valign: top;
          443  +    @   align: left;
          444  +  },
          445  +  { "span.timelineLeaf",
          446  +    "the format for the timeline leaf marks",
          447  +    @   font-weight: bold;
          448  +  },
          449  +  { "a.timelineHistLink",
          450  +    "the format for the timeline version links",
          451  +    @
          452  +  },
          453  +  { "span.timelineHistDsp",
          454  +    "the format for the timeline version display(no history permission!)",
          455  +    @   font-weight: bold;
          456  +  },
          457  +  { "td.timelineTime",
          458  +    "the format for the timeline time display",
          459  +    @   vertical-align: top;
          460  +    @   text-align: right;
          461  +  },
          462  +  { "td.timelineGraph",
          463  +    "the format for the grap placeholder cells in timelines",
          464  +    @ width: 20;
          465  +    @ text-align: left;
          466  +    @ vertical-align: top;
          467  +  },
          468  +  { "a.tagLink",
          469  +    "the format for the tag links",
          470  +    @
          471  +  },
          472  +  { "span.tagDsp",
          473  +    "the format for the tag display(no history permission!)",
          474  +    @   font-weight: bold;
          475  +  },
          476  +  { "span.wikiError",
          477  +    "the format for wiki errors",
          478  +    @   font-weight: bold;
          479  +    @   color: red;
          480  +  },
          481  +  { "span.infoTagCancelled",
          482  +    "the format for fixed/canceled tags,..",
          483  +    @   font-weight: bold;
          484  +    @   text-decoration: line-through;
          485  +  },
          486  +  { "span.infoTag",
          487  +    "the format for tags,..",
          488  +    @   font-weight: bold;
          489  +  },
          490  +  { "span.wikiTagCancelled",
          491  +    "the format for fixed/cancelled tags,.. on wiki pages",
          492  +    @   text-decoration: line-through;
          493  +  },
          494  +  { "table.browser",
          495  +    "format for the file display table",
          496  +    @ /* the format for wiki errors */
          497  +    @   width: 100% ;
          498  +    @   border: 0;
          499  +  },
          500  +  { "td.browser",
          501  +    "format for cells in the file browser",
          502  +    @   width: 24% ;
          503  +    @   vertical-align: top;
          504  +  },
          505  +  { "ul.browser",
          506  +    "format for the list in the file browser",
          507  +    @   margin-left: 0.5em;
          508  +    @   padding-left: 0.5em;
          509  +  },
          510  +  { "table.login_out",
          511  +    "table format for login/out label/input table",
          512  +    @   text-align: left;
          513  +    @   margin-right: 10px;
          514  +    @   margin-left: 10px;
          515  +    @   margin-top: 10px;
          516  +  },
          517  +  { "div.captcha",
          518  +    "captcha display options",
          519  +    @   text-align: center;
          520  +  },
          521  +  { "table.captcha",
          522  +    "format for the layout table, used for the captcha display",
          523  +    @   margin: auto;
          524  +    @   padding: 10px;
          525  +    @   outline-width: 1;
          526  +    @   outline-style: double;
          527  +  },
          528  +  { "td.login_out_label",
          529  +    "format for the label cells in the login/out table",
          530  +    @   text-align: center;
          531  +  },
          532  +  { "span.loginError",
          533  +    "format for login error messages",
          534  +    @   color: red;
          535  +  },
          536  +  { "span.note",
          537  +    "format for leading text for notes",
          538  +    @   font-weight: bold;
          539  +  },
          540  +  { "span.textareaLabel",
          541  +    "format for textare labels",
          542  +    @   font-weight: bold;
          543  +  },
          544  +  { "table.usetupLayoutTable",
          545  +    "format for the user setup layout table",
          546  +    @   outline-style: none;
          547  +    @   padding: 0;
          548  +    @   margin: 25px;
          549  +  },
          550  +  { "td.usetupColumnLayout",
          551  +    "format of the columns on the user setup list page",
          552  +    @   vertical-align: top
          553  +  },
          554  +  { "table.usetupUserList",
          555  +    "format for the user list table on the user setup page",
          556  +    @   outline-style: double;
          557  +    @   outline-width: 1;
          558  +    @   padding: 10px;
          559  +  },
          560  +  { "th.usetupListUser",
          561  +    "format for table header user in user list on user setup page",
          562  +    @   text-align: right;
          563  +    @   padding-right: 20px;
          564  +  },
          565  +  { "th.usetupListCap",
          566  +    "format for table header capabilities in user list on user setup page",
          567  +    @   text-align: center;
          568  +    @   padding-right: 15px;
          569  +  },
          570  +  { "th.usetupListCon",
          571  +    "format for table header contact info in user list on user setup page",
          572  +    @   text-align: left;
          573  +  },
          574  +  { "td.usetupListUser",
          575  +    "format for table cell user in user list on user setup page",
          576  +    @   text-align: right;
          577  +    @   padding-right: 20px;
          578  +    @   white-space:nowrap;
          579  +  },
          580  +  { "td.usetupListCap",
          581  +    "format for table cell capabilities in user list on user setup page",
          582  +    @   text-align: center;
          583  +    @   padding-right: 15px;
          584  +  },
          585  +  { "td.usetupListCon",
          586  +    "format for table cell contact info in user list on user setup page",
          587  +    @   text-align: left
          588  +  },
          589  +  { "div.ueditCapBox",
          590  +    "layout definition for the capabilities box on the user edit detail page",
          591  +    @   float: left;
          592  +    @   margin-right: 20px;
          593  +    @   margin-bottom: 20px;
          594  +  },
          595  +  { "td.usetupEditLabel",
          596  +    "format of the label cells in the detailed user edit page",
          597  +    @   text-align: right;
          598  +    @   vertical-align: top;
          599  +    @   white-space: nowrap;
          600  +  },
          601  +  { "span.ueditInheritNobody",
          602  +    "color for capabilities, inherited by nobody",
          603  +    @   color: green;
          604  +  },
          605  +  { "span.ueditInheritDeveloper",
          606  +    "color for capabilities, inherited by developer",
          607  +    @   color: red;
          608  +  },
          609  +  { "span.ueditInheritReader",
          610  +    "color for capabilities, inherited by reader",
          611  +    @   color: black;
          612  +  },
          613  +  { "span.ueditInheritAnonymous",
          614  +    "color for capabilities, inherited by anonymous",
          615  +    @   color: blue;
          616  +  },
          617  +  { "span.capability",
          618  +    "format for capabilites, mentioned on the user edit page",
          619  +    @   font-weight: bold;
          620  +  },
          621  +  { "span.usertype",
          622  +    "format for different user types, mentioned on the user edit page",
          623  +    @   font-weight: bold;
          624  +  },
          625  +  { "span.usertype:before",
          626  +    "leading text for user types, mentioned on the user edit page",
          627  +    @   content:"'";
          628  +  },
          629  +  { "span.usertype:after",
          630  +    "trailing text for user types, mentioned on the user edit page",
          631  +    @   content:"'";
          632  +  },
          633  +  { "span.wikiruleHead",
          634  +    "format for leading text in wikirules definitions",
          635  +    @   font-weight: bold;
          636  +  },
          637  +  { "td.tktDspLabel",
          638  +    "format for labels on ticket display page",
          639  +    @   text-align: right;
          640  +  },
          641  +  { "td.tktDspValue",
          642  +    "format for values on ticket display page",
          643  +    @   text-align: left;
          644  +    @   vertical-align: top;
          645  +    @   background-color: #d0d0d0;
          646  +  },
          647  +  { "span.tktError",
          648  +    "format for ticket error messages",
          649  +    @   color: red;
          650  +    @   font-weight: bold;
          651  +  },
          652  +  { 0,
          653  +    0,
          654  +    0
          655  +  }
   416    656   };
          657  +
          658  +/*
          659  +** Append all of the default CSS to the CGI output.
          660  +*/
          661  +void cgi_append_default_css(void) {
          662  +  int i;
          663  +
          664  +  for (i=0;cssDefaultList[i].elementClass;i++){
          665  +    if (cssDefaultList[i].elementClass[0]){
          666  +      cgi_printf("/* %s */\n%s {\n%s\n}\n\n",
          667  +		 cssDefaultList[i].comment,
          668  +		 cssDefaultList[i].elementClass,
          669  +		 cssDefaultList[i].value
          670  +		);
          671  +    }else{
          672  +      cgi_printf("%s",
          673  +		 cssDefaultList[i].value
          674  +		);
          675  +    }
          676  +  }
          677  +}
   417    678   
   418    679   /*
   419    680   ** WEBPAGE: style.css
   420    681   */
   421    682   void page_style_css(void){
   422         -  const char *zCSS;
          683  +  const char *zCSS    = 0;
   423    684     int i;
   424    685   
   425    686     cgi_set_content_type("text/css");
   426    687     zCSS = db_get("css",(char*)zDefaultCSS);
   427    688     /* append user defined css */
   428    689     cgi_append_content(zCSS, -1);
   429    690     /* add special missing definitions */
   430         -  for(i=0; i<count(cssElements); i++){
   431         -    if( strstr(cssElements[i].zElement, zCSS)==0 ){
   432         -      cgi_append_content(cssElements[i].zText, -1);
          691  +  for (i=1;cssDefaultList[i].elementClass;i++)
          692  +    if (!strstr(zCSS,cssDefaultList[i].elementClass)) {
          693  +      cgi_append_content("/* ", -1);
          694  +      cgi_append_content(cssDefaultList[i].comment, -1);
          695  +      cgi_append_content(" */\n", -1);
          696  +      cgi_append_content(cssDefaultList[i].elementClass, -1);
          697  +      cgi_append_content(" {\n", -1);
          698  +      cgi_append_content(cssDefaultList[i].value, -1);
          699  +      cgi_append_content("}\n\n", -1);
   433    700       }
   434         -  }
   435    701     g.isConst = 1;
   436    702   }
   437    703   
   438    704   /*
   439    705   ** WEBPAGE: test_env
   440    706   */
   441    707   void page_test_env(void){
   442    708     style_header("Environment Test");
   443    709   #if !defined(_WIN32)
   444         -  @ uid=%d(getuid()), gid=%d(getgid())<br>
          710  +  @ uid=%d(getuid()), gid=%d(getgid())<br />
   445    711   #endif
   446         -  @ g.zBaseURL = %h(g.zBaseURL)<br>
   447         -  @ g.zTop = %h(g.zTop)<br>
          712  +  @ g.zBaseURL = %h(g.zBaseURL)<br />
          713  +  @ g.zTop = %h(g.zTop)<br />
   448    714     cgi_print_all();
   449    715     style_footer();
   450    716   }

Changes to src/tag.c.

   512    512       " AND tagname GLOB 'sym-*'"
   513    513       " ORDER BY tagname"
   514    514     );
   515    515     @ <ul>
   516    516     while( db_step(&q)==SQLITE_ROW ){
   517    517       const char *zName = db_column_text(&q, 0);
   518    518       if( g.okHistory ){
   519         -      @ <li><a href=%s(g.zBaseURL)/timeline?t=%T(zName)>%h(zName)</a></li>
          519  +      @ <li><a class="tagLink" href="%s(g.zBaseURL)/timeline?t=%T(zName)">
          520  +      @ %h(zName)</a></li>
   520    521       }else{
   521         -      @ <li><strong>%h(zName)</strong></li>
          522  +      @ <li><span class="tagDsp">%h(zName)</span></li>
   522    523       }
   523    524     }
   524    525     @ </ul>
   525    526     db_finalize(&q);
   526    527     style_footer();
   527    528   }
   528    529   
................................................................................
   540    541       "   AND tagxref.tagtype>0 AND tagxref.srcid>0"
   541    542       "   AND tag.tagname GLOB 'sym-*'",
   542    543       rid
   543    544     );
   544    545     while( db_step(&q)==SQLITE_ROW ){
   545    546       const char *zTagName = db_column_text(&q, 0);
   546    547       if( g.okHistory ){
   547         -      @ <a href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">[%h(zTagName)]</a>
          548  +      @ <a class="tagLink" href="%s(g.zBaseURL)/timeline?t=%T(zTagName)">
          549  +      @ [%h(zTagName)]</a>
   548    550       }else{
   549         -      @ <b>[%h(zTagName)]</b>
          551  +      @ <span class="tagDsp">[%h(zTagName)]</span>
   550    552       }
   551    553     }
   552    554     db_finalize(&q);
   553    555   }
   554    556   
   555    557   /*
   556    558   ** WEBPAGE: /tagtimeline
................................................................................
   571    573       "                       AND tagid IN (SELECT tagid FROM tag "
   572    574       "                                      WHERE tagname GLOB 'sym-*'))"
   573    575       " ORDER BY event.mtime DESC",
   574    576       timeline_query_for_www()
   575    577     );
   576    578     www_print_timeline(&q, 0, tagtimeline_extra);
   577    579     db_finalize(&q);
   578         -  @ <br clear="both">
   579         -  @ <script>
          580  +  @ <br />
          581  +  @ <script  type="text/JavaScript">
   580    582     @ function xin(id){
   581    583     @ }
   582    584     @ function xout(id){
   583    585     @ }
   584    586     @ </script>
   585    587     style_footer();
   586    588   }

Changes to src/th_main.c.

   276    276       sendText(z, -1, 0);
   277    277       free(z);
   278    278       blob_reset(&name);
   279    279       for(i=0; i<nElem; i++){
   280    280         zH = htmlize((char*)azElem[i], aszElem[i]);
   281    281         if( zValue && aszElem[i]==nValue 
   282    282                && memcmp(zValue, azElem[i], nValue)==0 ){
   283         -        z = mprintf("<option value=\"%s\" selected>%s</option>", zH, zH);
          283  +        z = mprintf("<option value=\"%s\" selected=\"selected\">%s</option>",
          284  +                     zH, zH);
   284    285         }else{
   285    286           z = mprintf("<option value=\"%s\">%s</option>", zH, zH);
   286    287         }
   287    288         free(zH);
   288    289         sendText(z, -1, 0);
   289    290         free(z);
   290    291       }

Changes to src/timeline.c.

    46     46   /*
    47     47   ** Generate a hyperlink to a version.
    48     48   */
    49     49   void hyperlink_to_uuid(const char *zUuid){
    50     50     char zShortUuid[UUID_SIZE+1];
    51     51     shorten_uuid(zShortUuid, zUuid);
    52     52     if( g.okHistory ){
    53         -    @ <a href="%s(g.zBaseURL)/info/%s(zShortUuid)">[%s(zShortUuid)]</a>
           53  +    @ <a class="timelineHistLink" href="%s(g.zBaseURL)/info/%s(zShortUuid)">
           54  +    @ [%s(zShortUuid)]</a>
    54     55     }else{
    55         -    @ <b>[%s(zShortUuid)]</b>
           56  +    @ <span class="timelineHistDsp">[%s(zShortUuid)]</span>
    56     57     }
    57     58   }
    58     59   
    59     60   /*
    60     61   ** Generate a hyperlink that invokes javascript to highlight
    61     62   ** a version on mouseover.
    62     63   */
................................................................................
    81     82   ** Generate a hyperlink to a diff between two versions.
    82     83   */
    83     84   void hyperlink_to_diff(const char *zV1, const char *zV2){
    84     85     if( g.okHistory ){
    85     86       if( zV2==0 ){
    86     87         @ <a href="%s(g.zBaseURL)/diff?v2=%s(zV1)">[diff]</a>
    87     88       }else{
    88         -      @ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&v2=%s(zV2)">[diff]</a>
           89  +      @ <a href="%s(g.zBaseURL)/diff?v1=%s(zV1)&amp;v2=%s(zV2)">[diff]</a>
    89     90       }
    90     91     }
    91     92   }
    92     93   
    93     94   /*
    94     95   ** Generate a hyperlink to a date & time.
    95     96   */
................................................................................
   107    108   ** events by that user.  If the date+time is specified, then the timeline
   108    109   ** is centered on that date+time.
   109    110   */
   110    111   void hyperlink_to_user(const char *zU, const char *zD, const char *zSuf){
   111    112     if( zSuf==0 ) zSuf = "";
   112    113     if( g.okHistory ){
   113    114       if( zD && zD[0] ){
   114         -      @ <a href="%s(g.zTop)/timeline?c=%T(zD)&u=%T(zU)">%h(zU)</a>%s(zSuf)
          115  +      @ <a href="%s(g.zTop)/timeline?c=%T(zD)&amp;u=%T(zU)">%h(zU)</a>%s(zSuf)
   115    116       }else{
   116    117         @ <a href="%s(g.zTop)/timeline?u=%T(zU)">%h(zU)</a>%s(zSuf)
   117    118       }
   118    119     }else{
   119    120       @ %s(zU)
   120    121     }
   121    122   }
................................................................................
   187    188     if( db_get_boolean("timeline-block-markup", 0) ){
   188    189       wikiFlags = WIKI_INLINE;
   189    190     }else{
   190    191       wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
   191    192     }
   192    193     if( tmFlags & TIMELINE_GRAPH ){
   193    194       pGraph = graph_init();
          195  +    /* style is not moved to css, because this is
          196  +    ** a technical div for the timeline graph
          197  +    */
   194    198       @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
   195    199     }
   196    200   
   197         -  @ <table cellspacing=0 border=0 cellpadding=0>
          201  +  @ <table class="timelineTable">
   198    202     blob_zero(&comment);
   199    203     while( db_step(pQuery)==SQLITE_ROW ){
   200    204       int rid = db_column_int(pQuery, 0);
   201    205       const char *zUuid = db_column_text(pQuery, 1);
   202    206       int isLeaf = db_column_int(pQuery, 5);
   203    207       const char *zBgClr = db_column_text(pQuery, 6);
   204    208       const char *zDate = db_column_text(pQuery, 2);
................................................................................
   216    220           }else{
   217    221             commentColumn = 10;
   218    222           }
   219    223         }
   220    224       }
   221    225       prevTagid = tagid;
   222    226       if( suppressCnt ){
   223         -      @ <tr><td><td><td>
   224         -      @ <small><i>... %d(suppressCnt) similar
   225         -      @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
          227  +      @ <tr><td /><td /><td>
          228  +      @ <span class="timelineDisabled">... %d(suppressCnt) similar
          229  +      @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
   226    230         suppressCnt = 0;
   227    231       }
   228    232       if( strcmp(zType,"div")==0 ){
   229         -      @ <tr><td colspan=3><hr></td></tr>
          233  +      @ <tr><td colspan="3"><hr /></td></tr>
   230    234         continue;
   231    235       }
   232    236       if( memcmp(zDate, zPrevDate, 10) ){
   233    237         sprintf(zPrevDate, "%.10s", zDate);
   234    238         @ <tr><td>
   235         -      @   <div class="divider"><nobr>%s(zPrevDate)</nobr></div>
          239  +      @   <div class="divider">%s(zPrevDate)</div>
   236    240         @ </td></tr>
   237    241       }
   238    242       memcpy(zTime, &zDate[11], 5);
   239    243       zTime[5] = 0;
   240    244       @ <tr>
   241         -    @ <td valign="top" align="right">%s(zTime)</td>
   242         -    @ <td width="20" align="left" valign="top">
          245  +    @ <td class="timelineTime">%s(zTime)</td>
          246  +    @ <td class="timelineGraph">
   243    247       if( pGraph && zType[0]=='c' ){
   244    248         int nParent = 0;
   245    249         int aParent[32];
   246    250         const char *zBr;
   247    251         int gidx;
   248    252         static Stmt qparent;
   249    253         static Stmt qbranch;
................................................................................
   265    269         }else{
   266    270           zBr = "trunk";
   267    271         }
   268    272         gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
   269    273         db_reset(&qbranch);
   270    274         @ <div id="m%d(gidx)"></div>
   271    275       }
          276  +    @</td>
   272    277       if( zBgClr && zBgClr[0] ){
   273         -      @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
          278  +      @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
   274    279       }else{
   275         -      @ <td valign="top" align="left">
          280  +      @ <td class="timelineTableCell">
   276    281       }
   277    282       if( zType[0]=='c' ){
   278    283         hyperlink_to_uuid(zUuid);
   279    284         if( isLeaf ){
   280    285           if( db_exists("SELECT 1 FROM tagxref"
   281    286                         " WHERE rid=%d AND tagid=%d AND tagtype>0",
   282    287                         rid, TAG_CLOSED) ){
   283         -          @ <b>Closed-Leaf:</b>
          288  +          @ <span class="timelineLeaf">Closed-Leaf:</span>
   284    289           }else{
   285         -          @ <b>Leaf:</b>
          290  +          @ <span class="timelineLeaf">Leaf:</span>
   286    291           }
   287    292         }
   288    293       }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
   289    294         hyperlink_to_uuid(zUuid);
   290    295       }
   291    296       db_column_blob(pQuery, commentColumn, &comment);
   292    297       if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
................................................................................
   307    312       }
   308    313       if( xExtra ){
   309    314         xExtra(rid);
   310    315       }
   311    316       @ </td></tr>
   312    317     }
   313    318     if( suppressCnt ){
   314         -    @ <tr><td><td><td>
   315         -    @ <small><i>... %d(suppressCnt) similar
   316         -    @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
          319  +    @ <tr><td /><td /><td>
          320  +    @ <span class="timelineDisabled">... %d(suppressCnt) similar
          321  +    @ event%s(suppressCnt>1?"s":"") omitted.</span></td></tr>
   317    322       suppressCnt = 0;
   318    323     }
   319    324     if( pGraph ){
   320    325       graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
   321    326       if( pGraph->nErr ){
   322    327         graph_free(pGraph);
   323    328         pGraph = 0;
   324    329       }else{
   325         -      @ <tr><td><td>
          330  +      /* style is not moved to css, because this is
          331  +      ** a technical div for the timeline graph
          332  +      */
          333  +      @ <tr><td /><td>
   326    334         @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
          335  +      @ </td></tr>
   327    336       }
   328    337     }
   329    338     @ </table>
   330    339     timeline_output_graph_javascript(pGraph);
   331    340   }
   332    341   
   333    342   /*
................................................................................
   335    344   ** graph.
   336    345   */
   337    346   void timeline_output_graph_javascript(GraphContext *pGraph){
   338    347     if( pGraph && pGraph->nErr==0 ){
   339    348       GraphRow *pRow;
   340    349       int i;
   341    350       char cSep;
   342         -    @ <script type="text/JavaScript">
          351  +    @ <script  type="text/JavaScript">
   343    352       cgi_printf("var rowinfo = [\n");
   344    353       for(pRow=pGraph->pFirst; pRow; pRow=pRow->pNext){
   345    354         cgi_printf("{id:\"m%d\",bg:\"%s\",r:%d,d:%d,mo:%d,mu:%d,u:%d,au:",
   346    355           pRow->idx,
   347    356           pRow->zBgClr,
   348    357           pRow->iRail,
   349    358           pRow->bDescender,
................................................................................
   881    890         blob_appendf(&desc, " tagged with \"%h\"", zTagName);
   882    891         tmFlags |= TIMELINE_DISJOINT;
   883    892       }else if( zBrName ){
   884    893         blob_appendf(&desc, " related to \"%h\"", zBrName);
   885    894         tmFlags |= TIMELINE_DISJOINT;
   886    895       }
   887    896       if( zAfter ){
   888         -      blob_appendf(&desc, " occurring on or after %h.<br>", zAfter);
          897  +      blob_appendf(&desc, " occurring on or after %h.<br />", zAfter);
   889    898       }else if( zBefore ){
   890         -      blob_appendf(&desc, " occurring on or before %h.<br>", zBefore);
          899  +      blob_appendf(&desc, " occurring on or before %h.<br />", zBefore);
   891    900       }else if( zCirca ){
   892         -      blob_appendf(&desc, " occurring around %h.<br>", zCirca);
          901  +      blob_appendf(&desc, " occurring around %h.<br />", zCirca);
   893    902       }
   894    903       if( zSearch ){
   895    904         blob_appendf(&desc, " matching \"%h\"", zSearch);
   896    905       }
   897    906       if( g.okHistory ){
   898    907         if( zAfter || n==nEntry ){
   899    908           zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");

Changes to src/tkt.c.

   311    311     }
   312    312     if( g.okNewTkt ){
   313    313       style_submenu_element("New Ticket", "Create a new ticket",
   314    314           "%s/tktnew", g.zTop);
   315    315     }
   316    316     if( g.okApndTkt && g.okAttach ){
   317    317       style_submenu_element("Attach", "Add An Attachment",
   318         -        "%s/attachadd?tkt=%T&from=%s/tktview/%t",
          318  +        "%s/attachadd?tkt=%T&amp;from=%s/tktview/%t",
   319    319           g.zTop, zUuid, g.zTop, zUuid);
   320    320     }
   321    321     style_header("View Ticket");
   322    322     if( g.thTrace ) Th_Trace("BEGIN_TKTVIEW<br />\n", -1);
   323    323     ticket_init();
   324    324     initializeVariablesFromDb();
   325    325     zScript = ticket_viewpage_code();
................................................................................
   340    340          " ORDER BY mtime DESC",
   341    341          zFullName);
   342    342       while( db_step(&q)==SQLITE_ROW ){
   343    343         const char *zDate = db_column_text(&q, 0);
   344    344         const char *zFile = db_column_text(&q, 1);
   345    345         const char *zUser = db_column_text(&q, 2);
   346    346         if( cnt==0 ){
   347         -        @ <hr><h2>Attachments:</h2>
          347  +        @ <hr /><h2>Attachments:</h2>
   348    348           @ <ul>
   349    349         }
   350    350         cnt++;
   351    351         if( g.okRead && g.okHistory ){
   352         -        @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)">
          352  +        @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&amp;file=%t(zFile)">
   353    353           @ %h(zFile)</a>
   354    354         }else{
   355    355           @ %h(zFile)
   356    356         }
   357    357         @ added by %h(zUser) on
   358    358         hyperlink_to_date(zDate, ".");
   359    359         if( g.okWrTkt && g.okAttach ){
   360         -        @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>]
          360  +        @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&amp;file=%t(zFile)&amp;from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>]
   361    361         }
   362    362       }
   363    363       if( cnt ){
   364    364         @ </ul>
   365    365       }
   366    366       db_finalize(&q);
   367    367     }
................................................................................
   509    509     }
   510    510     style_header("New Ticket");
   511    511     if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br />\n", -1);
   512    512     ticket_init();
   513    513     getAllTicketFields();
   514    514     initializeVariablesFromDb();
   515    515     initializeVariablesFromCGI();
   516         -  @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
          516  +  @ <form method="post" action="%s(g.zBaseURL)/%s(g.zPath)"><p>
   517    517     login_insert_csrf_secret();
          518  +  @ </p>
   518    519     zScript = ticket_newpage_code();
   519    520     Th_Store("login", g.zLogin);
   520    521     Th_Store("date", db_text(0, "SELECT datetime('now')"));
   521    522     Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd,
   522    523                      (void*)&zNewUuid, 0);
   523    524     if( g.thTrace ) Th_Trace("BEGIN_TKTNEW_SCRIPT<br />\n", -1);
   524    525     if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zNewUuid ){
................................................................................
   552    553     zName = P("name");
   553    554     if( P("cancel") ){
   554    555       cgi_redirectf("tktview?name=%T", zName);
   555    556     }
   556    557     style_header("Edit Ticket");
   557    558     if( zName==0 || (nName = strlen(zName))<4 || nName>UUID_SIZE
   558    559             || !validate16(zName,nName) ){
   559         -    @ <font color="red"><b>Not a valid ticket id: \"%h(zName)\"</b></font>
          560  +    @ <span class="tktError">Not a valid ticket id: \"%h(zName)\"</span>
   560    561       style_footer();
   561    562       return;
   562    563     }
   563    564     nRec = db_int(0, "SELECT count(*) FROM ticket WHERE tkt_uuid GLOB '%q*'",
   564    565                   zName);
   565    566     if( nRec==0 ){
   566         -    @ <font color="red"><b>No such ticket: \"%h(zName)\"</b></font>
          567  +    @ <span class="tktError">No such ticket: \"%h(zName)\"</span>
   567    568       style_footer();
   568    569       return;
   569    570     }
   570    571     if( nRec>1 ){
   571         -    @ <font color="red"><b>%d(nRec) tickets begin with: \"%h(zName)\"</b></font>
          572  +    @ <span class="tktError"><b>%d(nRec) tickets begin with:
          573  +    @ \"%h(zName)\"</span>
   572    574       style_footer();
   573    575       return;
   574    576     }
   575    577     if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT<br />\n", -1);
   576    578     ticket_init();
   577    579     getAllTicketFields();
   578    580     initializeVariablesFromCGI();
   579    581     initializeVariablesFromDb();
   580         -  @ <form method="POST" action="%s(g.zBaseURL)/%s(g.zPath)">
   581         -  @ <input type="hidden" name="name" value="%s(zName)">
          582  +  @ <form method="post" action="%s(g.zBaseURL)/%s(g.zPath)"><p>
          583  +  @ <input type="hidden" name="name" value="%s(zName)" />
   582    584     login_insert_csrf_secret();
          585  +  @ </p>
   583    586     zScript = ticket_editpage_code();
   584    587     Th_Store("login", g.zLogin);
   585    588     Th_Store("date", db_text(0, "SELECT datetime('now')"));
   586    589     Th_CreateCommand(g.interp, "append_field", appendRemarkCmd, 0, 0);
   587    590     Th_CreateCommand(g.interp, "submit_ticket", submitTicketCmd, (void*)&zName,0);
   588    591     if( g.thTrace ) Th_Trace("BEGIN_TKTEDIT_SCRIPT<br />\n", -1);
   589    592     if( Th_Render(zScript)==TH_RETURN && !g.thTrace && zName ){
................................................................................
   622    625       }
   623    626     }
   624    627     return 0;
   625    628   }
   626    629   
   627    630   /*
   628    631   ** WEBPAGE: tkttimeline
   629         -** URL: /tkttimeline?name=TICKETUUID&y=TYPE
          632  +** URL: /tkttimeline?name=TICKETUUID&amp;y=TYPE
   630    633   **
   631    634   ** Show the change history for a single ticket in timeline format.
   632    635   */
   633    636   void tkttimeline_page(void){
   634    637     Stmt q;
   635    638     char *zTitle;
   636    639     char *zSQL;
................................................................................
   642    645   
   643    646     login_check_credentials();
   644    647     if( !g.okHistory || !g.okRdTkt ){ login_needed(); return; }
   645    648     zUuid = PD("name","");
   646    649     zType = PD("y","a");
   647    650     if( zType[0]!='c' ){
   648    651       style_submenu_element("Check-ins", "Check-ins",
   649         -       "%s/tkttimeline?name=%T&y=ci", g.zTop, zUuid);
          652  +       "%s/tkttimeline?name=%T&amp;y=ci", g.zTop, zUuid);
   650    653     }else{
   651    654       style_submenu_element("Timeline", "Timeline",
   652    655          "%s/tkttimeline?name=%T", g.zTop, zUuid);
   653    656     }
   654    657     style_submenu_element("History", "History",
   655    658       "%s/tkthistory/%s", g.zTop, zUuid);
   656    659     style_submenu_element("Status", "Status",
................................................................................
   774    777         if( manifest_parse(&m, &content) && m.type==CFTYPE_TICKET ){
   775    778           @
   776    779           @ <p>Ticket change
   777    780           @ [<a href="%s(g.zTop)/artifact/%T(zChngUuid)">%s(zShort)</a>]
   778    781           @ (rid %d(rid)) by
   779    782           hyperlink_to_user(m.zUser,zDate," on");
   780    783           hyperlink_to_date(zDate, ":");
   781         -        ticket_output_change_artifact(&m);
   782    784           @ </p>
          785  +        ticket_output_change_artifact(&m);
   783    786         }
   784    787         manifest_clear(&m);
   785    788       }
   786    789     }
   787    790     db_finalize(&q);
   788    791     style_footer();
   789    792   }

Changes to src/tktsetup.c.

   128    128         @ <p><font color="red"><b>ERROR: %h(zErr)</b></font></p>
   129    129       }else{
   130    130         db_set(zDbField, z, 0);
   131    131         if( xRebuild ) xRebuild();
   132    132         cgi_redirect("tktsetup");
   133    133       }
   134    134     }
   135         -  @ <form action="%s(g.zBaseURL)/%s(g.zPath)" method="POST">
          135  +  @ <form action="%s(g.zBaseURL)/%s(g.zPath)" method="post"><div>
   136    136     login_insert_csrf_secret();
   137    137     @ <p>%s(zDesc)</p>
   138    138     @ <textarea name="x" rows="%d(height)" cols="80">%h(z)</textarea>
   139         -  @ <blockquote>
   140         -  @ <input type="submit" name="submit" value="Apply Changes">
   141         -  @ <input type="submit" name="clear" value="Revert To Default">
   142         -  @ <input type="submit" name="setup" value="Cancel">
   143         -  @ </blockquote>
   144         -  @ </form>
   145         -  @ <hr>
          139  +  @ <blockquote><p>
          140  +  @ <input type="submit" name="submit" value="Apply Changes" />
          141  +  @ <input type="submit" name="clear" value="Revert To Default" />
          142  +  @ <input type="submit" name="setup" value="Cancel" />
          143  +  @ </p></blockquote>
          144  +  @ </div></form>
          145  +  @ <hr />
   146    146     @ <h2>Default %s(zTitle)</h2>
   147    147     @ <blockquote><pre>
   148    148     @ %h(zDfltValue)
   149    149     @ </pre></blockquote>
   150    150     style_footer();
   151    151   }
   152    152   
   153    153   /*
   154    154   ** WEBPAGE: tktsetup_tab
   155    155   */
   156    156   void tktsetup_tab_page(void){
   157    157     static const char zDesc[] =
   158         -  @ <p>Enter a valid CREATE TABLE statement for the "ticket" table.  The
          158  +  @ Enter a valid CREATE TABLE statement for the "ticket" table.  The
   159    159     @ table must contain columns named "tkt_id", "tkt_uuid", and "tkt_mtime"
   160         -  @ with an unique index on "tkt_uuid" and "tkt_mtime".</p>
          160  +  @ with an unique index on "tkt_uuid" and "tkt_mtime".
   161    161     ;
   162    162     tktsetup_generic(
   163    163       "Ticket Table Schema",
   164    164       "ticket-table",
   165    165       zDefaultTicketTable,
   166    166       zDesc,
   167    167       ticket_schema_check,
................................................................................
   227    227   }
   228    228   
   229    229   /*
   230    230   ** WEBPAGE: tktsetup_com
   231    231   */
   232    232   void tktsetup_com_page(void){
   233    233     static const char zDesc[] =
   234         -  @ <p>Enter TH1 script that initializes variables prior to generating
   235         -  @ any of the ticket view, edit, or creation pages.</p>
          234  +  @ Enter TH1 script that initializes variables prior to generating
          235  +  @ any of the ticket view, edit, or creation pages.
   236    236     ;
   237    237     tktsetup_generic(
   238    238       "Ticket Common Script",
   239    239       "ticket-common",
   240    240       zDefaultTicketCommon,
   241    241       zDesc,
   242    242       0,
................................................................................
   248    248   static const char zDefaultNew[] =
   249    249   @ <th1>
   250    250   @   if {[info exists submit]} {
   251    251   @      set status Open
   252    252   @      submit_ticket
   253    253   @   }
   254    254   @ </th1>
   255         -@ <h1 align="center">Enter A New Ticket</h1>
          255  +@ <h1 style="text-align: center;">Enter A New Ticket</h1>
   256    256   @ <table cellpadding="5">
   257    257   @ <tr>
   258    258   @ <td colspan="2">
   259         -@ Enter a one-line summary of the ticket:<br>
   260         -@ <input type="text" name="title" size="60" value="$<title>">
          259  +@ Enter a one-line summary of the ticket:<br />
          260  +@ <input type="text" name="title" size="60" value="$<title>" />
   261    261   @ </td>
   262    262   @ </tr>
   263    263   @ 
   264    264   @ <tr>
   265         -@ <td align="right">Type:
          265  +@ <td style="text-align: center;">Type:
   266    266   @ <th1>combobox type $type_choices 1</th1>
   267    267   @ </td>
   268    268   @ <td>What type of ticket is this?</td>
   269    269   @ </tr>
   270    270   @ 
   271    271   @ <tr>
   272         -@ <td align="right">Version: 
   273         -@ <input type="text" name="foundin" size="20" value="$<foundin>">
          272  +@ <td style="text-align: center;">Version: 
          273  +@ <input type="text" name="foundin" size="20" value="$<foundin>" />
   274    274   @ </td>
   275    275   @ <td>In what version or build number do you observe the problem?</td>
   276    276   @ </tr>
   277    277   @ 
   278    278   @ <tr>
   279         -@ <td align="right">Severity:
          279  +@ <td style="text-align: center;">Severity:
   280    280   @ <th1>combobox severity $severity_choices 1</th1>
   281    281   @ </td>
   282    282   @ <td>How debilitating is the problem?  How badly does the problem
   283    283   @ affect the operation of the product?</td>
   284    284   @ </tr>
   285    285   @ 
   286    286   @ <tr>
   287         -@ <td align="right">EMail:
   288         -@ <input type="text" name="private_contact" value="$<private_contact>" size="30">
          287  +@ <td style="text-align: center;">EMail:
          288  +@ <input type="text" name="private_contact" value="$<private_contact>" size="30" />
   289    289   @ </td>
   290         -@ <td><u>Not publicly visible</u>. Used by developers to contact you with
   291         -@ questions.</td>
          290  +@ <td><span style="text-decoration: underline;">Not publicly visible</span>.
          291  +@ Used by developers to contact you with questions.</td>
   292    292   @ </tr>
   293    293   @ 
   294    294   @ <tr>
   295    295   @ <td colspan="2">
   296    296   @ Enter a detailed description of the problem.
   297    297   @ For code defects, be sure to provide details on exactly how
   298    298   @ the problem can be reproduced.  Provide as much detail as
   299    299   @ possible.
   300         -@ <br>
          300  +@ <br />
   301    301   @ <th1>set nline [linecount $comment 50 10]</th1>
   302    302   @ <textarea name="comment" cols="80" rows="$nline"
   303         -@  wrap="virtual" class="wikiedit">$<comment></textarea><br>
   304         -@ <input type="submit" name="preview" value="Preview">
          303  +@  wrap="virtual" class="wikiedit">$<comment></textarea><br />
          304  +@ <input type="submit" name="preview" value="Preview" /></td>
   305    305   @ </tr>
   306    306   @
   307    307   @ <th1>enable_output [info exists preview]</th1>
   308    308   @ <tr><td colspan="2">
   309         -@ Description Preview:<br><hr>
          309  +@ Description Preview:<br /><hr />
   310    310   @ <th1>wiki $comment</th1>
   311         -@ <hr>
          311  +@ <hr />
   312    312   @ </td></tr>
   313    313   @ <th1>enable_output 1</th1>
   314    314   @ 
   315    315   @ <tr>
   316         -@ <td align="right">
   317         -@ <input type="submit" name="submit" value="Submit">
          316  +@ <td style="text-align: center;">
          317  +@ <input type="submit" name="submit" value="Submit" />
   318    318   @ </td>
   319    319   @ <td>After filling in the information above, press this button to create
   320    320   @ the new ticket</td>
   321    321   @ </tr>
   322    322   @ <tr>
   323         -@ <td align="right">
   324         -@ <input type="submit" name="cancel" value="Cancel">
          323  +@ <td style="text-align: center;">
          324  +@ <input type="submit" name="cancel" value="Cancel" />
   325    325   @ </td>
   326    326   @ <td>Abandon and forget this ticket</td>
   327    327   @ </tr>
   328    328   @ </table>
   329    329   ;
   330    330   
   331    331   /*
................................................................................
   336    336   }
   337    337   
   338    338   /*
   339    339   ** WEBPAGE: tktsetup_newpage
   340    340   */
   341    341   void tktsetup_newpage_page(void){
   342    342     static const char zDesc[] =
   343         -  @ <p>Enter HTML with embedded TH1 script that will render the "new ticket"
   344         -  @ page</p>
          343  +  @ Enter HTML with embedded TH1 script that will render the "new ticket"
          344  +  @ page
   345    345     ;
   346    346     tktsetup_generic(
   347    347       "HTML For New Tickets",
   348    348       "ticket-newpage",
   349    349       zDefaultNew,
   350    350       zDesc,
   351    351       0,
................................................................................
   352    352       0,
   353    353       40
   354    354     );
   355    355   }
   356    356   
   357    357   static const char zDefaultView[] =
   358    358   @ <table cellpadding="5">
   359         -@ <tr><td align="right">Ticket&nbsp;UUID:</td><td bgcolor="#d0d0d0" colspan="3">
   360         -@ $<tkt_uuid>
   361         -@ </td></tr>
   362         -@ <tr><td align="right">Title:</td>
   363         -@ <td bgcolor="#d0d0d0" colspan="3" valign="top">
          359  +@ <tr><td class="tktDspLabel">Ticket&nbsp;UUID:</td>
          360  +@ <td class="tktDspValue" colspan="3">$<tkt_uuid></td></tr>
          361  +@ <tr><td class="tktDspLabel">Title:</td>
          362  +@ <td class="tktDspValue" colspan="3">
   364    363   @ <th1>wiki $title</th1>
   365    364   @ </td></tr>
   366         -@ <tr><td align="right">Status:</td><td bgcolor="#d0d0d0">
          365  +@ <tr><td class="tktDspLabel">Status:</td><td class="tktDspValue">
   367    366   @ $<status>
   368    367   @ </td>
   369         -@ <td align="right">Type:</td><td bgcolor="#d0d0d0">
          368  +@ <td class="tktDspLabel">Type:</td><td class="tktDspValue">
   370    369   @ $<type>
   371    370   @ </td></tr>
   372         -@ <tr><td align="right">Severity:</td><td bgcolor="#d0d0d0">
          371  +@ <tr><td class="tktDspLabel">Severity:</td><td class="tktDspValue">
   373    372   @ $<severity>
   374    373   @ </td>
   375         -@ <td align="right">Priority:</td><td bgcolor="#d0d0d0">
          374  +@ <td class="tktDspLabel">Priority:</td><td class="tktDspValue">
   376    375   @ $<priority>
   377    376   @ </td></tr>
   378         -@ <tr><td align="right">Subsystem:</td><td bgcolor="#d0d0d0">
          377  +@ <tr><td class="tktDspLabel">Subsystem:</td><td class="tktDspValue">
   379    378   @ $<subsystem>
   380    379   @ </td>
   381         -@ <td align="right">Resolution:</td><td bgcolor="#d0d0d0">
          380  +@ <td class="tktDspLabel">Resolution:</td><td class="tktDspValue">
   382    381   @ $<resolution>
   383    382   @ </td></tr>
   384         -@ <tr><td align="right">Last&nbsp;Modified:</td><td bgcolor="#d0d0d0">
          383  +@ <tr><td class="tktDspLabel">Last&nbsp;Modified:</td><td class="tktDspValue">
   385    384   @ $<tkt_datetime>
   386    385   @ </td>
   387    386   @ <th1>enable_output [hascap e]</th1>
   388         -@   <td align="right">Contact:</td><td bgcolor="#d0d0d0">
          387  +@   <td class="tktDspLabel">Contact:</td><td class="tktDspValue">
   389    388   @   $<private_contact>
   390    389   @   </td>
   391    390   @ <th1>enable_output 1</th1>
   392    391   @ </tr>
   393         -@ <tr><td align="right">Version&nbsp;Found&nbsp;In:</td>
   394         -@ <td colspan="3" valign="top" bgcolor="#d0d0d0">
          392  +@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td>
          393  +@ <td colspan="3" valign="top" class="tktDspValue">
   395    394   @ $<foundin>
   396    395   @ </td></tr>
   397    396   @ <tr><td>Description &amp; Comments:</td></tr>
   398         -@ <tr><td colspan="4" bgcolor="#d0d0d0">
   399         -@ <span  bgcolor="#d0d0d0"><th1>wiki $comment</th1></span>
          397  +@ <tr><td colspan="4" class="tktDspValue">
          398  +@ <th1>wiki $comment</th1>
   400    399   @ </td></tr>
   401    400   @ </table>
   402    401   ;
   403    402   
   404    403   
   405    404   /*
   406    405   ** Return the code used to generate the view ticket page
................................................................................
   410    409   }
   411    410   
   412    411   /*
   413    412   ** WEBPAGE: tktsetup_viewpage
   414    413   */
   415    414   void tktsetup_viewpage_page(void){
   416    415     static const char zDesc[] =
   417         -  @ <p>Enter HTML with embedded TH1 script that will render the "view ticket"
   418         -  @ page</p>
          416  +  @ Enter HTML with embedded TH1 script that will render the "view ticket" page
   419    417     ;
   420    418     tktsetup_generic(
   421    419       "HTML For Viewing Tickets",
   422    420       "ticket-viewpage",
   423    421       zDefaultView,
   424    422       zDesc,
   425    423       0,
................................................................................
   430    428   
   431    429   static const char zDefaultEdit[] =
   432    430   @ <th1>
   433    431   @   if {![info exists username]} {set username $login}
   434    432   @   if {[info exists submit]} {
   435    433   @     if {[info exists cmappnd]} {
   436    434   @       if {[string length $cmappnd]>0} {
   437         -@         set ctxt "\n\n<hr><i>[htmlize $login]"
          435  +@         set ctxt "\n\n<hr /><i>[htmlize $login]"
   438    436   @         if {$username ne $login} {
   439    437   @           set ctxt "$ctxt claiming to be [htmlize $username]"
   440    438   @         }
   441         -@         set ctxt "$ctxt added on [date]:</i><br>\n$cmappnd"
          439  +@         set ctxt "$ctxt added on [date]:</i><br />\n$cmappnd"
   442    440   @         append_field comment $ctxt
   443    441   @       }
   444    442   @     }
   445    443   @     submit_ticket
   446    444   @   }
   447    445   @ </th1>
   448    446   @ <table cellpadding="5">
   449         -@ <tr><td align="right">Title:</td><td>
   450         -@ <input type="text" name="title" value="$<title>" size="60">
          447  +@ <tr><td class="tktDspLabel">Title:</td><td>
          448  +@ <input type="text" name="title" value="$<title>" size="60" />
   451    449   @ </td></tr>
   452         -@ <tr><td align="right">Status:</td><td>
          450  +@ <tr><td class="tktDspLabel">Status:</td><td>
   453    451   @ <th1>combobox status $status_choices 1</th1>
   454    452   @ </td></tr>
   455         -@ <tr><td align="right">Type:</td><td>
          453  +@ <tr><td class="tktDspLabel">Type:</td><td>
   456    454   @ <th1>combobox type $type_choices 1</th1>
   457    455   @ </td></tr>
   458         -@ <tr><td align="right">Severity:</td><td>
          456  +@ <tr><td class="tktDspLabel">Severity:</td><td>
   459    457   @ <th1>combobox severity $severity_choices 1</th1>
   460    458   @ </td></tr>
   461         -@ <tr><td align="right">Priority:</td><td>
          459  +@ <tr><td class="tktDspLabel">Priority:</td><td>
   462    460   @ <th1>combobox priority $priority_choices 1</th1>
   463    461   @ </td></tr>
   464         -@ <tr><td align="right">Resolution:</td><td>
          462  +@ <tr><td class="tktDspLabel">Resolution:</td><td>
   465    463   @ <th1>combobox resolution $resolution_choices 1</th1>
   466    464   @ </td></tr>
   467         -@ <tr><td align="right">Subsystem:</td><td>
          465  +@ <tr><td class="tktDspLabel">Subsystem:</td><td>
   468    466   @ <th1>combobox subsystem $subsystem_choices 1</th1>
   469    467   @ </td></tr>
   470    468   @ <th1>enable_output [hascap e]</th1>
   471         -@   <tr><td align="right">Contact:</td><td>
          469  +@   <tr><td class="tktDspLabel">Contact:</td><td>
   472    470   @   <input type="text" name="private_contact" size="40"
   473         -@    value="$<private_contact>">
          471  +@    value="$<private_contact>" />
   474    472   @   </td></tr>
   475    473   @ <th1>enable_output 1</th1>
   476         -@ <tr><td align="right">Version&nbsp;Found&nbsp;In:</td><td>
   477         -@ <input type="text" name="foundin" size="50" value="$<foundin>">
          474  +@ <tr><td class="tktDspLabel">Version&nbsp;Found&nbsp;In:</td><td>
          475  +@ <input type="text" name="foundin" size="50" value="$<foundin>" />
   478    476   @ </td></tr>
   479    477   @ <tr><td colspan="2">
   480    478   @ <th1>
   481    479   @   if {![info exists eall]} {set eall 0}
   482    480   @   if {[info exists aonlybtn]} {set eall 0}
   483    481   @   if {[info exists eallbtn]} {set eall 1}
   484    482   @   if {![hascap w]} {set eall 0}
   485    483   @   if {![info exists cmappnd]} {set cmappnd {}}
   486    484   @   set nline [linecount $comment 15 10]
   487    485   @   enable_output $eall
   488    486   @ </th1>
   489         -@   Description And Comments:<br>
          487  +@   Description And Comments:<br />
   490    488   @   <textarea name="comment" cols="80" rows="$nline"
   491         -@    wrap="virtual" class="wikiedit">$<comment></textarea><br>
   492         -@   <input type="hidden" name="eall" value="1">
   493         -@   <input type="submit" name="aonlybtn" value="Append Remark">
   494         -@   <input type="submit" name="preview1btn" value="Preview">
          489  +@    wrap="virtual" class="wikiedit">$<comment></textarea><br />
          490  +@   <input type="hidden" name="eall" value="1" />
          491  +@   <input type="submit" name="aonlybtn" value="Append Remark" />
          492  +@   <input type="submit" name="preview1btn" value="Preview" />
   495    493   @ <th1>enable_output [expr {!$eall}]</th1>
   496    494   @   Append Remark from 
   497         -@   <input type="text" name="username" value="$<username>" size="30">:<br>
          495  +@   <input type="text" name="username" value="$<username>" size="30" />:<br />
   498    496   @   <textarea name="cmappnd" cols="80" rows="15"
   499         -@    wrap="virtual" class="wikiedit">$<cmappnd></textarea><br>
          497  +@    wrap="virtual" class="wikiedit">$<cmappnd></textarea><br />
   500    498   @ <th1>enable_output [expr {[hascap w] && !$eall}]</th1>
   501         -@   <input type="submit" name="eallbtn" value="Edit All">
          499  +@   <input type="submit" name="eallbtn" value="Edit All" />
   502    500   @ <th1>enable_output [expr {!$eall}]</th1>
   503         -@   <input type="submit" name="preview2btn" value="Preview">
          501  +@   <input type="submit" name="preview2btn" value="Preview" />
   504    502   @ <th1>enable_output 1</th1>
   505    503   @ </td></tr>
   506    504   @
   507    505   @ <th1>enable_output [info exists preview1btn]</th1>
   508    506   @ <tr><td colspan="2">
   509         -@ Description Preview:<br><hr>
          507  +@ Description Preview:<br /><hr />
   510    508   @ <th1>wiki $comment</th1>
   511         -@ <hr>
          509  +@ <hr />
   512    510   @ </td></tr>
   513    511   @ <th1>enable_output [info exists preview2btn]</th1>
   514    512   @ <tr><td colspan="2">
   515         -@ Description Preview:<br><hr>
          513  +@ Description Preview:<br /><hr />
   516    514   @ <th1>wiki $cmappnd</th1>
   517         -@ <hr>
          515  +@ <hr />
   518    516   @ </td></tr>
   519    517   @ <th1>enable_output 1</th1>
   520    518   @
   521    519   @ <tr><td align="right"></td><td>
   522         -@ <input type="submit" name="submit" value="Submit Changes">
   523         -@ <input type="submit" name="cancel" value="Cancel">
          520  +@ <input type="submit" name="submit" value="Submit Changes" />
          521  +@ <input type="submit" name="cancel" value="Cancel" />
   524    522   @ </td></tr>
   525    523   @ </table>
   526    524   ;
   527    525   
   528    526   /*
   529    527   ** Return the code used to generate the edit ticket page
   530    528   */
................................................................................
   533    531   }
   534    532   
   535    533   /*
   536    534   ** WEBPAGE: tktsetup_editpage
   537    535   */
   538    536   void tktsetup_editpage_page(void){
   539    537     static const char zDesc[] =
   540         -  @ <p>Enter HTML with embedded TH1 script that will render the "edit ticket"
   541         -  @ page</p>
          538  +  @ Enter HTML with embedded TH1 script that will render the "edit ticket" page
   542    539     ;
   543    540     tktsetup_generic(
   544    541       "HTML For Editing Tickets",
   545    542       "ticket-editpage",
   546    543       zDefaultEdit,
   547    544       zDesc,
   548    545       0,
................................................................................
   583    580   }
   584    581   
   585    582   /*
   586    583   ** WEBPAGE: tktsetup_reportlist
   587    584   */
   588    585   void tktsetup_reportlist(void){
   589    586     static const char zDesc[] =
   590         -  @ <p>Enter HTML with embedded TH1 script that will render the "report list"
   591         -  @ page</p>
          587  +  @ Enter HTML with embedded TH1 script that will render the "report list" page
   592    588     ;
   593    589     tktsetup_generic(
   594    590       "HTML For Report List",
   595    591       "ticket-reportlist",
   596    592       zDefaultReportList,
   597    593       zDesc,
   598    594       0,
................................................................................
   631    627   }
   632    628   
   633    629   /*
   634    630   ** WEBPAGE: tktsetup_rpttplt
   635    631   */
   636    632   void tktsetup_rpttplt_page(void){
   637    633     static const char zDesc[] =
   638         -  @ <p>Enter the default ticket report format template.  This is the
          634  +  @ Enter the default ticket report format template.  This is the
   639    635     @ the template report format that initially appears when creating a
   640         -  @ new ticket summary report.</p>
          636  +  @ new ticket summary report.
   641    637     ;
   642    638     tktsetup_generic(
   643    639       "Default Report Template",
   644    640       "ticket-report-template",
   645    641       zDefaultReport,
   646    642       zDesc,
   647    643       0,
................................................................................
   672    668   }
   673    669   
   674    670   /*
   675    671   ** WEBPAGE: tktsetup_keytplt
   676    672   */
   677    673   void tktsetup_keytplt_page(void){
   678    674     static const char zDesc[] =
   679         -  @ <p>Enter the default ticket report color-key template.  This is the
          675  +  @ Enter the default ticket report color-key template.  This is the
   680    676     @ the color-key that initially appears when creating a
   681         -  @ new ticket summary report.</p>
          677  +  @ new ticket summary report.
   682    678     ;
   683    679     tktsetup_generic(
   684    680       "Default Report Color-Key Template",
   685    681       "ticket-key-template",
   686    682       zDefaultKey,
   687    683       zDesc,
   688    684       0,
................................................................................
   701    697     }
   702    698   
   703    699     if( P("setup") ){
   704    700       cgi_redirect("tktsetup");
   705    701     }
   706    702     style_header("Ticket Display On Timelines");
   707    703     db_begin_transaction();
   708         -  @ <form action="%s(g.zBaseURL)/tktsetup_timeline" method="POST">
          704  +  @ <form action="%s(g.zBaseURL)/tktsetup_timeline" method="post"><div>
   709    705     login_insert_csrf_secret();
   710    706   
   711         -  @ <hr>
          707  +  @ <hr />
   712    708     entry_attribute("Ticket Title", 40, "ticket-title-expr", "t", "title");
   713    709     @ <p>An SQL expression in a query against the TICKET table that will
   714    710     @ return the title of the ticket for display purposes.</p>
   715    711   
   716         -  @ <hr>
          712  +  @ <hr />
   717    713     entry_attribute("Ticket Status", 40, "ticket-status-column", "s", "status");
   718    714     @ <p>The name of the column in the TICKET table that contains the ticket
   719    715     @ status in human-readable form.  Case sensitive.</p>
   720    716   
   721         -  @ <hr>
          717  +  @ <hr />
   722    718     entry_attribute("Ticket Closed", 40, "ticket-closed-expr", "c",
   723    719                     "status='Closed'");
   724    720     @ <p>An SQL expression that evaluates to true in a TICKET table query if
   725    721     @ the ticket is closed.</p>
   726    722   
   727         -  @ <hr>
          723  +  @ <hr />
   728    724     @ <p>
   729         -  @ <input type="submit"  name="submit" value="Apply Changes">
   730         -  @ <input type="submit" name="setup" value="Cancel">
          725  +  @ <input type="submit"  name="submit" value="Apply Changes" />
          726  +  @ <input type="submit" name="setup" value="Cancel" />
   731    727     @ </p>
   732         -  @ </form>
          728  +  @ </div></form>
   733    729     db_end_transaction(0);
   734    730     style_footer();
   735    731     
   736    732   }

Changes to src/translate.c.

    64     64     }
    65     65   }
    66     66   
    67     67   /*
    68     68   ** Translate the input stream into the output stream
    69     69   */
    70     70   static void trans(FILE *in, FILE *out){
    71         -  int i, j, k;        /* Loop counters */
    72         -  char c1, c2;        /* Characters used to start a comment */
    73         -  int lastWasEq = 0;  /* True if last non-whitespace character was "=" */
    74         -  char zLine[2000];   /* A single line of input */
    75         -  char zOut[4000];    /* The input line translated into appropriate output */
           71  +  int i, j, k;          /* Loop counters */
           72  +  char c1, c2;          /* Characters used to start a comment */
           73  +  int lastWasEq = 0;    /* True if last non-whitespace character was "=" */
           74  +  int lastWasComma = 0; /* True if last non-whitespace character was "," */
           75  +  char zLine[2000];     /* A single line of input */
           76  +  char zOut[4000];      /* The input line translated into appropriate output */
    76     77   
    77     78     c1 = c2 = '-';
    78     79     while( fgets(zLine, sizeof(zLine), in) ){
    79     80       for(i=0; zLine[i] && isspace(zLine[i]); i++){}
    80     81       if( zLine[i]!='@' ){
    81     82         if( inPrint || inStr ) end_block(out);
    82     83         fprintf(out,"%s",zLine);
................................................................................
    83     84                          /* 0123456789 12345 */
    84     85         if( strncmp(zLine, "/* @-comment: ", 14)==0 ){
    85     86           c1 = zLine[14];
    86     87           c2 = zLine[15];
    87     88         }
    88     89         i += strlen(&zLine[i]);
    89     90         while( i>0 && isspace(zLine[i-1]) ){ i--; }
    90         -      lastWasEq = i>0 && zLine[i-1]=='=';
    91         -    }else if( lastWasEq ){
           91  +      lastWasEq    = i>0 && zLine[i-1]=='=';
           92  +      lastWasComma = i>0 && zLine[i-1]==',';
           93  +    }else if( lastWasEq || lastWasComma){
    92     94         /* If the last non-whitespace character before the first @ was
    93         -      ** an "=" then generate a string literal.  But skip comments
           95  +      ** an "="(var init/set) or a ","(const definition in list) then
           96  +      ** generate a string literal.  But skip comments
    94     97         ** consisting of all text between c1 and c2 (default "--")
    95     98         ** and end of line.
    96     99         */
    97    100         int indent, omitline;
    98    101         i++;
    99    102         if( isspace(zLine[i]) ){ i++; }
   100    103         indent = i - 2;

Changes to src/update.c.

   109    109         fossil_fatal("Multiple descendants");
   110    110       }
   111    111       tid = db_int(0, "SELECT rid FROM leaves, event"
   112    112                       " WHERE event.objid=leaves.rid"
   113    113                       " ORDER BY event.mtime DESC"); 
   114    114     }
   115    115   
          116  +  if( tid==vid ) return;  /* Nothing to update */
   116    117     db_begin_transaction();
   117    118     vfile_check_signature(vid, 1);
   118    119     if( !nochangeFlag ) undo_begin();
   119    120     load_vfile_from_rid(tid);
   120    121   
   121    122     /*
   122    123     ** The record.fn field is used to match files against each other.  The

Changes to src/url.c.

   349    349       }
   350    350       if( zName2 && strcmp(zName2,p->azName[i])==0 ){
   351    351         zName2 = 0;
   352    352         z = zValue2;
   353    353         if( z==0 ) continue;
   354    354       }
   355    355       blob_appendf(&p->url, "%s%s=%T", zSep, p->azName[i], z);
   356         -    zSep = "&";
          356  +    zSep = "&amp;";
   357    357     }
   358    358     if( zName1 && zValue1 ){
   359    359       blob_appendf(&p->url, "%s%s=%T", zSep, zName1, zValue1);
   360    360     }
   361    361     if( zName2 && zValue2 ){
   362    362       blob_appendf(&p->url, "%s%s=%T", zSep, zName2, zValue2);
   363    363     }

Changes to src/wiki.c.

    46     46   }
    47     47   
    48     48   /*
    49     49   ** Output rules for well-formed wiki pages
    50     50   */
    51     51   static void well_formed_wiki_name_rules(void){
    52     52     @ <ul>
    53         -  @ <li> Must not begin or end with a space.
           53  +  @ <li> Must not begin or end with a space.</li>
    54     54     @ <li> Must not contain any control characters, including tab or
    55         -  @      newline.
    56         -  @ <li> Must not have two or more spaces in a row internally.
    57         -  @ <li> Must be between 3 and 100 characters in length.
           55  +  @      newline.</li>
           56  +  @ <li> Must not have two or more spaces in a row internally.</li>
           57  +  @ <li> Must be between 3 and 100 characters in length.</li>
    58     58     @ </ul>
    59     59   }
    60     60   
    61     61   /*
    62     62   ** Check a wiki name.  If it is not well-formed, then issue an error
    63     63   ** and return true.  If it is well-formed, return false.
    64     64   */
    65     65   static int check_name(const char *z){
    66     66     if( !wiki_name_is_wellformed((const unsigned char *)z) ){
    67     67       style_header("Wiki Page Name Error");
    68         -    @ The wiki name "<b>%h(z)</b>" is not well-formed.  Rules for
    69         -    @ wiki page names:
           68  +    @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
           69  +    @ Rules for wiki page names:
    70     70       well_formed_wiki_name_rules();
    71     71       style_footer();
    72     72       return 1;
    73     73     }
    74     74     return 0;
    75     75   }
    76     76   
................................................................................
   153    153       @ <li> Use the <a href="%s(g.zBaseURL)/wiki?name=Sandbox">Sandbox</a>
   154    154       @      to experiment.</li>
   155    155       if( g.okNewWiki ){
   156    156         @ <li>  Create a <a href="%s(g.zBaseURL)/wikinew">new wiki page</a>.</li>
   157    157       }
   158    158       @ <li> <a href="%s(g.zBaseURL)/wcontent">List of All Wiki Pages</a>
   159    159       @      available on this server.</li>
   160         -	@ <li> <form method="GET" action="%s(g.zBaseURL)/wfind">
   161         -	@     Search wiki titles: <input type="text" name="title"/>
   162         -        @  &nbsp; <input type="submit" />
   163         -	@ </li>
          160  +    @ <li> <form method="get" action="%s(g.zBaseURL)/wfind"><div>
          161  +    @     Search wiki titles: <input type="text" name="title"/>
          162  +    @  &nbsp; <input type="submit" /></div></form>
          163  +    @ </li>
   164    164       @ </ul>
   165    165       style_footer();
   166    166       return;
   167    167     }
   168    168     if( check_name(zPageName) ) return;
   169    169     isSandbox = is_sandbox(zPageName);
   170    170     if( isSandbox ){
................................................................................
   192    192     if( !g.isHome ){
   193    193       if( (rid && g.okWrWiki) || (!rid && g.okNewWiki) ){
   194    194         style_submenu_element("Edit", "Edit Wiki Page", "%s/wikiedit?name=%T",
   195    195              g.zTop, zPageName);
   196    196       }
   197    197       if( rid && g.okApndWiki && g.okAttach ){
   198    198         style_submenu_element("Attach", "Add An Attachment",
   199         -           "%s/attachadd?page=%T&from=%s/wiki%%3fname=%T",
          199  +           "%s/attachadd?page=%T&amp;from=%s/wiki%%3fname=%T",
   200    200              g.zTop, zPageName, g.zTop, zPageName);
   201    201       }
   202    202       if( rid && g.okApndWiki ){
   203    203         style_submenu_element("Append", "Add A Comment", "%s/wikiappend?name=%T",
   204    204              g.zTop, zPageName);
   205    205       }
   206    206       if( g.okHistory ){
................................................................................
   225    225       const char *zUser = db_column_text(&q, 2);
   226    226       if( cnt==0 ){
   227    227         @ <hr><h2>Attachments:</h2>
   228    228         @ <ul>
   229    229       }
   230    230       cnt++;
   231    231       if( g.okHistory && g.okRead ){
   232         -      @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)">
          232  +      @ <li>
          233  +      @ <a href="%s(g.zTop)/attachview?page=%s(zPageName)&amp;file=%t(zFile)">
   233    234         @ %h(zFile)</a>
   234    235       }else{
   235    236         @ <li>%h(zFile)
   236    237       }
   237    238       @ added by %h(zUser) on
   238    239       hyperlink_to_date(zDate, ".");
   239    240       if( g.okWrWiki && g.okAttach ){
   240         -      @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>]
          241  +      @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&amp;file=%t(zFile)&amp;from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>]
   241    242       }
   242    243     }
   243    244     if( cnt ){
   244    245       @ </ul>
   245    246     }
   246    247     db_finalize(&q);
   247    248    
................................................................................
   349    350       zBody = mprintf("<i>Empty Page</i>");
   350    351     }
   351    352     zHtmlPageName = mprintf("Edit: %s", zPageName);
   352    353     style_header(zHtmlPageName);
   353    354     if( P("preview")!=0 ){
   354    355       blob_zero(&wiki);
   355    356       blob_append(&wiki, zBody, -1);
   356         -    @ Preview:<hr>
          357  +    @ Preview:<hr />
   357    358       wiki_convert(&wiki, 0, 0);
   358         -    @ <hr>
          359  +    @ <hr />
   359    360       blob_reset(&wiki);
   360    361     }
   361    362     for(n=2, z=zBody; z[0]; z++){
   362    363       if( z[0]=='\n' ) n++;
   363    364     }
   364    365     if( n<20 ) n = 20;
   365    366     if( n>40 ) n = 40;
   366         -  @ <form method="POST" action="%s(g.zBaseURL)/wikiedit">
          367  +  @ <form method="post" action="%s(g.zBaseURL)/wikiedit"><div>
   367    368     login_insert_csrf_secret();
   368         -  @ <input type="hidden" name="name" value="%h(zPageName)">
          369  +  @ <input type="hidden" name="name" value="%h(zPageName)" />
   369    370     @ <textarea name="w" class="wikiedit" cols="80" 
   370    371     @  rows="%d(n)" wrap="virtual">%h(zBody)</textarea>
   371         -  @ <br>
   372         -  @ <input type="submit" name="preview" value="Preview Your Changes">
   373         -  @ <input type="submit" name="submit" value="Apply These Changes">
   374         -  @ <input type="submit" name="cancel" value="Cancel">
   375         -  @ </form>
          372  +  @ <br />
          373  +  @ <input type="submit" name="preview" value="Preview Your Changes" />
          374  +  @ <input type="submit" name="submit" value="Apply These Changes" />
          375  +  @ <input type="submit" name="cancel" value="Cancel" />
          376  +  @ </div></form>
   376    377     if( !isSandbox ){
   377    378       manifest_clear(&m);
   378    379     }
   379    380     style_footer();
   380    381   }
   381    382   
   382    383   /*
................................................................................
   394    395       return;
   395    396     }  
   396    397     zName = PD("name","");
   397    398     if( zName[0] && wiki_name_is_wellformed((const unsigned char *)zName) ){
   398    399       cgi_redirectf("wikiedit?name=%T", zName);
   399    400     }
   400    401     style_header("Create A New Wiki Page");
   401         -  @ <p>Rules for wiki page names:
          402  +  @ <p>Rules for wiki page names:</p>
   402    403     well_formed_wiki_name_rules();
   403         -  @ </p>
   404         -  @ <form method="POST" action="%s(g.zBaseURL)/wikinew">
          404  +  @ <form method="post" action="%s(g.zBaseURL)/wikinew">
   405    405     @ <p>Name of new wiki page:
   406         -  @ <input type="text" width="35" name="name" value="%h(zName)">
   407         -  @ <input type="submit" value="Create">
          406  +  @ <input style="width: 35;" type="text" name="name" value="%h(zName)" />
          407  +  @ <input type="submit" value="Create" />
   408    408     @ </p></form>
   409    409     if( zName[0] ){
   410         -    @ <p><b><font color="red">
   411         -    @ "%h(zName)" is not a valid wiki page name!</font></b></p>
          410  +    @ <p><span class="wikiError">
          411  +    @ "%h(zName)" is not a valid wiki page name!</span></p>
   412    412     }
   413    413     style_footer();
   414    414   }
   415    415   
   416    416   
   417    417   /*
   418    418   ** Append the wiki text for an remark to the end of the given BLOB.
................................................................................
   535    535       blob_reset(&preview);
   536    536     }
   537    537     zUser = PD("u", g.zLogin);
   538    538     @ <form method="POST" action="%s(g.zBaseURL)/wikiappend">
   539    539     login_insert_csrf_secret();
   540    540     @ <input type="hidden" name="name" value="%h(zPageName)">
   541    541     @ Your Name:
   542         -  @ <input type="text" name="u" size="20" value="%h(zUser)"><br>
   543         -  @ Comment to append:<br>
          542  +  @ <input type="text" name="u" size="20" value="%h(zUser)"><br />
          543  +  @ Comment to append:<br />
   544    544     @ <textarea name="r" class="wikiedit" cols="80" 
   545    545     @  rows="10" wrap="virtual">%h(PD("r",""))</textarea>
   546         -  @ <br>
          546  +  @ <br />
   547    547     @ <input type="submit" name="preview" value="Preview Your Comment">
   548    548     @ <input type="submit" name="submit" value="Append Your Changes">
   549    549     @ <input type="submit" name="cancel" value="Cancel">
   550    550     @ </form>
   551    551     style_footer();
   552    552   }
   553    553   
................................................................................
   558    558   
   559    559   /*
   560    560   ** Function called to output extra text at the end of each line in
   561    561   ** a wiki history listing.
   562    562   */
   563    563   static void wiki_history_extra(int rid){
   564    564     if( db_exists("SELECT 1 FROM tagxref WHERE rid=%d", rid) ){
   565         -    @ <a href="%s(g.zTop)/wdiff?name=%t(zWikiPageName)&a=%d(rid)">[diff]</a>
          565  +    @ <a href="%s(g.zTop)/wdiff?name=%t(zWikiPageName)&amp;a=%d(rid)">[diff]</a>
   566    566     }
   567    567   }
   568    568   
   569    569   /*
   570    570   ** WEBPAGE: whistory
   571    571   ** URL: /whistory?name=PAGENAME
   572    572   **
................................................................................
   738    738     @ <li>Most ordinary HTML works.</li>
   739    739     @ <li>&lt;verbatim&gt; and &lt;nowiki&gt;.</li>
   740    740     @ </ol>
   741    741     @ <p>We call the first five rules above "wiki" formatting rules.  The
   742    742     @ last two rules are the HTML formatting rule.</p>
   743    743     @ <h2>Formatting Rule Details</h2>
   744    744     @ <ol>
   745         -  @ <li> <p><b>Paragraphs</b>.  Any sequence of one or more blank lines forms
          745  +  @ <li> <p><span class="wikiruleHead">Paragraphs</span>.  Any sequence of one or more blank lines forms
   746    746     @ a paragraph break.  Centered or right-justified paragraphs are not
   747    747     @ supported by wiki markup, but you can do these things if you need them
   748         -  @ using HTML.</p>
   749         -  @ <li> <p><b>Bullet Lists</b>.
          748  +  @ using HTML.</p></li>
          749  +  @ <li> <p><span class="wikiruleHead">Bullet Lists</span>.
   750    750     @ A bullet list item is a line that begins with a single "*" character
   751    751     @ surrounded on
   752    752     @ both sides by two or more spaces or by a tab.  Only a single level
   753         -  @ of bullet list is supported by wiki.  For nested lists, use HTML.</p>
   754         -  @ <li> <p><b>Enumeration Lists</b>.
          753  +  @ of bullet list is supported by wiki.  For nested lists, use HTML.</p></li>
          754  +  @ <li> <p><span class="wikiruleHead">Enumeration Lists</span>.
   755    755     @ An enumeration list item is a line that begins with a single "#" character
   756    756     @ surrounded on both sides by two or more spaces or by a tab.  Only a single
   757    757     @ level of enumeration list is supported by wiki.  For nested lists or for
   758         -  @ enumerations that count using letters or roman numerials, use HTML.</p>
   759         -  @ <li> <p><b>Indented Paragraphs</b>.
          758  +  @ enumerations that count using letters or roman numerials, use HTML.</p></li>
          759  +  @ <li> <p><span class="wikiruleHead">Indented Paragraphs</span>.
   760    760     @ Any paragraph that begins with two or more spaces or a tab and
   761    761     @ which is not a bullet or enumeration list item is rendered 
   762    762     @ indented.  Only a single level of indentation is supported by wiki; use
   763         -  @ HTML for deeper indentation.</p>
   764         -  @ <li> <p><b>Hyperlinks</b>.
          763  +  @ HTML for deeper indentation.</p></li>
          764  +  @ <li> <p><span class="wikiruleHead">Hyperlinks</span>.
   765    765     @ Text within square brackets ("[...]") becomes a hyperlink.  The
   766    766     @ target can be a wiki page name, the artifact ID of a check-in or ticket,
   767    767     @ the name of an image, or a URL.  By default, the target is displayed
   768    768     @ as the text of the hyperlink.  But you can specify alternative text
   769    769     @ after the target name separated by a "|" character.</p>
   770    770     @ <p>You can also link to internal anchor names using [#anchor-name], providing
   771    771     @ you have added the necessary "&lt;a name="anchor-name"&gt;&lt;/a&gt;"
   772         -  @ tag to your wiki page.</p>
   773         -  @ <li> <p><b>HTML</b>.
          772  +  @ tag to your wiki page.</p></li>
          773  +  @ <li> <p><span class="wikiruleHead">HTML</span>.
   774    774     @ The following standard HTML elements may be used:
   775    775     @ &lt;a&gt;
   776    776     @ &lt;address&gt;
   777    777     @ &lt;b&gt;
   778    778     @ &lt;big&gt;
   779    779     @ &lt;blockquote&gt;
   780    780     @ &lt;br&gt;
................................................................................
   820    820     @ &lt;var&gt;.
   821    821     @ In addition, there are two non-standard elements available:
   822    822     @ &lt;verbatim&gt; and &lt;nowiki&gt;.
   823    823     @ No other elements are allowed.  All attributes are checked and
   824    824     @ only a few benign attributes are allowed on each element.
   825    825     @ In particular, any attributes that specify javascript or CSS
   826    826     @ are elided.</p></li>
   827         -  @ <li><p><b>Special Markup.</b>
          827  +  @ <li><p><span class="wikiruleHead">Special Markup.</span>
   828    828     @ The &lt;nowiki&gt; tag disables all wiki formatting rules
   829    829     @ through the matching &lt;/nowiki&gt; element.
   830    830     @ The &lt;verbatim&gt; tag works like &lt;pre&gt; with the addition
   831    831     @ that it also disables all wiki and HTML markup
   832         -  @ through the matching &lt;/verbatim&gt;.
          832  +  @ through the matching &lt;/verbatim&gt;.</p></li>
   833    833     @ </ol>
   834    834     style_footer();
   835    835   }
   836    836   
   837    837   /*
   838    838   ** Add a new wiki page to the respository.  The page name is
   839    839   ** given by the zPageName parameter.  isNew must be true to create

Changes to src/wikiformat.c.

   319    319     }
   320    320     return MARKUP_INVALID;
   321    321   }
   322    322   
   323    323   /*
   324    324   ** Token types
   325    325   */
   326         -#define TOKEN_MARKUP        1    /* <...> */
   327         -#define TOKEN_CHARACTER     2    /* "&" or "<" not part of markup */
   328         -#define TOKEN_LINK          3    /* [...] */
   329         -#define TOKEN_PARAGRAPH     4    /* blank lines */
   330         -#define TOKEN_NEWLINE       5    /* A single "\n" */
   331         -#define TOKEN_BUL_LI        6    /*  "  *  " */
   332         -#define TOKEN_NUM_LI        7    /*  "  #  " */
   333         -#define TOKEN_ENUM          8    /*  "  \(?\d+[.)]?  " */
   334         -#define TOKEN_INDENT        9    /*  "   " */
   335         -#define TOKEN_RAW           10   /* Output exactly (used when wiki-use-html==1) */
   336         -#define TOKEN_TEXT          11   /* None of the above */
          326  +#define TOKEN_MARKUP        1  /* <...> */
          327  +#define TOKEN_CHARACTER     2  /* "&" or "<" not part of markup */
          328  +#define TOKEN_LINK          3  /* [...] */
          329  +#define TOKEN_PARAGRAPH     4  /* blank lines */
          330  +#define TOKEN_NEWLINE       5  /* A single "\n" */
          331  +#define TOKEN_BUL_LI        6  /*  "  *  " */
          332  +#define TOKEN_NUM_LI        7  /*  "  #  " */
          333  +#define TOKEN_ENUM          8  /*  "  \(?\d+[.)]?  " */
          334  +#define TOKEN_INDENT        9  /*  "   " */
          335  +#define TOKEN_RAW           10 /* Output exactly (used when wiki-use-html==1) */
          336  +#define TOKEN_TEXT          11 /* None of the above */
   337    337   
   338    338   /*
   339    339   ** State flags
   340    340   */
   341    341   #define AT_NEWLINE          0x001  /* At start of a line */
   342    342   #define AT_PARAGRAPH        0x002  /* At start of a paragraph */
   343    343   #define ALLOW_WIKI          0x004  /* Allow wiki markup */
................................................................................
   743    743   ** Render markup on the given blob.
   744    744   */
   745    745   static void renderMarkup(Blob *pOut, ParsedMarkup *p){
   746    746     int i;
   747    747     if( p->endTag ){
   748    748       blob_appendf(pOut, "</%s>", aMarkup[p->iCode].zName);
   749    749     }else{
          750  +    /* Close active paragraph for several elements, which are not allowed
          751  +    ** in paragraphs in XHTML.
          752  +    */
   750    753       blob_appendf(pOut, "<%s", aMarkup[p->iCode].zName);
   751    754       for(i=0; i<p->nAttr; i++){
   752    755         blob_appendf(pOut, " %s", aAttribute[p->aAttr[i].iACode].zName);
   753    756         if( p->aAttr[i].zValue ){
   754    757           const char *zVal = p->aAttr[i].zValue;
   755    758           if( p->aAttr[i].iACode==ATTR_SRC && zVal[0]=='/' ){
   756    759             blob_appendf(pOut, "=\"%s%s\"", g.zBaseURL, zVal);
   757    760           }else{
   758    761             blob_appendf(pOut, "=\"%s\"", zVal);
   759    762           }
   760    763         }
          764  +    }
          765  +    if (p->iType & MUTYPE_SINGLE){
          766  +      blob_append(pOut, " /", 2);
   761    767       }
   762    768       blob_append(pOut, ">", 1);
   763    769     }
   764    770   }
   765    771   
   766    772   /*
   767    773   ** When the markup was parsed, some "\000" may have been inserted.
................................................................................
   883    889     return p->aStack[i-1].iCode;
   884    890   }
   885    891   
   886    892   /*
   887    893   ** Begin a new paragraph if that something that is needed.
   888    894   */
   889    895   static void startAutoParagraph(Renderer *p){
   890         -  if( p->wantAutoParagraph==0 || p->wikiList==MARKUP_OL || p->wikiList==MARKUP_UL ) return;
   891         -  blob_appendf(p->pOut, "<p>", -1);
          896  +  if( p->wantAutoParagraph==0 ) return;
          897  +  if( p->wikiList==MARKUP_OL || p->wikiList==MARKUP_UL ) return;
          898  +  blob_appendf(p->pOut, "<p type=\"auto\">", -1);
   892    899     pushStack(p, MARKUP_P);
   893    900     p->wantAutoParagraph = 0;
   894    901     p->inAutoParagraph = 1;
   895    902   }
   896    903   
   897    904   /*
   898    905   ** End a paragraph if we are in one.
................................................................................
  1017   1024       int isClosed = 0;
  1018   1025       if( is_ticket(zTarget, &isClosed) ){
  1019   1026         /* Special display processing for tickets.  Display the hyperlink
  1020   1027         ** as crossed out if the ticket is closed.
  1021   1028         */
  1022   1029         if( isClosed ){
  1023   1030           if( g.okHistory ){
  1024         -          blob_appendf(p->pOut,"<a href=\"%s/info/%s\"><s>",
  1025         -              g.zBaseURL, zTarget
         1031  +          blob_appendf(p->pOut,
         1032  +             "<a href=\"%s/info/%s\"><span class=\"wikiTagCancelled\">",
         1033  +             g.zBaseURL, zTarget
  1026   1034             );
  1027         -          zTerm = "</s></a>";
         1035  +          zTerm = "</span></a>";
  1028   1036           }else{
  1029         -          blob_appendf(p->pOut,"<s>");
  1030         -          zTerm = "</s>";
         1037  +          blob_appendf(p->pOut,"<span class=\"wikiTagCancelled\">");
         1038  +          zTerm = "</span>";
  1031   1039           }
  1032   1040         }else{
  1033   1041           if( g.okHistory ){
  1034   1042             blob_appendf(p->pOut,"<a href=\"%s/info/%s\">",
  1035   1043                 g.zBaseURL, zTarget
  1036   1044             );
  1037   1045           }else{
................................................................................
  1131   1139           if( inlineOnly ){
  1132   1140             blob_append(p->pOut, " &bull; ", -1);
  1133   1141           }else{
  1134   1142             if( p->wikiList!=MARKUP_UL ){
  1135   1143               if( p->wikiList ){
  1136   1144                 popStackToTag(p, p->wikiList);
  1137   1145               }
         1146  +            endAutoParagraph(p);
  1138   1147               pushStack(p, MARKUP_UL);
  1139   1148               blob_append(p->pOut, "<ul>", 4);
  1140   1149               p->wikiList = MARKUP_UL;
  1141   1150             }
  1142   1151             popStackToTag(p, MARKUP_LI);
  1143   1152             startAutoParagraph(p);
  1144   1153             pushStack(p, MARKUP_LI);
................................................................................
  1150   1159           if( inlineOnly ){
  1151   1160             blob_append(p->pOut, " # ", -1);
  1152   1161           }else{
  1153   1162             if( p->wikiList!=MARKUP_OL ){
  1154   1163               if( p->wikiList ){
  1155   1164                 popStackToTag(p, p->wikiList);
  1156   1165               }
         1166  +            endAutoParagraph(p);
  1157   1167               pushStack(p, MARKUP_OL);
  1158   1168               blob_append(p->pOut, "<ol>", 4);
  1159   1169               p->wikiList = MARKUP_OL;
  1160   1170             }
  1161   1171             popStackToTag(p, MARKUP_LI);
  1162   1172             startAutoParagraph(p);
  1163   1173             pushStack(p, MARKUP_LI);
................................................................................
  1169   1179           if( inlineOnly ){
  1170   1180             blob_appendf(p->pOut, " (%d) ", atoi(z));
  1171   1181           }else{
  1172   1182             if( p->wikiList!=MARKUP_OL ){
  1173   1183               if( p->wikiList ){
  1174   1184                 popStackToTag(p, p->wikiList);
  1175   1185               }
         1186  +            endAutoParagraph(p);
  1176   1187               pushStack(p, MARKUP_OL);
  1177   1188               blob_append(p->pOut, "<ol>", 4);
  1178   1189               p->wikiList = MARKUP_OL;
  1179   1190             }
  1180   1191             popStackToTag(p, MARKUP_LI);
  1181   1192             startAutoParagraph(p);
  1182   1193             pushStack(p, MARKUP_LI);
................................................................................
  1231   1242           p->state |= FONT_MARKUP_ONLY;
  1232   1243           wiki_render(p, zDisplay);
  1233   1244           p->state = savedState;
  1234   1245           blob_append(p->pOut, zClose, -1);
  1235   1246           break;
  1236   1247         }
  1237   1248         case TOKEN_TEXT: {
  1238         -        startAutoParagraph(p);
         1249  +        int i;
         1250  +        for(i=0; i<n && isspace(z[i]); i++){}
         1251  +        if( i<n ) startAutoParagraph(p);
  1239   1252           blob_append(p->pOut, z, n);
  1240   1253           break;
  1241   1254         }
  1242   1255         case TOKEN_RAW: {
  1243   1256           blob_append(p->pOut, z, n);
  1244   1257           break;
  1245   1258         }
................................................................................
  1345   1358                 p->zVerbatimId = markup.aAttr[0].zValue;
  1346   1359               }else if( markup.aAttr[vAttrIdx].iACode == ATTR_TYPE ){
  1347   1360                 blob_appendf(p->pOut, "<pre name='code' class='%s'>",
  1348   1361                   markup.aAttr[vAttrIdx].zValue);
  1349   1362                 vAttrDidAppend=1;
  1350   1363               }
  1351   1364             }
  1352         -          if( !vAttrDidAppend )
         1365  +          if( !vAttrDidAppend ) {
         1366  +            endAutoParagraph(p);
  1353   1367               blob_append(p->pOut, "<pre class='verbatim'>",-1);
         1368  +          }
  1354   1369             p->wantAutoParagraph = 0;
  1355   1370           }else
  1356   1371           if( markup.iType==MUTYPE_LI ){
  1357   1372             if( backupToType(p, MUTYPE_LIST)==0 ){
         1373  +            endAutoParagraph(p);
  1358   1374               pushStack(p, MARKUP_UL);
  1359   1375               blob_append(p->pOut, "<ul>", 4);
  1360   1376             }
  1361   1377             pushStack(p, MARKUP_LI);
  1362   1378             renderMarkup(p->pOut, &markup);
  1363   1379           }else
  1364   1380           if( markup.iType==MUTYPE_TR ){
................................................................................
  1382   1398             startAutoParagraph(p);
  1383   1399             renderMarkup(p->pOut, &markup);
  1384   1400             pushStack(p, markup.iCode);
  1385   1401           }else
  1386   1402           {
  1387   1403             if( markup.iType==MUTYPE_FONT ){
  1388   1404               startAutoParagraph(p);
  1389         -          }else if( markup.iType==MUTYPE_BLOCK ){
         1405  +          }else if( markup.iType==MUTYPE_BLOCK || markup.iType==MUTYPE_LIST ){
  1390   1406               p->wantAutoParagraph = 0;
         1407  +          }
         1408  +          if(   markup.iCode==MARKUP_HR
         1409  +             || markup.iCode==MARKUP_H1
         1410  +             || markup.iCode==MARKUP_H2
         1411  +             || markup.iCode==MARKUP_H3
         1412  +             || markup.iCode==MARKUP_H4
         1413  +             || markup.iCode==MARKUP_H5
         1414  +             || markup.iCode==MARKUP_P
         1415  +          ){
         1416  +            endAutoParagraph(p);
  1391   1417             }
  1392   1418             if( (markup.iType & MUTYPE_STACK )!=0 ){
  1393   1419               pushStack(p, markup.iCode);
  1394   1420             }
  1395   1421             renderMarkup(p->pOut, &markup);
  1396   1422           }
  1397   1423           break;