Fossil SCM
Change the style selector query parameter on /timeline to "ss". Other code cleanup. The new style selector is working, but needs default CSS.
Commit
f64fa4f1ae38fe97fe47cada2c1b8aeaae43cfdbc5e41af889160c70b862b0fb
Parent
fdf071e1819d01c…
1 file changed
+42
-103
+42
-103
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -106,10 +106,11 @@ | ||
| 106 | 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | 108 | #define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */ |
| 109 | 109 | #define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */ |
| 110 | 110 | #define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */ |
| 111 | +#define TIMELINE_COLUMNAR 0x8000 /* Use the "columns view style */ | |
| 111 | 112 | #endif |
| 112 | 113 | |
| 113 | 114 | /* |
| 114 | 115 | ** Hash a string and use the hash to determine a background color. |
| 115 | 116 | */ |
| @@ -252,16 +253,10 @@ | ||
| 252 | 253 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 253 | 254 | int vid = 0; /* Current checkout version */ |
| 254 | 255 | int dateFormat = 0; /* 0: HH:MM (default) */ |
| 255 | 256 | int bCommentGitStyle = 0; /* Only show comments through first blank line */ |
| 256 | 257 | const char *zTdClass; |
| 257 | - int bHashBeforeComment = 0; /* Show hash before the comment */ | |
| 258 | - int bHashAfterComment = 0; /* Show hash after the comment */ | |
| 259 | - int bHashInDetail = 0; /* Show the hash inside the detail section */ | |
| 260 | - int bShowDetail; /* Show the detail section */ | |
| 261 | - int bSeparateDetail; /* Detail in a separate column */ | |
| 262 | - int eCommentFormat; /* value for timeline-comment-format */ | |
| 263 | 258 | const char *zDateFmt; |
| 264 | 259 | int iTableId = timeline_tableid(); |
| 265 | 260 | |
| 266 | 261 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 267 | 262 | vid = db_lget_int("checkout", 0); |
| @@ -439,11 +434,12 @@ | ||
| 439 | 434 | db_reset(&qbranch); |
| 440 | 435 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 441 | 436 | } |
| 442 | 437 | @</td> |
| 443 | 438 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 444 | - @ <td class="timelineTableCell %s(zTdClass)" style="background-color: %h(zBgClr);"> | |
| 439 | + @ <td class="timelineTableCell %s(zTdClass)" \ | |
| 440 | + @ style="background-color: %h(zBgClr);"> | |
| 445 | 441 | }else{ |
| 446 | 442 | @ <td class="timelineTableCell %s(zTdClass)"> |
| 447 | 443 | } |
| 448 | 444 | if( pGraph && zType[0]!='c' ){ |
| 449 | 445 | @ • |
| @@ -459,38 +455,10 @@ | ||
| 459 | 455 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 460 | 456 | @ (%d(db_column_int(&bisectQuery,0))) |
| 461 | 457 | } |
| 462 | 458 | db_reset(&bisectQuery); |
| 463 | 459 | } |
| 464 | -#if 0 | |
| 465 | - if( bHashBeforeComment ){ | |
| 466 | - if( zType[0]=='c' ){ | |
| 467 | - hyperlink_to_uuid(zUuid); | |
| 468 | - if( isLeaf ){ | |
| 469 | - if( db_exists("SELECT 1 FROM tagxref" | |
| 470 | - " WHERE rid=%d AND tagid=%d AND tagtype>0", | |
| 471 | - rid, TAG_CLOSED) ){ | |
| 472 | - @ <span class="timelineLeaf">Closed-Leaf:</span> | |
| 473 | - }else{ | |
| 474 | - @ <span class="timelineLeaf">Leaf:</span> | |
| 475 | - } | |
| 476 | - } | |
| 477 | - }else if( zType[0]=='e' && tagid ){ | |
| 478 | - hyperlink_to_event_tagid(tagid<0?-tagid:tagid); | |
| 479 | - }else if( (tmFlags & TIMELINE_ARTID)!=0 ){ | |
| 480 | - hyperlink_to_uuid(zUuid); | |
| 481 | - } | |
| 482 | - if( tmFlags & TIMELINE_SHOWRID ){ | |
| 483 | - int srcId = delta_source_rid(rid); | |
| 484 | - if( srcId ){ | |
| 485 | - @ (%d(rid)←%d(srcId)) | |
| 486 | - }else{ | |
| 487 | - @ (%d(rid)) | |
| 488 | - } | |
| 489 | - } | |
| 490 | - } | |
| 491 | -#endif | |
| 492 | 460 | drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0; |
| 493 | 461 | db_column_blob(pQuery, commentColumn, &comment); |
| 494 | 462 | if( zType[0]!='c' ){ |
| 495 | 463 | /* Comments for anything other than a check-in are generated by |
| 496 | 464 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| @@ -526,93 +494,61 @@ | ||
| 526 | 494 | } |
| 527 | 495 | @ </span> |
| 528 | 496 | } |
| 529 | 497 | blob_reset(&comment); |
| 530 | 498 | |
| 531 | -#if 0 | |
| 532 | - if( bHashAfterComment ){ | |
| 533 | - if( zType[0]=='c' ){ | |
| 534 | - hyperlink_to_uuid(zUuid); | |
| 535 | - if( isLeaf ){ | |
| 536 | - if( db_exists("SELECT 1 FROM tagxref" | |
| 537 | - " WHERE rid=%d AND tagid=%d AND tagtype>0", | |
| 538 | - rid, TAG_CLOSED) ){ | |
| 539 | - @ <span class="timelineLeaf">Closed-Leaf</span> | |
| 540 | - }else{ | |
| 541 | - @ <span class="timelineLeaf">Leaf</span> | |
| 542 | - } | |
| 543 | - } | |
| 544 | - }else if( zType[0]=='e' && tagid ){ | |
| 545 | - hyperlink_to_event_tagid(tagid<0?-tagid:tagid); | |
| 546 | - }else if( (tmFlags & TIMELINE_ARTID)!=0 ){ | |
| 547 | - hyperlink_to_uuid(zUuid); | |
| 548 | - } | |
| 549 | - if( tmFlags & TIMELINE_SHOWRID ){ | |
| 550 | - int srcId = delta_source_rid(rid); | |
| 551 | - if( srcId ){ | |
| 552 | - @ (%d(rid)←%d(srcId)) | |
| 553 | - }else{ | |
| 554 | - @ (%d(rid)) | |
| 555 | - } | |
| 556 | - } | |
| 557 | - drawDetailEllipsis = 1; | |
| 558 | - } | |
| 559 | -#endif | |
| 560 | - | |
| 561 | 499 | /* Generate extra information and hyperlinks to follow the comment. |
| 562 | 500 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 563 | 501 | */ |
| 564 | 502 | if( drawDetailEllipsis ){ |
| 565 | 503 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ |
| 566 | 504 | @ onclick='toggleDetail(%d(rid))'>...</span> |
| 567 | 505 | } |
| 568 | - if( bSeparateDetail ){ | |
| 506 | + if( tmFlags & TIMELINE_COLUMNAR ){ | |
| 569 | 507 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 570 | 508 | @ <td class="timelineTableCell timelineDetailCell" |
| 571 | 509 | @ style="background-color: %h(zBgClr);"> |
| 572 | 510 | }else{ |
| 573 | 511 | @ <td class="timelineTableCell timelineDetailCell"> |
| 574 | 512 | } |
| 575 | 513 | } |
| 576 | 514 | if( tmFlags & TIMELINE_COMPACT ){ |
| 577 | - cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>", rid); | |
| 515 | + cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>",rid); | |
| 578 | 516 | }else{ |
| 579 | 517 | cgi_printf("<span class='timelineDetailWrapper'>"); |
| 580 | 518 | } |
| 581 | 519 | if( zType[0]=='c' ){ |
| 582 | 520 | cgi_printf("<span class='timelineDetail timelineCheckinDetail'>"); |
| 583 | 521 | }else{ |
| 584 | 522 | cgi_printf("<span class='timelineDetail'>"); |
| 585 | 523 | } |
| 586 | 524 | |
| 587 | - if( bHashInDetail ){ | |
| 588 | - if( zType[0]=='c' ){ | |
| 589 | - if( isLeaf ){ | |
| 590 | - if( db_exists("SELECT 1 FROM tagxref" | |
| 591 | - " WHERE rid=%d AND tagid=%d AND tagtype>0", | |
| 592 | - rid, TAG_CLOSED) ){ | |
| 593 | - @ <span class='timelineLeaf'>Closed-Leaf</span> | |
| 594 | - }else{ | |
| 595 | - @ <span class='timelineLeaf'>Leaf</span> | |
| 596 | - } | |
| 597 | - } | |
| 598 | - cgi_printf("check-in: "); | |
| 599 | - hyperlink_to_uuid(zUuid); | |
| 600 | - }else if( zType[0]=='e' && tagid ){ | |
| 601 | - cgi_printf("technote: "); | |
| 602 | - hyperlink_to_event_tagid(tagid<0?-tagid:tagid); | |
| 603 | - }else{ | |
| 604 | - cgi_printf("artifact: "); | |
| 605 | - hyperlink_to_uuid(zUuid); | |
| 606 | - } | |
| 525 | + if( zType[0]=='c' ){ | |
| 526 | + if( isLeaf ){ | |
| 527 | + if( db_exists("SELECT 1 FROM tagxref" | |
| 528 | + " WHERE rid=%d AND tagid=%d AND tagtype>0", | |
| 529 | + rid, TAG_CLOSED) ){ | |
| 530 | + @ <span class='timelineLeaf'>Closed-Leaf</span> | |
| 531 | + }else{ | |
| 532 | + @ <span class='timelineLeaf'>Leaf</span> | |
| 533 | + } | |
| 534 | + } | |
| 535 | + cgi_printf("check-in: "); | |
| 536 | + hyperlink_to_uuid(zUuid); | |
| 537 | + }else if( zType[0]=='e' && tagid ){ | |
| 538 | + cgi_printf("technote: "); | |
| 539 | + hyperlink_to_event_tagid(tagid<0?-tagid:tagid); | |
| 540 | + }else{ | |
| 541 | + cgi_printf("artifact: "); | |
| 542 | + hyperlink_to_uuid(zUuid); | |
| 607 | 543 | } |
| 608 | 544 | |
| 609 | 545 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 610 | 546 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 611 | - cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); | |
| 547 | + cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); | |
| 612 | 548 | }else{ |
| 613 | - cgi_printf("user: %h", zDispUser); | |
| 549 | + cgi_printf("user: %h", zDispUser); | |
| 614 | 550 | } |
| 615 | 551 | |
| 616 | 552 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 617 | 553 | ** with hyperlinks to the tag list. |
| 618 | 554 | */ |
| @@ -634,30 +570,31 @@ | ||
| 634 | 570 | blob_appendf(&links, "%#h", i+2, z); |
| 635 | 571 | } |
| 636 | 572 | if( z[i]==0 ) break; |
| 637 | 573 | z += i+2; |
| 638 | 574 | } |
| 639 | - cgi_printf(" tags: %s", blob_str(&links)); | |
| 575 | + cgi_printf(" tags: %s", blob_str(&links)); | |
| 640 | 576 | blob_reset(&links); |
| 641 | 577 | }else{ |
| 642 | - cgi_printf(" tags: %h", zTagList); | |
| 578 | + cgi_printf(" tags: %h", zTagList); | |
| 643 | 579 | } |
| 644 | 580 | } |
| 645 | 581 | |
| 646 | 582 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 647 | 583 | int srcId = delta_source_rid(rid); |
| 648 | 584 | if( srcId ){ |
| 649 | - cgi_printf(" id: %d←%d", rid, srcId); | |
| 585 | + cgi_printf(" id: %d←%d", rid, srcId); | |
| 650 | 586 | }else{ |
| 651 | - cgi_printf(" id: %d", rid); | |
| 587 | + cgi_printf(" id: %d", rid); | |
| 652 | 588 | } |
| 653 | 589 | } |
| 654 | 590 | tag_private_status(rid); |
| 655 | 591 | if( xExtra ){ |
| 656 | 592 | xExtra(rid); |
| 657 | 593 | } |
| 658 | - cgi_printf("</span></span>\n"); /* End timelineDetail and timelineDetailWrapper */ | |
| 594 | + /* End timelineDetail and timelineDetailWrapper */ | |
| 595 | + cgi_printf("</span></span>\n"); | |
| 659 | 596 | |
| 660 | 597 | /* Generate the file-change list if requested */ |
| 661 | 598 | if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0 |
| 662 | 599 | && zType[0]=='c' && g.perm.Hyperlink |
| 663 | 600 | ){ |
| @@ -1622,11 +1559,11 @@ | ||
| 1622 | 1559 | ** rel Show related check-ins as well as those matching t=TAG |
| 1623 | 1560 | ** mionly Limit rel to show ancestors but not descendants |
| 1624 | 1561 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| 1625 | 1562 | ** u=USER Only show items associated with USER |
| 1626 | 1563 | ** y=TYPE 'ci', 'w', 't', 'e', or 'all'. |
| 1627 | -** vs=VIEWSTYLE c: "compact" d: "detail" n: "normal" | |
| 1564 | +** ss=VIEWSTYLE c: "compact" d: "detail" n: "normal" j: "columnar" | |
| 1628 | 1565 | ** ng No Graph. |
| 1629 | 1566 | ** nd Do not highlight the focus check-in |
| 1630 | 1567 | ** v Show details of files changed |
| 1631 | 1568 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1632 | 1569 | ** from=CHECKIN Path from... |
| @@ -1706,15 +1643,16 @@ | ||
| 1706 | 1643 | char cViewStyle; /* Overall style of the page */ |
| 1707 | 1644 | static const char *azViewStyles[] = { |
| 1708 | 1645 | "n", "Normal", |
| 1709 | 1646 | "c", "Compact", |
| 1710 | 1647 | "d", "Detailed", |
| 1648 | + "j", "Columnar", | |
| 1711 | 1649 | }; |
| 1712 | 1650 | |
| 1713 | 1651 | /* Set number of rows to display */ |
| 1714 | 1652 | cookie_parse("fossil_display_settings"); |
| 1715 | - cookie_link_parameter("n","tln"); | |
| 1653 | + cookie_link_parameter("n","n"); | |
| 1716 | 1654 | z = P("n"); |
| 1717 | 1655 | if( z==0 ) z = db_get("timeline-default-length",0); |
| 1718 | 1656 | if( z ){ |
| 1719 | 1657 | if( fossil_strcmp(z,"all")==0 ){ |
| 1720 | 1658 | nEntry = 0; |
| @@ -1727,13 +1665,13 @@ | ||
| 1727 | 1665 | } |
| 1728 | 1666 | }else{ |
| 1729 | 1667 | cgi_replace_query_parameter("n","50"); |
| 1730 | 1668 | nEntry = 50; |
| 1731 | 1669 | } |
| 1732 | - cookie_link_parameter("vs","tlvs"); | |
| 1733 | - cViewStyle = PD("vs","n")[0]; | |
| 1734 | - style_submenu_multichoice("vs", 3, azViewStyles, 0); | |
| 1670 | + cookie_link_parameter("ss","ss"); | |
| 1671 | + cViewStyle = PD("ss","n")[0]; | |
| 1672 | + style_submenu_multichoice("ss", 4, azViewStyles, 0); | |
| 1735 | 1673 | |
| 1736 | 1674 | |
| 1737 | 1675 | /* To view the timeline, must have permission to read project data. |
| 1738 | 1676 | */ |
| 1739 | 1677 | pd_rid = name_to_typed_rid(P("dp"),"ci"); |
| @@ -1745,18 +1683,18 @@ | ||
| 1745 | 1683 | || (bisectOnly && !g.perm.Setup) |
| 1746 | 1684 | ){ |
| 1747 | 1685 | login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki); |
| 1748 | 1686 | return; |
| 1749 | 1687 | } |
| 1750 | - cookie_read_parameter("y","tly"); | |
| 1688 | + cookie_read_parameter("y","y"); | |
| 1751 | 1689 | zType = P("y"); |
| 1752 | 1690 | if( zType==0 ){ |
| 1753 | 1691 | zType = g.perm.Read ? "ci" : "all"; |
| 1754 | 1692 | cgi_set_parameter("y", zType); |
| 1755 | 1693 | } |
| 1756 | 1694 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1757 | - cookie_write_parameter("y","tly"); | |
| 1695 | + cookie_write_parameter("y","y"); | |
| 1758 | 1696 | } |
| 1759 | 1697 | cookie_render(); |
| 1760 | 1698 | url_initialize(&url, "timeline"); |
| 1761 | 1699 | cgi_query_parameters_to_url(&url); |
| 1762 | 1700 | |
| @@ -1805,13 +1743,14 @@ | ||
| 1805 | 1743 | ){ |
| 1806 | 1744 | nEntry = -1; |
| 1807 | 1745 | zCirca = 0; |
| 1808 | 1746 | } |
| 1809 | 1747 | switch( cViewStyle ){ |
| 1810 | - case 'n': tmFlags |= TIMELINE_NORMAL; break; | |
| 1748 | + case 'n': tmFlags |= TIMELINE_NORMAL; break; | |
| 1811 | 1749 | case 'c': tmFlags |= TIMELINE_COMPACT; break; |
| 1812 | - case 'd': tmFlags |= TIMELINE_DETAILED; break; | |
| 1750 | + case 'd': tmFlags |= TIMELINE_DETAILED; break; | |
| 1751 | + case 'j': tmFlags |= TIMELINE_COLUMNAR; break; | |
| 1813 | 1752 | } |
| 1814 | 1753 | if( zType[0]=='a' ){ |
| 1815 | 1754 | tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH; |
| 1816 | 1755 | }else{ |
| 1817 | 1756 | tmFlags |= TIMELINE_GRAPH; |
| 1818 | 1757 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -106,10 +106,11 @@ | |
| 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | #define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */ |
| 109 | #define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */ |
| 110 | #define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */ |
| 111 | #endif |
| 112 | |
| 113 | /* |
| 114 | ** Hash a string and use the hash to determine a background color. |
| 115 | */ |
| @@ -252,16 +253,10 @@ | |
| 252 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 253 | int vid = 0; /* Current checkout version */ |
| 254 | int dateFormat = 0; /* 0: HH:MM (default) */ |
| 255 | int bCommentGitStyle = 0; /* Only show comments through first blank line */ |
| 256 | const char *zTdClass; |
| 257 | int bHashBeforeComment = 0; /* Show hash before the comment */ |
| 258 | int bHashAfterComment = 0; /* Show hash after the comment */ |
| 259 | int bHashInDetail = 0; /* Show the hash inside the detail section */ |
| 260 | int bShowDetail; /* Show the detail section */ |
| 261 | int bSeparateDetail; /* Detail in a separate column */ |
| 262 | int eCommentFormat; /* value for timeline-comment-format */ |
| 263 | const char *zDateFmt; |
| 264 | int iTableId = timeline_tableid(); |
| 265 | |
| 266 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 267 | vid = db_lget_int("checkout", 0); |
| @@ -439,11 +434,12 @@ | |
| 439 | db_reset(&qbranch); |
| 440 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 441 | } |
| 442 | @</td> |
| 443 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 444 | @ <td class="timelineTableCell %s(zTdClass)" style="background-color: %h(zBgClr);"> |
| 445 | }else{ |
| 446 | @ <td class="timelineTableCell %s(zTdClass)"> |
| 447 | } |
| 448 | if( pGraph && zType[0]!='c' ){ |
| 449 | @ • |
| @@ -459,38 +455,10 @@ | |
| 459 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 460 | @ (%d(db_column_int(&bisectQuery,0))) |
| 461 | } |
| 462 | db_reset(&bisectQuery); |
| 463 | } |
| 464 | #if 0 |
| 465 | if( bHashBeforeComment ){ |
| 466 | if( zType[0]=='c' ){ |
| 467 | hyperlink_to_uuid(zUuid); |
| 468 | if( isLeaf ){ |
| 469 | if( db_exists("SELECT 1 FROM tagxref" |
| 470 | " WHERE rid=%d AND tagid=%d AND tagtype>0", |
| 471 | rid, TAG_CLOSED) ){ |
| 472 | @ <span class="timelineLeaf">Closed-Leaf:</span> |
| 473 | }else{ |
| 474 | @ <span class="timelineLeaf">Leaf:</span> |
| 475 | } |
| 476 | } |
| 477 | }else if( zType[0]=='e' && tagid ){ |
| 478 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 479 | }else if( (tmFlags & TIMELINE_ARTID)!=0 ){ |
| 480 | hyperlink_to_uuid(zUuid); |
| 481 | } |
| 482 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 483 | int srcId = delta_source_rid(rid); |
| 484 | if( srcId ){ |
| 485 | @ (%d(rid)←%d(srcId)) |
| 486 | }else{ |
| 487 | @ (%d(rid)) |
| 488 | } |
| 489 | } |
| 490 | } |
| 491 | #endif |
| 492 | drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0; |
| 493 | db_column_blob(pQuery, commentColumn, &comment); |
| 494 | if( zType[0]!='c' ){ |
| 495 | /* Comments for anything other than a check-in are generated by |
| 496 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| @@ -526,93 +494,61 @@ | |
| 526 | } |
| 527 | @ </span> |
| 528 | } |
| 529 | blob_reset(&comment); |
| 530 | |
| 531 | #if 0 |
| 532 | if( bHashAfterComment ){ |
| 533 | if( zType[0]=='c' ){ |
| 534 | hyperlink_to_uuid(zUuid); |
| 535 | if( isLeaf ){ |
| 536 | if( db_exists("SELECT 1 FROM tagxref" |
| 537 | " WHERE rid=%d AND tagid=%d AND tagtype>0", |
| 538 | rid, TAG_CLOSED) ){ |
| 539 | @ <span class="timelineLeaf">Closed-Leaf</span> |
| 540 | }else{ |
| 541 | @ <span class="timelineLeaf">Leaf</span> |
| 542 | } |
| 543 | } |
| 544 | }else if( zType[0]=='e' && tagid ){ |
| 545 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 546 | }else if( (tmFlags & TIMELINE_ARTID)!=0 ){ |
| 547 | hyperlink_to_uuid(zUuid); |
| 548 | } |
| 549 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 550 | int srcId = delta_source_rid(rid); |
| 551 | if( srcId ){ |
| 552 | @ (%d(rid)←%d(srcId)) |
| 553 | }else{ |
| 554 | @ (%d(rid)) |
| 555 | } |
| 556 | } |
| 557 | drawDetailEllipsis = 1; |
| 558 | } |
| 559 | #endif |
| 560 | |
| 561 | /* Generate extra information and hyperlinks to follow the comment. |
| 562 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 563 | */ |
| 564 | if( drawDetailEllipsis ){ |
| 565 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ |
| 566 | @ onclick='toggleDetail(%d(rid))'>...</span> |
| 567 | } |
| 568 | if( bSeparateDetail ){ |
| 569 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 570 | @ <td class="timelineTableCell timelineDetailCell" |
| 571 | @ style="background-color: %h(zBgClr);"> |
| 572 | }else{ |
| 573 | @ <td class="timelineTableCell timelineDetailCell"> |
| 574 | } |
| 575 | } |
| 576 | if( tmFlags & TIMELINE_COMPACT ){ |
| 577 | cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>", rid); |
| 578 | }else{ |
| 579 | cgi_printf("<span class='timelineDetailWrapper'>"); |
| 580 | } |
| 581 | if( zType[0]=='c' ){ |
| 582 | cgi_printf("<span class='timelineDetail timelineCheckinDetail'>"); |
| 583 | }else{ |
| 584 | cgi_printf("<span class='timelineDetail'>"); |
| 585 | } |
| 586 | |
| 587 | if( bHashInDetail ){ |
| 588 | if( zType[0]=='c' ){ |
| 589 | if( isLeaf ){ |
| 590 | if( db_exists("SELECT 1 FROM tagxref" |
| 591 | " WHERE rid=%d AND tagid=%d AND tagtype>0", |
| 592 | rid, TAG_CLOSED) ){ |
| 593 | @ <span class='timelineLeaf'>Closed-Leaf</span> |
| 594 | }else{ |
| 595 | @ <span class='timelineLeaf'>Leaf</span> |
| 596 | } |
| 597 | } |
| 598 | cgi_printf("check-in: "); |
| 599 | hyperlink_to_uuid(zUuid); |
| 600 | }else if( zType[0]=='e' && tagid ){ |
| 601 | cgi_printf("technote: "); |
| 602 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 603 | }else{ |
| 604 | cgi_printf("artifact: "); |
| 605 | hyperlink_to_uuid(zUuid); |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 610 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 611 | cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); |
| 612 | }else{ |
| 613 | cgi_printf("user: %h", zDispUser); |
| 614 | } |
| 615 | |
| 616 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 617 | ** with hyperlinks to the tag list. |
| 618 | */ |
| @@ -634,30 +570,31 @@ | |
| 634 | blob_appendf(&links, "%#h", i+2, z); |
| 635 | } |
| 636 | if( z[i]==0 ) break; |
| 637 | z += i+2; |
| 638 | } |
| 639 | cgi_printf(" tags: %s", blob_str(&links)); |
| 640 | blob_reset(&links); |
| 641 | }else{ |
| 642 | cgi_printf(" tags: %h", zTagList); |
| 643 | } |
| 644 | } |
| 645 | |
| 646 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 647 | int srcId = delta_source_rid(rid); |
| 648 | if( srcId ){ |
| 649 | cgi_printf(" id: %d←%d", rid, srcId); |
| 650 | }else{ |
| 651 | cgi_printf(" id: %d", rid); |
| 652 | } |
| 653 | } |
| 654 | tag_private_status(rid); |
| 655 | if( xExtra ){ |
| 656 | xExtra(rid); |
| 657 | } |
| 658 | cgi_printf("</span></span>\n"); /* End timelineDetail and timelineDetailWrapper */ |
| 659 | |
| 660 | /* Generate the file-change list if requested */ |
| 661 | if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0 |
| 662 | && zType[0]=='c' && g.perm.Hyperlink |
| 663 | ){ |
| @@ -1622,11 +1559,11 @@ | |
| 1622 | ** rel Show related check-ins as well as those matching t=TAG |
| 1623 | ** mionly Limit rel to show ancestors but not descendants |
| 1624 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| 1625 | ** u=USER Only show items associated with USER |
| 1626 | ** y=TYPE 'ci', 'w', 't', 'e', or 'all'. |
| 1627 | ** vs=VIEWSTYLE c: "compact" d: "detail" n: "normal" |
| 1628 | ** ng No Graph. |
| 1629 | ** nd Do not highlight the focus check-in |
| 1630 | ** v Show details of files changed |
| 1631 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1632 | ** from=CHECKIN Path from... |
| @@ -1706,15 +1643,16 @@ | |
| 1706 | char cViewStyle; /* Overall style of the page */ |
| 1707 | static const char *azViewStyles[] = { |
| 1708 | "n", "Normal", |
| 1709 | "c", "Compact", |
| 1710 | "d", "Detailed", |
| 1711 | }; |
| 1712 | |
| 1713 | /* Set number of rows to display */ |
| 1714 | cookie_parse("fossil_display_settings"); |
| 1715 | cookie_link_parameter("n","tln"); |
| 1716 | z = P("n"); |
| 1717 | if( z==0 ) z = db_get("timeline-default-length",0); |
| 1718 | if( z ){ |
| 1719 | if( fossil_strcmp(z,"all")==0 ){ |
| 1720 | nEntry = 0; |
| @@ -1727,13 +1665,13 @@ | |
| 1727 | } |
| 1728 | }else{ |
| 1729 | cgi_replace_query_parameter("n","50"); |
| 1730 | nEntry = 50; |
| 1731 | } |
| 1732 | cookie_link_parameter("vs","tlvs"); |
| 1733 | cViewStyle = PD("vs","n")[0]; |
| 1734 | style_submenu_multichoice("vs", 3, azViewStyles, 0); |
| 1735 | |
| 1736 | |
| 1737 | /* To view the timeline, must have permission to read project data. |
| 1738 | */ |
| 1739 | pd_rid = name_to_typed_rid(P("dp"),"ci"); |
| @@ -1745,18 +1683,18 @@ | |
| 1745 | || (bisectOnly && !g.perm.Setup) |
| 1746 | ){ |
| 1747 | login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki); |
| 1748 | return; |
| 1749 | } |
| 1750 | cookie_read_parameter("y","tly"); |
| 1751 | zType = P("y"); |
| 1752 | if( zType==0 ){ |
| 1753 | zType = g.perm.Read ? "ci" : "all"; |
| 1754 | cgi_set_parameter("y", zType); |
| 1755 | } |
| 1756 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1757 | cookie_write_parameter("y","tly"); |
| 1758 | } |
| 1759 | cookie_render(); |
| 1760 | url_initialize(&url, "timeline"); |
| 1761 | cgi_query_parameters_to_url(&url); |
| 1762 | |
| @@ -1805,13 +1743,14 @@ | |
| 1805 | ){ |
| 1806 | nEntry = -1; |
| 1807 | zCirca = 0; |
| 1808 | } |
| 1809 | switch( cViewStyle ){ |
| 1810 | case 'n': tmFlags |= TIMELINE_NORMAL; break; |
| 1811 | case 'c': tmFlags |= TIMELINE_COMPACT; break; |
| 1812 | case 'd': tmFlags |= TIMELINE_DETAILED; break; |
| 1813 | } |
| 1814 | if( zType[0]=='a' ){ |
| 1815 | tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH; |
| 1816 | }else{ |
| 1817 | tmFlags |= TIMELINE_GRAPH; |
| 1818 |
| --- src/timeline.c | |
| +++ src/timeline.c | |
| @@ -106,10 +106,11 @@ | |
| 106 | #define TIMELINE_SHOWRID 0x0400 /* Show RID values in addition to UUIDs */ |
| 107 | #define TIMELINE_BISECT 0x0800 /* Show supplimental bisect information */ |
| 108 | #define TIMELINE_COMPACT 0x1000 /* Use the "compact" view style */ |
| 109 | #define TIMELINE_DETAILED 0x2000 /* Use the "detailed" view style */ |
| 110 | #define TIMELINE_NORMAL 0x4000 /* Use the "normal" view style */ |
| 111 | #define TIMELINE_COLUMNAR 0x8000 /* Use the "columns view style */ |
| 112 | #endif |
| 113 | |
| 114 | /* |
| 115 | ** Hash a string and use the hash to determine a background color. |
| 116 | */ |
| @@ -252,16 +253,10 @@ | |
| 253 | int pendingEndTr = 0; /* True if a </td></tr> is needed */ |
| 254 | int vid = 0; /* Current checkout version */ |
| 255 | int dateFormat = 0; /* 0: HH:MM (default) */ |
| 256 | int bCommentGitStyle = 0; /* Only show comments through first blank line */ |
| 257 | const char *zTdClass; |
| 258 | const char *zDateFmt; |
| 259 | int iTableId = timeline_tableid(); |
| 260 | |
| 261 | if( fossil_strcmp(g.zIpAddr, "127.0.0.1")==0 && db_open_local(0) ){ |
| 262 | vid = db_lget_int("checkout", 0); |
| @@ -439,11 +434,12 @@ | |
| 434 | db_reset(&qbranch); |
| 435 | @ <div id="m%d(gidx)" class="tl-nodemark"></div> |
| 436 | } |
| 437 | @</td> |
| 438 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 439 | @ <td class="timelineTableCell %s(zTdClass)" \ |
| 440 | @ style="background-color: %h(zBgClr);"> |
| 441 | }else{ |
| 442 | @ <td class="timelineTableCell %s(zTdClass)"> |
| 443 | } |
| 444 | if( pGraph && zType[0]!='c' ){ |
| 445 | @ • |
| @@ -459,38 +455,10 @@ | |
| 455 | @ <b>%s(db_column_text(&bisectQuery,1))</b> |
| 456 | @ (%d(db_column_int(&bisectQuery,0))) |
| 457 | } |
| 458 | db_reset(&bisectQuery); |
| 459 | } |
| 460 | drawDetailEllipsis = (tmFlags & TIMELINE_COMPACT)!=0; |
| 461 | db_column_blob(pQuery, commentColumn, &comment); |
| 462 | if( zType[0]!='c' ){ |
| 463 | /* Comments for anything other than a check-in are generated by |
| 464 | ** "fossil rebuild" and expect to be rendered as text/x-fossil-wiki */ |
| @@ -526,93 +494,61 @@ | |
| 494 | } |
| 495 | @ </span> |
| 496 | } |
| 497 | blob_reset(&comment); |
| 498 | |
| 499 | /* Generate extra information and hyperlinks to follow the comment. |
| 500 | ** Example: "(check-in: [abcdefg], user: drh, tags: trunk)" |
| 501 | */ |
| 502 | if( drawDetailEllipsis ){ |
| 503 | @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(rid)' \ |
| 504 | @ onclick='toggleDetail(%d(rid))'>...</span> |
| 505 | } |
| 506 | if( tmFlags & TIMELINE_COLUMNAR ){ |
| 507 | if( zBgClr && zBgClr[0] && rid!=selectedRid ){ |
| 508 | @ <td class="timelineTableCell timelineDetailCell" |
| 509 | @ style="background-color: %h(zBgClr);"> |
| 510 | }else{ |
| 511 | @ <td class="timelineTableCell timelineDetailCell"> |
| 512 | } |
| 513 | } |
| 514 | if( tmFlags & TIMELINE_COMPACT ){ |
| 515 | cgi_printf("<span class='timelineDetailWrapper clutter' id='detail-%d'>",rid); |
| 516 | }else{ |
| 517 | cgi_printf("<span class='timelineDetailWrapper'>"); |
| 518 | } |
| 519 | if( zType[0]=='c' ){ |
| 520 | cgi_printf("<span class='timelineDetail timelineCheckinDetail'>"); |
| 521 | }else{ |
| 522 | cgi_printf("<span class='timelineDetail'>"); |
| 523 | } |
| 524 | |
| 525 | if( zType[0]=='c' ){ |
| 526 | if( isLeaf ){ |
| 527 | if( db_exists("SELECT 1 FROM tagxref" |
| 528 | " WHERE rid=%d AND tagid=%d AND tagtype>0", |
| 529 | rid, TAG_CLOSED) ){ |
| 530 | @ <span class='timelineLeaf'>Closed-Leaf</span> |
| 531 | }else{ |
| 532 | @ <span class='timelineLeaf'>Leaf</span> |
| 533 | } |
| 534 | } |
| 535 | cgi_printf("check-in: "); |
| 536 | hyperlink_to_uuid(zUuid); |
| 537 | }else if( zType[0]=='e' && tagid ){ |
| 538 | cgi_printf("technote: "); |
| 539 | hyperlink_to_event_tagid(tagid<0?-tagid:tagid); |
| 540 | }else{ |
| 541 | cgi_printf("artifact: "); |
| 542 | hyperlink_to_uuid(zUuid); |
| 543 | } |
| 544 | |
| 545 | if( g.perm.Hyperlink && fossil_strcmp(zDispUser, zThisUser)!=0 ){ |
| 546 | char *zLink = mprintf("%R/timeline?u=%h&c=%t&nd&n=200", zDispUser, zDate); |
| 547 | cgi_printf("user: %z%h</a>", href("%z",zLink), zDispUser); |
| 548 | }else{ |
| 549 | cgi_printf("user: %h", zDispUser); |
| 550 | } |
| 551 | |
| 552 | /* Generate the "tags: TAGLIST" at the end of the comment, together |
| 553 | ** with hyperlinks to the tag list. |
| 554 | */ |
| @@ -634,30 +570,31 @@ | |
| 570 | blob_appendf(&links, "%#h", i+2, z); |
| 571 | } |
| 572 | if( z[i]==0 ) break; |
| 573 | z += i+2; |
| 574 | } |
| 575 | cgi_printf(" tags: %s", blob_str(&links)); |
| 576 | blob_reset(&links); |
| 577 | }else{ |
| 578 | cgi_printf(" tags: %h", zTagList); |
| 579 | } |
| 580 | } |
| 581 | |
| 582 | if( tmFlags & TIMELINE_SHOWRID ){ |
| 583 | int srcId = delta_source_rid(rid); |
| 584 | if( srcId ){ |
| 585 | cgi_printf(" id: %d←%d", rid, srcId); |
| 586 | }else{ |
| 587 | cgi_printf(" id: %d", rid); |
| 588 | } |
| 589 | } |
| 590 | tag_private_status(rid); |
| 591 | if( xExtra ){ |
| 592 | xExtra(rid); |
| 593 | } |
| 594 | /* End timelineDetail and timelineDetailWrapper */ |
| 595 | cgi_printf("</span></span>\n"); |
| 596 | |
| 597 | /* Generate the file-change list if requested */ |
| 598 | if( (tmFlags & (TIMELINE_FCHANGES|TIMELINE_FRENAMES))!=0 |
| 599 | && zType[0]=='c' && g.perm.Hyperlink |
| 600 | ){ |
| @@ -1622,11 +1559,11 @@ | |
| 1559 | ** rel Show related check-ins as well as those matching t=TAG |
| 1560 | ** mionly Limit rel to show ancestors but not descendants |
| 1561 | ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP |
| 1562 | ** u=USER Only show items associated with USER |
| 1563 | ** y=TYPE 'ci', 'w', 't', 'e', or 'all'. |
| 1564 | ** ss=VIEWSTYLE c: "compact" d: "detail" n: "normal" j: "columnar" |
| 1565 | ** ng No Graph. |
| 1566 | ** nd Do not highlight the focus check-in |
| 1567 | ** v Show details of files changed |
| 1568 | ** f=CHECKIN Show family (immediate parents and children) of CHECKIN |
| 1569 | ** from=CHECKIN Path from... |
| @@ -1706,15 +1643,16 @@ | |
| 1643 | char cViewStyle; /* Overall style of the page */ |
| 1644 | static const char *azViewStyles[] = { |
| 1645 | "n", "Normal", |
| 1646 | "c", "Compact", |
| 1647 | "d", "Detailed", |
| 1648 | "j", "Columnar", |
| 1649 | }; |
| 1650 | |
| 1651 | /* Set number of rows to display */ |
| 1652 | cookie_parse("fossil_display_settings"); |
| 1653 | cookie_link_parameter("n","n"); |
| 1654 | z = P("n"); |
| 1655 | if( z==0 ) z = db_get("timeline-default-length",0); |
| 1656 | if( z ){ |
| 1657 | if( fossil_strcmp(z,"all")==0 ){ |
| 1658 | nEntry = 0; |
| @@ -1727,13 +1665,13 @@ | |
| 1665 | } |
| 1666 | }else{ |
| 1667 | cgi_replace_query_parameter("n","50"); |
| 1668 | nEntry = 50; |
| 1669 | } |
| 1670 | cookie_link_parameter("ss","ss"); |
| 1671 | cViewStyle = PD("ss","n")[0]; |
| 1672 | style_submenu_multichoice("ss", 4, azViewStyles, 0); |
| 1673 | |
| 1674 | |
| 1675 | /* To view the timeline, must have permission to read project data. |
| 1676 | */ |
| 1677 | pd_rid = name_to_typed_rid(P("dp"),"ci"); |
| @@ -1745,18 +1683,18 @@ | |
| 1683 | || (bisectOnly && !g.perm.Setup) |
| 1684 | ){ |
| 1685 | login_needed(g.anon.Read && g.anon.RdTkt && g.anon.RdWiki); |
| 1686 | return; |
| 1687 | } |
| 1688 | cookie_read_parameter("y","y"); |
| 1689 | zType = P("y"); |
| 1690 | if( zType==0 ){ |
| 1691 | zType = g.perm.Read ? "ci" : "all"; |
| 1692 | cgi_set_parameter("y", zType); |
| 1693 | } |
| 1694 | if( zType[0]=='a' || zType[0]=='c' ){ |
| 1695 | cookie_write_parameter("y","y"); |
| 1696 | } |
| 1697 | cookie_render(); |
| 1698 | url_initialize(&url, "timeline"); |
| 1699 | cgi_query_parameters_to_url(&url); |
| 1700 | |
| @@ -1805,13 +1743,14 @@ | |
| 1743 | ){ |
| 1744 | nEntry = -1; |
| 1745 | zCirca = 0; |
| 1746 | } |
| 1747 | switch( cViewStyle ){ |
| 1748 | case 'n': tmFlags |= TIMELINE_NORMAL; break; |
| 1749 | case 'c': tmFlags |= TIMELINE_COMPACT; break; |
| 1750 | case 'd': tmFlags |= TIMELINE_DETAILED; break; |
| 1751 | case 'j': tmFlags |= TIMELINE_COLUMNAR; break; |
| 1752 | } |
| 1753 | if( zType[0]=='a' ){ |
| 1754 | tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH; |
| 1755 | }else{ |
| 1756 | tmFlags |= TIMELINE_GRAPH; |
| 1757 |