| | @@ -1067,26 +1067,34 @@ |
| 1067 | 1067 | int wrid = db_column_int(&q, 2); |
| 1068 | 1068 | double rWmtime = db_column_double(&q, 3); |
| 1069 | 1069 | sqlite3_int64 iMtime = (sqlite3_int64)(rWmtime*86400.0); |
| 1070 | 1070 | char *zAge; |
| 1071 | 1071 | int wcnt = db_column_int(&q, 4); |
| 1072 | + char *zWDisplayName; |
| 1073 | + |
| 1074 | + if( sqlite3_strglob("checkin/*", zWName)==0 ){ |
| 1075 | + zWDisplayName = mprintf("%.25s...", zWName); |
| 1076 | + }else{ |
| 1077 | + zWDisplayName = mprintf("%s", zWName); |
| 1078 | + } |
| 1072 | 1079 | if( wrid==0 ){ |
| 1073 | 1080 | if( !showAll ) continue; |
| 1074 | 1081 | @ <tr><td data-sortkey="%h(zSort)">\ |
| 1075 | | - @ %z(href("%R/whistory?name=%T",zWName))<s>%h(zWName)</s></a></td> |
| 1082 | + @ %z(href("%R/whistory?name=%T",zWName))<s>%h(zWDisplayName)</s></a></td> |
| 1076 | 1083 | }else{ |
| 1077 | 1084 | @ <tr><td data=sortkey='%h(zSort)">\ |
| 1078 | | - @ %z(href("%R/wiki?name=%T",zWName))%h(zWName)</a></td> |
| 1085 | + @ %z(href("%R/wiki?name=%T",zWName))%h(zWDisplayName)</a></td> |
| 1079 | 1086 | } |
| 1080 | 1087 | zAge = human_readable_age(rNow - rWmtime); |
| 1081 | 1088 | @ <td data-sortkey="%016llx(iMtime)">%s(zAge)</td> |
| 1082 | 1089 | fossil_free(zAge); |
| 1083 | 1090 | @ <td>%z(href("%R/whistory?name=%T",zWName))%d(wcnt)</a></td> |
| 1084 | 1091 | if( showRid ){ |
| 1085 | 1092 | @ <td>%d(wrid)</td> |
| 1086 | 1093 | } |
| 1087 | 1094 | @ </tr> |
| 1095 | + fossil_free(zWDisplayName); |
| 1088 | 1096 | } |
| 1089 | 1097 | @ </tbody></table></div> |
| 1090 | 1098 | db_finalize(&q); |
| 1091 | 1099 | style_table_sorter(); |
| 1092 | 1100 | style_footer(); |
| | @@ -1483,10 +1491,34 @@ |
| 1483 | 1491 | blob_zero(&out); |
| 1484 | 1492 | blob_read_from_file(&in, g.argv[2], ExtFILE); |
| 1485 | 1493 | markdown_to_html(&in, 0, &out); |
| 1486 | 1494 | blob_write_to_file(&out, "-"); |
| 1487 | 1495 | } |
| 1496 | + |
| 1497 | +/* |
| 1498 | +** Allowed flags for wiki_render_associated |
| 1499 | +*/ |
| 1500 | +#if INTERFACE |
| 1501 | +#define WIKIASSOC_FULL_TITLE 0x00001 /* Full title */ |
| 1502 | +#endif |
| 1503 | + |
| 1504 | +/* |
| 1505 | +** Show the default Section label for an associated wiki page. |
| 1506 | +*/ |
| 1507 | +static void wiki_section_label( |
| 1508 | + const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 1509 | + const char *zName, /* Name of the object */ |
| 1510 | + unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 1511 | +){ |
| 1512 | + if( (mFlags & WIKIASSOC_FULL_TITLE)==0 ){ |
| 1513 | + @ <div class="section">About</div> |
| 1514 | + }else if( zPrefix[0]=='c' ){ /* checkin/... */ |
| 1515 | + @ <div class="section">About checkin %.20h(zName)</div> |
| 1516 | + }else{ |
| 1517 | + @ <div class="section">About %s(zPrefix) %h(zName)</div> |
| 1518 | + } |
| 1519 | +} |
| 1488 | 1520 | |
| 1489 | 1521 | /* |
| 1490 | 1522 | ** Check to see if there exists a wiki page with a name zPrefix/zName. |
| 1491 | 1523 | ** If there is, then render a <div class='section'>..</div> and |
| 1492 | 1524 | ** return true. |
| | @@ -1493,11 +1525,12 @@ |
| 1493 | 1525 | ** |
| 1494 | 1526 | ** If there is no such wiki page, return false. |
| 1495 | 1527 | */ |
| 1496 | 1528 | int wiki_render_associated( |
| 1497 | 1529 | const char *zPrefix, /* "branch", "tag", or "checkin" */ |
| 1498 | | - const char *zName /* Name of the object */ |
| 1530 | + const char *zName, /* Name of the object */ |
| 1531 | + unsigned int mFlags /* Zero or more WIKIASSOC_* flags */ |
| 1499 | 1532 | ){ |
| 1500 | 1533 | int rid; |
| 1501 | 1534 | Manifest *pWiki; |
| 1502 | 1535 | rid = db_int(0, |
| 1503 | 1536 | "SELECT rid FROM tagxref" |
| | @@ -1515,20 +1548,18 @@ |
| 1515 | 1548 | blob_init(&markdown, pWiki->zWiki, -1); |
| 1516 | 1549 | markdown_to_html(&markdown, &title, &tail); |
| 1517 | 1550 | if( blob_size(&title) ){ |
| 1518 | 1551 | @ <div class="section">%h(blob_str(&title))</div> |
| 1519 | 1552 | }else{ |
| 1520 | | - @ <div class="section">About %s(zPrefix) %h(zName)<div> |
| 1553 | + wiki_section_label(zPrefix, zName, mFlags); |
| 1521 | 1554 | } |
| 1522 | | - @ <div class="wiki"> |
| 1523 | 1555 | convert_href_and_output(&tail); |
| 1524 | | - @ </div> |
| 1525 | 1556 | blob_reset(&tail); |
| 1526 | 1557 | blob_reset(&title); |
| 1527 | 1558 | blob_reset(&markdown); |
| 1528 | 1559 | }else if( fossil_strcmp(pWiki->zMimetype, "text/plain")==0 ){ |
| 1529 | | - @ <div class="section">About %s(zPrefix) %h(zName)</div> |
| 1560 | + wiki_section_label(zPrefix, zName, mFlags); |
| 1530 | 1561 | @ <pre> |
| 1531 | 1562 | @ %h(pWiki->zWiki) |
| 1532 | 1563 | @ </pre> |
| 1533 | 1564 | }else{ |
| 1534 | 1565 | Blob tail = BLOB_INITIALIZER; |
| | @@ -1539,11 +1570,11 @@ |
| 1539 | 1570 | @ <div class="section">%h(blob_str(&title))</div> |
| 1540 | 1571 | @ <div class="wiki"> |
| 1541 | 1572 | wiki_convert(&tail, 0, WIKI_BUTTONS); |
| 1542 | 1573 | @ </div> |
| 1543 | 1574 | }else{ |
| 1544 | | - @ <div class="section">About %s(zPrefix) %h(zName)</div> |
| 1575 | + wiki_section_label(zPrefix, zName, mFlags); |
| 1545 | 1576 | @ <div class="wiki"> |
| 1546 | 1577 | wiki_convert(&wiki, 0, WIKI_BUTTONS); |
| 1547 | 1578 | @ </div> |
| 1548 | 1579 | } |
| 1549 | 1580 | blob_reset(&tail); |
| 1550 | 1581 | |