Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | More consistancy in using <br /> and <hr /> HTML tags |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
bd559ff0d0db4e833d3843b8c6b95f3e |
| User & Date: | jan.nijtmans 2016-06-15 08:38:44.926 |
Context
|
2016-06-16
| ||
| 09:13 | Use faster table-based approach when checking for invalid utf-8, in stead of complex bit-operations. ... (check-in: 60349a6617 user: jan.nijtmans tags: trunk) | |
|
2016-06-15
| ||
| 08:38 | More consistancy in using <br /> and <hr /> HTML tags ... (check-in: bd559ff0d0 user: jan.nijtmans tags: trunk) | |
|
2016-06-14
| ||
| 14:11 | Forgot close tag in previous commit ... (check-in: 3b3310a7b3 user: jan.nijtmans tags: trunk) | |
Changes
Changes to src/attach.c.
| ︙ | ︙ | |||
24 25 26 27 28 29 30 | /* ** WEBPAGE: attachlist ** List attachments. ** ** tkt=TICKETUUID ** page=WIKIPAGE ** | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
/*
** WEBPAGE: attachlist
** List attachments.
**
** tkt=TICKETUUID
** page=WIKIPAGE
**
** At most one of technote=, tkt= or page= are supplied.
** If none is given, all attachments are listed. If one is given,
** only attachments for the designated technote, ticket or wiki page
** are shown. TECHNOTEUUID and TICKETUUID may be just a prefix of the
** relevant technical note or ticket, in which case all attachments
** of all technical notes or tickets with the prefix will be listed.
*/
void attachlist_page(void){
|
| ︙ | ︙ | |||
107 108 109 110 111 112 113 |
zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
}
@ <li><p>
@ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>
if( moderation_pending(attachid) ){
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
}
| | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
zUrlTail = mprintf("page=%t&file=%t", zTarget, zFilename);
}
@ <li><p>
@ Attachment %z(href("%R/ainfo/%!S",zUuid))%S(zUuid)</a>
if( moderation_pending(attachid) ){
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
}
@ <br /><a href="%R/attachview?%s(zUrlTail)">%h(zFilename)</a>
@ [<a href="%R/attachdownload/%t(zFilename)?%s(zUrlTail)">download</a>]<br />
if( zComment ) while( fossil_isspace(zComment[0]) ) zComment++;
if( zComment && zComment[0] ){
@ %!W(zComment)<br />
}
if( zPage==0 && zTkt==0 && zTechNote==0 ){
if( zSrc==0 || zSrc[0]==0 ){
|
| ︙ | ︙ | |||
356 357 358 359 360 361 362 |
zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
" WHERE tagname GLOB 'event-%q*'", zTechNote);
if( zTechNote==0) fossil_redirect_home();
}
zTarget = zTechNote;
zTargetType = mprintf("Tech Note <a href=\"%R/technote/%s\">%S</a>",
zTechNote, zTechNote);
| | | 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 |
zTechNote = db_text(0, "SELECT substr(tagname,7) FROM tag"
" WHERE tagname GLOB 'event-%q*'", zTechNote);
if( zTechNote==0) fossil_redirect_home();
}
zTarget = zTechNote;
zTargetType = mprintf("Tech Note <a href=\"%R/technote/%s\">%S</a>",
zTechNote, zTechNote);
}else{
if( g.perm.ApndTkt==0 || g.perm.Attach==0 ){
login_needed(g.anon.ApndTkt && g.anon.Attach);
return;
}
if( !db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'", zTkt) ){
zTkt = db_text(0, "SELECT substr(tagname,5) FROM tag"
|
| ︙ | ︙ | |||
491 492 493 494 495 496 497 |
if( g.perm.Write && g.perm.WrWiki ){
style_submenu_element("Delete","Delete","%R/ainfo/%s?del", zUuid);
}
}
zDate = db_text(0, "SELECT datetime(%.12f)", pAttach->rDate);
if( P("confirm")
| | | 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 |
if( g.perm.Write && g.perm.WrWiki ){
style_submenu_element("Delete","Delete","%R/ainfo/%s?del", zUuid);
}
}
zDate = db_text(0, "SELECT datetime(%.12f)", pAttach->rDate);
if( P("confirm")
&& ((zTktUuid && g.perm.WrTkt) ||
(zWikiName && g.perm.WrWiki) ||
(zTNUuid && g.perm.Write && g.perm.WrWiki))
){
int i, n, rid;
char *zDate;
Blob manifest;
Blob cksum;
|
| ︙ | ︙ | |||
625 626 627 628 629 630 631 |
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
| | | 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
@ <i>(file is %d(sz) bytes of image data)</i><br />
@ <img src="%R/raw/%s(zSrc)?m=%s(zMime)"></img>
style_submenu_element("Image", "Image", "%R/raw/%s?m=%s", zSrc, zMime);
}else{
int sz = db_int(0, "SELECT size FROM blob WHERE rid=%d", ridSrc);
@ <i>(file is %d(sz) bytes of binary data)</i>
}
@ </blockquote>
|
| ︙ | ︙ | |||
728 729 730 731 732 733 734 |
usage("add PAGENAME FILENAME");
}
zPageName = g.argv[3];
rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
" ORDER BY x.mtime DESC LIMIT 1",
zPageName
| | | 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 |
usage("add PAGENAME FILENAME");
}
zPageName = g.argv[3];
rid = db_int(0, "SELECT x.rid FROM tag t, tagxref x"
" WHERE x.tagid=t.tagid AND t.tagname='wiki-%q'"
" ORDER BY x.mtime DESC LIMIT 1",
zPageName
);
if( (pWiki = manifest_get(rid, CFTYPE_WIKI, 0))!=0 ){
zBody = pWiki->zWiki;
}
if( zBody==0 ){
fossil_fatal("wiki page [%s] not found",zPageName);
}
zTarget = zPageName;
|
| ︙ | ︙ |
Changes to src/browse.c.
| ︙ | ︙ | |||
1086 1087 1088 1089 1090 1091 1092 |
@ <td>
db_bind_int(&q2, ":mid", mid);
while( db_step(&q2)==SQLITE_ROW ){
const char *zFUuid = db_column_text(&q2,0);
const char *zFile = db_column_text(&q2,1);
int fid = db_column_int(&q2,2);
if( showId ){
| | | | 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 |
@ <td>
db_bind_int(&q2, ":mid", mid);
while( db_step(&q2)==SQLITE_ROW ){
const char *zFUuid = db_column_text(&q2,0);
const char *zFile = db_column_text(&q2,1);
int fid = db_column_int(&q2,2);
if( showId ){
@ %z(href("%R/artifact/%!S",zFUuid))%h(zFile)</a> (%d(fid))<br />
}else{
@ %z(href("%R/artifact/%!S",zFUuid))%h(zFile)</a><br />
}
}
db_reset(&q2);
@ </td>
@ <td>
@ %z(href("%R/info/%!S",zUuid))[%S(zUuid)]</a>
if( showId ){
|
| ︙ | ︙ |
Changes to src/cache.c.
| ︙ | ︙ | |||
235 236 237 238 239 240 241 |
*/
void cache_initialize(void){
sqlite3_close(cacheOpen(1));
}
/*
** COMMAND: cache*
| | | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
*/
void cache_initialize(void){
sqlite3_close(cacheOpen(1));
}
/*
** COMMAND: cache*
**
** Usage: %fossil cache SUBCOMMAND
**
** Manage the cache used for potentially expensive web pages such as
** /zip and /tarball. SUBCOMMAND can be:
**
** clear Remove all entries from the cache.
**
|
| ︙ | ︙ | |||
354 355 356 357 358 359 360 |
" FROM cache"
" ORDER BY tm DESC"
);
if( pStmt ){
@ <ol>
while( sqlite3_step(pStmt)==SQLITE_ROW ){
const unsigned char *zName = sqlite3_column_text(pStmt,0);
| | | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 |
" FROM cache"
" ORDER BY tm DESC"
);
if( pStmt ){
@ <ol>
while( sqlite3_step(pStmt)==SQLITE_ROW ){
const unsigned char *zName = sqlite3_column_text(pStmt,0);
@ <li><p>%z(href("%R/cacheget?key=%T",zName))%h(zName)</a><br />
@ size: %s(sqlite3_column_text(pStmt,1))
@ hit-count: %d(sqlite3_column_int(pStmt,2))
@ last-access: %s(sqlite3_column_text(pStmt,3))</p></li>
}
sqlite3_finalize(pStmt);
@ </ol>
}
|
| ︙ | ︙ |
Changes to src/finfo.c.
| ︙ | ︙ | |||
529 530 531 532 533 534 535 |
if( fpid>0 ){
@ %z(href("%R/fdiff?sbs=1&v1=%!S&v2=%!S",zPUuid,zUuid))[diff]</a>
}
}
if( fDebug & FINFO_DEBUG_MLINK ){
int ii;
char *zAncLink;
| | | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 |
if( fpid>0 ){
@ %z(href("%R/fdiff?sbs=1&v1=%!S&v2=%!S",zPUuid,zUuid))[diff]</a>
}
}
if( fDebug & FINFO_DEBUG_MLINK ){
int ii;
char *zAncLink;
@ <br />fid=%d(frid) pid=%d(fpid) mid=%d(fmid)
if( nParent>0 ){
@ parents=%d(aParent[0])
for(ii=1; ii<nParent; ii++){
@ %d(aParent[ii])
}
}
zAncLink = href("%R/finfo?name=%T&ci=%!S&debug=1",zFilename,zCkin);
|
| ︙ | ︙ | |||
571 572 573 574 575 576 577 |
** a particular check-in. This screen is intended for use by developers
** in debugging Fossil.
*/
void mlink_page(void){
const char *zFName = P("name");
const char *zCI = P("ci");
Stmt q;
| | | 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
** a particular check-in. This screen is intended for use by developers
** in debugging Fossil.
*/
void mlink_page(void){
const char *zFName = P("name");
const char *zCI = P("ci");
Stmt q;
login_check_credentials();
if( !g.perm.Admin ){ login_needed(g.anon.Admin); return; }
style_header("MLINK Table");
if( zFName==0 && zCI==0 ){
@ <span class='generalError'>
@ Requires either a name= or ci= query parameter
@ </span>
|
| ︙ | ︙ | |||
674 675 676 677 678 679 680 |
/* 6 */ " mperm,"
/* 7 */ " isaux"
" FROM mlink WHERE mid=%d ORDER BY 1",
mid
);
@ <h1>MLINK table for check-in %h(zCI)</h1>
render_checkin_context(mid, 1);
| | | 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 |
/* 6 */ " mperm,"
/* 7 */ " isaux"
" FROM mlink WHERE mid=%d ORDER BY 1",
mid
);
@ <h1>MLINK table for check-in %h(zCI)</h1>
render_checkin_context(mid, 1);
@ <hr />
@ <div class='brlist'>
@ <table id='mlinktable'>
@ <thead><tr>
@ <th>File</th>
@ <th>From</th>
@ <th>Merge?</th>
@ <th>New</th>
|
| ︙ | ︙ |
Changes to src/info.c.
| ︙ | ︙ | |||
1347 1348 1349 1350 1351 1352 1353 |
objType |= OBJTYPE_CHECKIN;
}else if( zType[0]=='e' ){
if( eventTagId != 0) {
@ Instance of technote
objType |= OBJTYPE_EVENT;
hyperlink_to_event_tagid(db_column_int(&q, 5));
}else{
| | | 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 |
objType |= OBJTYPE_CHECKIN;
}else if( zType[0]=='e' ){
if( eventTagId != 0) {
@ Instance of technote
objType |= OBJTYPE_EVENT;
hyperlink_to_event_tagid(db_column_int(&q, 5));
}else{
@ Attachment to technote
}
}else{
@ Tag referencing
}
if( zType[0]!='e' || eventTagId == 0){
hyperlink_to_uuid(zUuid);
}
|
| ︙ | ︙ | |||
1975 1976 1977 1978 1979 1980 1981 |
output_text_with_line_numbers(z, zLn);
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
| | | 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 |
output_text_with_line_numbers(z, zLn);
}else{
@ <pre>
@ %h(z)
@ </pre>
}
}else if( strncmp(zMime, "image/", 6)==0 ){
@ <i>(file is %d(blob_size(&content)) bytes of image data)</i><br />
@ <img src="%R/raw/%s(zUuid)?m=%s(zMime)" />
style_submenu_element("Image", "Image",
"%R/raw/%s?m=%s", zUuid, zMime);
}else{
@ <i>(file is %d(blob_size(&content)) bytes of binary data)</i>
}
@ </blockquote>
|
| ︙ | ︙ | |||
2070 2071 2072 2073 2074 2075 2076 |
modPending = moderation_pending(rid);
if( modPending ){
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
}
@ <tr><th>Ticket:</th>
@ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a>
if( zTktTitle ){
| | | 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 |
modPending = moderation_pending(rid);
if( modPending ){
@ <span class="modpending">*** Awaiting Moderator Approval ***</span>
}
@ <tr><th>Ticket:</th>
@ <td>%z(href("%R/tktview/%s",zTktName))%s(zTktName)</a>
if( zTktTitle ){
@<br />%h(zTktTitle)
}
@</td></tr>
@ <tr><th>Date:</th><td>
hyperlink_to_date(zDate, "</td></tr>");
@ <tr><th>User:</th><td>
hyperlink_to_user(pTktChng->zUser, zDate, "</td></tr>");
@ </table>
|
| ︙ | ︙ |
Changes to src/piechart.c.
| ︙ | ︙ | |||
297 298 299 300 301 302 303 |
}
db_finalize(&ins);
blob_reset(&all);
if( n>0 ){
@ <svg width=%d(width) height=%d(height) style="border:1px solid #d3d3d3;">
piechart_render(width,height, PIE_OTHER);
@ </svg>
| | | | | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
}
db_finalize(&ins);
blob_reset(&all);
if( n>0 ){
@ <svg width=%d(width) height=%d(height) style="border:1px solid #d3d3d3;">
piechart_render(width,height, PIE_OTHER);
@ </svg>
@ <hr />
}
@ <form method="post" action='%R/test-piechart'>
@ <p>One slice per line. Value and then Label.<p>
@ <textarea name='data' rows='20' cols='80'>%h(zData)</textarea><br />
@ Width: <input type='text' size='8' name='width' value='%d(width)'/>
@ Height: <input type='text' size='8' name='height' value='%d(height)'/><br />
@ <input type='hidden' name='width' value='%d(width)'/>
@ <input type='hidden' name='height' value='%d(height)'/>
@ <input type='submit' value='Draw The Pie Chart'/>
@ </form>
@ <hr /><p>Previous Data:</p>
@ <table border="1">
db_prepare(&q, "SELECT rowid, amt, label FROM piechart");
while( db_step(&q)==SQLITE_ROW ){
@ <tr><td>%d(db_column_int(&q,0))</td>
@ <td>%g(db_column_double(&q,1))</td>
@ <td>%h(db_column_text(&q,2))</td></tr>
}
|
| ︙ | ︙ |
Changes to src/search.c.
| ︙ | ︙ | |||
514 515 516 517 518 519 520 |
search_urlencode_sqlfunc, 0, 0);
}
/*
** Testing the search function.
**
** COMMAND: search*
| | | 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 |
search_urlencode_sqlfunc, 0, 0);
}
/*
** Testing the search function.
**
** COMMAND: search*
**
** Usage: %fossil search [-all|-a] [-limit|-n #] [-width|-W #] pattern...
**
** Search for timeline entries matching all words provided on the
** command line. Whole-word matches scope more highly than partial
** matches.
**
** Outputs, by default, some top-N fraction of the results. The -all
|
| ︙ | ︙ | |||
947 948 949 950 951 952 953 |
@ <ol>
}
nRow++;
@ <li><p><a href='%R%s(zUrl)'>%h(zLabel)</a>
if( fDebug ){
@ (%e(db_column_double(&q,3)), %s(db_column_text(&q,4)))
}
| | | 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 |
@ <ol>
}
nRow++;
@ <li><p><a href='%R%s(zUrl)'>%h(zLabel)</a>
if( fDebug ){
@ (%e(db_column_double(&q,3)), %s(db_column_text(&q,4)))
}
@ <br /><span class='snippet'>%z(cleanSnippet(zSnippet))</span></li>
}
db_finalize(&q);
if( nRow ){
@ </ol>
}
return nRow;
}
|
| ︙ | ︙ |
Changes to src/setup.c.
| ︙ | ︙ | |||
173 174 175 176 177 178 179 |
const char *zLogin = db_column_text(&s, 1);
const char *zCap = db_column_text(&s, 2);
const char *zDate = db_column_text(&s, 4);
@ <tr>
@ <td><a href='setup_uedit?id=%d(uid)'>%d(uid)</a>
@ <td><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a>
@ <td>%h(zCap)
| | | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 |
const char *zLogin = db_column_text(&s, 1);
const char *zCap = db_column_text(&s, 2);
const char *zDate = db_column_text(&s, 4);
@ <tr>
@ <td><a href='setup_uedit?id=%d(uid)'>%d(uid)</a>
@ <td><a href='setup_uedit?id=%d(uid)'>%h(zLogin)</a>
@ <td>%h(zCap)
if( fossil_strcmp(zLogin,"anonymous")==0 ){
@ <td>All logged-in users
}else if( fossil_strcmp(zLogin,"developer")==0 ){
@ <td>Users with '<b>v</b>' capability
}else if( fossil_strcmp(zLogin,"nobody")==0 ){
@ <td>All users without login
}else if( fossil_strcmp(zLogin,"reader")==0 ){
|
| ︙ | ︙ | |||
1152 1153 1154 1155 1156 1157 1158 |
@ even for relatively small projects.</p>
@
@ <p>Additional parameters that control this behavior:</p>
@ <blockquote>
onoff_attribute("Enable hyperlinks for humans (as deduced from the UserAgent "
" HTTP header string)",
"auto-hyperlink-ishuman", "ahis", 0, 0);
| | | | 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 |
@ even for relatively small projects.</p>
@
@ <p>Additional parameters that control this behavior:</p>
@ <blockquote>
onoff_attribute("Enable hyperlinks for humans (as deduced from the UserAgent "
" HTTP header string)",
"auto-hyperlink-ishuman", "ahis", 0, 0);
@ <br />
onoff_attribute("Require mouse movement before enabling hyperlinks",
"auto-hyperlink-mouseover", "ahmo", 0, 0);
@ <br />
entry_attribute("Delay before enabling hyperlinks (milliseconds)", 5,
"auto-hyperlink-delay", "ah-delay", "10", 0);
@ </blockquote>
@ <p>Hyperlinks for user "nobody" are normally enabled as soon as the page
@ finishes loading. But the first check-box below can be set to require mouse
@ movement before enabling the links. One can also set a delay prior to enabling
@ links by enter a positive number of milliseconds in the entry box above.</p>
|
| ︙ | ︙ | |||
1312 1313 1314 1315 1316 1317 1318 |
@ </table>
@
@ <p><form action="%s(g.zTop)/setup_login_group" method="post"><div>
login_insert_csrf_secret();
@ To leave this login group press
@ <input type="submit" value="Leave Login Group" name="leave">
@ </form></p>
| | | 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 |
@ </table>
@
@ <p><form action="%s(g.zTop)/setup_login_group" method="post"><div>
login_insert_csrf_secret();
@ To leave this login group press
@ <input type="submit" value="Leave Login Group" name="leave">
@ </form></p>
@ <hr /><h2>Implementation Details</h2>
@ <p>The following are fields from the CONFIG table related to login-groups,
@ provided here for instructional and debugging purposes:</p>
@ <table border='1' id='configTab'>
@ <thead><tr><th>Config.Name<th>Config.Value<th>Config.mtime</tr></thead><tbody>
db_prepare(&q, "SELECT name, value, datetime(mtime,'unixepoch') FROM config"
" WHERE name GLOB 'peer-*'"
" OR name GLOB 'project-*'"
|
| ︙ | ︙ | |||
2151 2152 2153 2154 2155 2156 2157 |
@ <td>Search nothing. (Disables document search).</tr>
@ </table>
@ <hr />
entry_attribute("Document Branch", 20, "doc-branch", "db", "trunk", 0);
@ <p>When searching documents, use the versions of the files found at the
@ type of the "Document Branch" branch. Recommended value: "trunk".
@ Document search is disabled if blank.
| | | | | | | | 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 |
@ <td>Search nothing. (Disables document search).</tr>
@ </table>
@ <hr />
entry_attribute("Document Branch", 20, "doc-branch", "db", "trunk", 0);
@ <p>When searching documents, use the versions of the files found at the
@ type of the "Document Branch" branch. Recommended value: "trunk".
@ Document search is disabled if blank.
@ <hr />
onoff_attribute("Search Check-in Comments", "search-ci", "sc", 0, 0);
@ <br />
onoff_attribute("Search Documents", "search-doc", "sd", 0, 0);
@ <br />
onoff_attribute("Search Tickets", "search-tkt", "st", 0, 0);
@ <br />
onoff_attribute("Search Wiki","search-wiki", "sw", 0, 0);
@ <hr />
@ <p><input type="submit" name="submit" value="Apply Changes" /></p>
@ <hr />
if( P("fts0") ){
search_drop_index();
}else if( P("fts1") ){
search_drop_index();
search_create_index();
search_fill_index();
search_update_index(search_restrict(SRCH_ALL));
|
| ︙ | ︙ |
Changes to src/statrep.c.
| ︙ | ︙ | |||
309 310 311 312 313 314 315 |
@ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
@</tr>
}
@ </tbody></table>
if(nEventTotal){
const char *zAvgLabel = includeMonth ? "month" : "year";
int nAvg = iterations ? (nEventTotal/iterations) : 0;
| | | | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
@ <td colspan='2'>Yearly total: %d(nEventsPerYear)</td>
@</tr>
}
@ </tbody></table>
if(nEventTotal){
const char *zAvgLabel = includeMonth ? "month" : "year";
int nAvg = iterations ? (nEventTotal/iterations) : 0;
@ <br /><div>Total events: %d(nEventTotal)
@ <br />Average per active %s(zAvgLabel): %d(nAvg)
@ </div>
}
if( !includeMonth ){
output_table_sorting_javascript("statsTable","tnx",-1);
}
}
|
| ︙ | ︙ | |||
340 341 342 343 344 345 346 |
"CREATE TEMP VIEW piechart(amt,label) AS"
" SELECT count(*), ifnull(euser,user) FROM v_reports"
" GROUP BY ifnull(euser,user) ORDER BY count(*) DESC;"
);
if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){
@ <center><svg width=700 height=400>
piechart_render(700, 400, PIE_OTHER|PIE_PERCENT);
| | | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 |
"CREATE TEMP VIEW piechart(amt,label) AS"
" SELECT count(*), ifnull(euser,user) FROM v_reports"
" GROUP BY ifnull(euser,user) ORDER BY count(*) DESC;"
);
if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){
@ <center><svg width=700 height=400>
piechart_render(700, 400, PIE_OTHER|PIE_PERCENT);
@ </svg></centre><hr />
}
@ <table class='statistics-report-table-events' border='0'
@ cellpadding='2' cellspacing='0' id='statsTable'>
@ <thead><tr>
@ <th>User</th>
@ <th>Events</th>
@ <th width='90%%'><!-- relative commits graph --></th>
|
| ︙ | ︙ | |||
501 502 503 504 505 506 507 |
" WHERE ifnull(coalesce(euser,user,'')=%Q,1)"
" GROUP BY 2 ORDER BY cast(strftime('%%w', mtime) AS INT);"
, zUserName
);
if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){
@ <center><svg width=700 height=400>
piechart_render(700, 400, PIE_OTHER|PIE_PERCENT);
| | | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 |
" WHERE ifnull(coalesce(euser,user,'')=%Q,1)"
" GROUP BY 2 ORDER BY cast(strftime('%%w', mtime) AS INT);"
, zUserName
);
if( db_int(0, "SELECT count(*) FROM piechart")>=2 ){
@ <center><svg width=700 height=400>
piechart_render(700, 400, PIE_OTHER|PIE_PERCENT);
@ </svg></centre><hr />
}
@ <table class='statistics-report-table-events' border='0'
@ cellpadding='2' cellspacing='0' id='statsTable'>
@ <thead><tr>
@ <th>DoW</th>
@ <th>Day</th>
@ <th>Events</th>
|
| ︙ | ︙ | |||
569 570 571 572 573 574 575 |
" SELECT substr(date('now'),1,4) UNION ALL"
" SELECT b-1 FROM a"
" WHERE b>0+(SELECT substr(date(min(mtime)),1,4) FROM event)"
") SELECT b, b FROM a ORDER BY b DESC");
if( zYear==0 || strlen(zYear)!=4 ){
zYear = db_text("1970","SELECT substr(date('now'),1,4);");
}
| | | 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 |
" SELECT substr(date('now'),1,4) UNION ALL"
" SELECT b-1 FROM a"
" WHERE b>0+(SELECT substr(date(min(mtime)),1,4) FROM event)"
") SELECT b, b FROM a ORDER BY b DESC");
if( zYear==0 || strlen(zYear)!=4 ){
zYear = db_text("1970","SELECT substr(date('now'),1,4);");
}
cgi_printf("<br />");
db_prepare(&q,
"SELECT DISTINCT strftime('%%W',mtime) AS wk, "
" count(*) AS n "
" FROM v_reports "
" WHERE %Q=substr(date(mtime),1,4) "
" AND mtime < current_timestamp "
" AND ifnull(coalesce(euser,user,'')=%Q,1)"
|
| ︙ | ︙ | |||
631 632 633 634 635 636 637 |
}
cgi_printf("</td></tr>");
}
db_finalize(&q);
cgi_printf("</tbody></table>");
if(total){
int nAvg = iterations ? (total/iterations) : 0;
| | | 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 |
}
cgi_printf("</td></tr>");
}
db_finalize(&q);
cgi_printf("</tbody></table>");
if(total){
int nAvg = iterations ? (total/iterations) : 0;
cgi_printf("<br /><div>Total events: %d<br />"
"Average per active week: %d</div>",
total, nAvg);
}
output_table_sorting_javascript("statsTable","tnx",-1);
}
/* Report types
|
| ︙ | ︙ |
Changes to src/tar.c.
| ︙ | ︙ | |||
682 683 684 685 686 687 688 | /* Compute a unique key for the cache entry based on query parameters */ blob_init(&cacheKey, 0, 0); blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid)); if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude); if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude); blob_appendf(&cacheKey, "/%q", zName); zKey = blob_str(&cacheKey); | | | | | | | 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 |
/* Compute a unique key for the cache entry based on query parameters */
blob_init(&cacheKey, 0, 0);
blob_appendf(&cacheKey, "/tarball/%z", rid_to_uuid(rid));
if( zInclude ) blob_appendf(&cacheKey, ",in=%Q", zInclude);
if( zExclude ) blob_appendf(&cacheKey, ",ex=%Q", zExclude);
blob_appendf(&cacheKey, "/%q", zName);
zKey = blob_str(&cacheKey);
if( P("debug")!=0 ){
style_header("Tarball Generator Debug Screen");
@ zName = "%h(zName)"<br />
@ rid = %d(rid)<br />
if( zInclude ){
@ zInclude = "%h(zInclude)"<br />
}
if( zExclude ){
@ zExclude = "%h(zExclude)"<br />
}
@ zKey = "%h(zKey)"
style_footer();
return;
}
if( referred_from_login() ){
style_header("Tarball Download");
|
| ︙ | ︙ |
Changes to src/th_main.c.
| ︙ | ︙ | |||
280 281 282 283 284 285 286 |
){
int rc;
if( argc<2 || argc>3 ){
return Th_WrongNumArgs(interp, "enable_output [LABEL] BOOLEAN");
}
rc = Th_ToInt(interp, argv[argc-1], argl[argc-1], &enableOutput);
if( g.thTrace ){
| | | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
){
int rc;
if( argc<2 || argc>3 ){
return Th_WrongNumArgs(interp, "enable_output [LABEL] BOOLEAN");
}
rc = Th_ToInt(interp, argv[argc-1], argl[argc-1], &enableOutput);
if( g.thTrace ){
Th_Trace("enable_output {%.*s} -> %d<br />\n", argl[1],argv[1],enableOutput);
}
return rc;
}
/*
** Returns a name for a TH1 return code.
*/
|
| ︙ | ︙ | |||
330 331 332 333 334 335 336 |
}
}
static void sendError(const char *z, int n, int forceCgi){
int savedEnable = enableOutput;
enableOutput = 1;
if( forceCgi || g.cgiOutput ){
| | | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
}
}
static void sendError(const char *z, int n, int forceCgi){
int savedEnable = enableOutput;
enableOutput = 1;
if( forceCgi || g.cgiOutput ){
sendText("<hr /><p class=\"thmainError\">", -1, 0);
}
sendText("ERROR: ", -1, 0);
sendText((char*)z, n, 1);
sendText(forceCgi || g.cgiOutput ? "</p>" : "\n", -1, 0);
enableOutput = savedEnable;
}
|
| ︙ | ︙ | |||
2325 2326 2327 2328 2329 2330 2331 |
zResult = (char*)Th_GetResult(g.interp, &n);
sendText((char*)zResult, n, encode);
}else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
sendText(z, i, 0);
z += i+5;
for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
if( g.thTrace ){
| | | 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 |
zResult = (char*)Th_GetResult(g.interp, &n);
sendText((char*)zResult, n, encode);
}else if( z[i]=='<' && isBeginScriptTag(&z[i]) ){
sendText(z, i, 0);
z += i+5;
for(i=0; z[i] && (z[i]!='<' || !isEndScriptTag(&z[i])); i++){}
if( g.thTrace ){
Th_Trace("eval {<pre>%#h</pre>}<br />", i, z);
}
rc = Th_Eval(g.interp, 0, (const char*)z, i);
if( rc!=TH_OK ) break;
z += i;
if( z[0] ){ z += 6; }
i = 0;
}else{
|
| ︙ | ︙ |
Changes to src/timeline.c.
| ︙ | ︙ | |||
176 177 178 179 180 181 182 |
@ %h(zBr) - %s(hash_color(zBr)) -
@ Omnes nos quasi oves erravimus unusquisque in viam
@ suam declinavit.</p>
cnt++;
}
}
if( cnt ){
| | | 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
@ %h(zBr) - %s(hash_color(zBr)) -
@ Omnes nos quasi oves erravimus unusquisque in viam
@ suam declinavit.</p>
cnt++;
}
}
if( cnt ){
@ <hr />
}
@ <form method="post" action="%s(g.zTop)/hash-color-test">
@ <p>Enter candidate branch names below and see them displayed in their
@ default background colors above.</p>
for(i=0; i<10; i++){
sqlite3_snprintf(sizeof(zNm),zNm,"b%d",i);
zBr = P(zNm);
|
| ︙ | ︙ | |||
297 298 299 300 301 302 303 |
if( pendingEndTr>1 ){
@ <tr class="timelineSpacer"></tr>
}
pendingEndTr = 0;
}
if( fossil_strcmp(zType,"div")==0 ){
if( !prevWasDivider ){
| | | 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
if( pendingEndTr>1 ){
@ <tr class="timelineSpacer"></tr>
}
pendingEndTr = 0;
}
if( fossil_strcmp(zType,"div")==0 ){
if( !prevWasDivider ){
@ <tr><td colspan="3"><hr class="timelineMarker" /></td></tr>
}
prevWasDivider = 1;
continue;
}
prevWasDivider = 0;
/* Date format codes:
** (0) HH:MM
|
| ︙ | ︙ | |||
1215 1216 1217 1218 1219 1220 1221 | ** ubg Background color from user ** namechng Show only check-ins that have filename changes ** forks Show only forks and their children ** ym=YYYY-MM Show only events for the given year/month. ** yw=YYYY-WW Show only events for the given week of the given year ** ymd=YYYY-MM-DD Show only events on the given day ** datefmt=N Override the date format | | | 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 |
** ubg Background color from user
** namechng Show only check-ins that have filename changes
** forks Show only forks and their children
** ym=YYYY-MM Show only events for the given year/month.
** yw=YYYY-WW Show only events for the given week of the given year
** ymd=YYYY-MM-DD Show only events on the given day
** datefmt=N Override the date format
** bisect Show the check-ins that are in the current bisect
**
** p= and d= can appear individually or together. If either p= or d=
** appear, then u=, y=, a=, and b= are ignored.
**
** If both a= and b= appear then both upper and lower bounds are honored.
*/
void page_timeline(void){
|
| ︙ | ︙ | |||
1437 1438 1439 1440 1441 1442 1443 |
blob_append_sql(&sql, ",%d", p->rid);
p = p->u.pTo;
}
blob_append(&sql, ")", -1);
path_reset();
tmFlags |= TIMELINE_DISJOINT;
db_multi_exec("%s", blob_sql_text(&sql));
| | | 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 |
blob_append_sql(&sql, ",%d", p->rid);
p = p->u.pTo;
}
blob_append(&sql, ")", -1);
path_reset();
tmFlags |= TIMELINE_DISJOINT;
db_multi_exec("%s", blob_sql_text(&sql));
blob_appendf(&desc, "%d check-ins going from ",
db_int(0, "SELECT count(*) FROM timeline"));
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
blob_append(&desc, " to ", -1);
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
}else if( (p_rid || d_rid) && g.perm.Read ){
/* If p= or d= is present, ignore all other parameters other than n= */
char *zUuid;
|
| ︙ | ︙ | |||
1730 1731 1732 1733 1734 1735 1736 |
tmFlags |= TIMELINE_DISJOINT;
}else if( zBrName ){
blob_appendf(&desc, " related to \"%h\"", zBrName);
tmFlags |= TIMELINE_DISJOINT;
}
if( rAfter>0.0 ){
if( rBefore>0.0 ){
| | | 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 |
tmFlags |= TIMELINE_DISJOINT;
}else if( zBrName ){
blob_appendf(&desc, " related to \"%h\"", zBrName);
tmFlags |= TIMELINE_DISJOINT;
}
if( rAfter>0.0 ){
if( rBefore>0.0 ){
blob_appendf(&desc, " occurring between %h and %h.<br />",
zAfter, zBefore);
}else{
blob_appendf(&desc, " occurring on or after %h.<br />", zAfter);
}
}else if( rBefore>0.0 ){
blob_appendf(&desc, " occurring on or before %h.<br />", zBefore);
}else if( rCirca>0.0 ){
|
| ︙ | ︙ |
Changes to src/tktsetup.c.
| ︙ | ︙ | |||
522 523 524 525 526 527 528 |
@ set alwaysPlaintext [info exists plaintext]
@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin,
@ mimetype as xmimetype, icomment AS xcomment,
@ username AS xusername
@ FROM ticketchng
@ WHERE tkt_id=$tkt_id AND length(icomment)>0} {
@ if {$seenRow} {
| | | 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
@ set alwaysPlaintext [info exists plaintext]
@ query {SELECT datetime(tkt_mtime) AS xdate, login AS xlogin,
@ mimetype as xmimetype, icomment AS xcomment,
@ username AS xusername
@ FROM ticketchng
@ WHERE tkt_id=$tkt_id AND length(icomment)>0} {
@ if {$seenRow} {
@ html "<hr />\n"
@ } else {
@ html "<tr><td class='tktDspLabel'>User Comments:</td></tr>\n"
@ html "<tr><td colspan='5' class='tktDspValue'>\n"
@ set seenRow 1
@ }
@ html "[htmlize $xlogin]"
@ if {$xlogin ne $xusername && [string length $xusername]>0} {
|
| ︙ | ︙ | |||
649 650 651 652 653 654 655 | @ <input type="text" name="username" value="$<username>" size="30" />:<br /> @ <textarea name="icomment" cols="80" rows="15" @ wrap="virtual" class="wikiedit">$<icomment></textarea> @ </td></tr> @ @ <th1>enable_output [info exists preview]</th1> @ <tr><td colspan="2"> | | | | 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
@ <input type="text" name="username" value="$<username>" size="30" />:<br />
@ <textarea name="icomment" cols="80" rows="15"
@ wrap="virtual" class="wikiedit">$<icomment></textarea>
@ </td></tr>
@
@ <th1>enable_output [info exists preview]</th1>
@ <tr><td colspan="2">
@ Description Preview:<br /><hr />
@ <th1>
@ if {$mutype eq "Wiki"} {
@ wiki $icomment
@ } elseif {$mutype eq "Plain Text"} {
@ set r [randhex]
@ wiki "<verbatim-$r>\n[string trimright $icomment]\n</verbatim-$r>"
@ } elseif {$mutype eq {[links only]}} {
@ set r [randhex]
@ wiki "<verbatim-$r links>\n[string trimright $icomment]</verbatim-$r>"
@ } else {
@ wiki "<nowiki>\n[string trimright $icomment]\n</nowiki>"
@ }
@ </th1>
@ <hr />
@ </td></tr>
@ <th1>enable_output 1</th1>
@
@ <tr>
@ <td align="right">
@ <input type="submit" name="preview" value="Preview" />
@ </td>
|
| ︙ | ︙ |
Changes to src/xfersetup.c.
| ︙ | ︙ | |||
59 60 61 62 63 64 65 |
}else{
syncFlags = SYNC_PUSH | SYNC_PULL;
zButton = "Synchronize";
zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.",
g.url.canonical);
}
@ <p>Press the <strong>%h(zButton)</strong> button below to
| | | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
}else{
syncFlags = SYNC_PUSH | SYNC_PULL;
zButton = "Synchronize";
zWarning = mprintf("WARNING: Pushing to \"%s\" is enabled.",
g.url.canonical);
}
@ <p>Press the <strong>%h(zButton)</strong> button below to
@ synchronize with the <em>%h(g.url.canonical)</em> repository now.<br />
@ This may be useful when testing the various transfer scripts.</p>
@ <p>You can use the <code>http -async</code> command in your scripts, but
@ make sure the <code>th1-uri-regexp</code> setting is set first.</p>
if( zWarning ){
@
@ <big><b>%h(zWarning)</b></big>
free(zWarning);
|
| ︙ | ︙ |