Fossil SCM

Add the "View" selector to the /finfo page.

drh 2017-11-29 13:25 UTC sticky-timeline-style
Commit e36f693f7afe35593caec99de8abe5869a25d1f582c627ef297e7536795f09e6
2 files changed +96 -75 +26 -17
+96 -75
--- src/finfo.c
+++ src/finfo.c
@@ -314,34 +314,49 @@
314314
int fDebug = atoi(PD("debug","0"));
315315
int fShowId = P("showid")!=0;
316316
Stmt qparent;
317317
int iTableId = timeline_tableid();
318318
int bHashBeforeComment = 0; /* Show hash before the comment */
319
- int bHashAfterComment = 0; /* Show hash after the comment */
320319
int bHashInDetail = 0; /* Show the hash inside the detail section */
321320
int bShowDetail; /* Show the detail section */
322321
int bSeparateDetail; /* Detail section in a separate column */
323322
int eCommentFormat; /* value for timeline-comment-format */
323
+ int tmFlags = 0; /* Viewing mode */
324
+ const char *zStyle; /* Viewing mode name */
324325
325326
login_check_credentials();
326327
if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
327328
style_header("File History");
328329
login_anonymous_available();
330
+ cookie_parse(DISPLAY_SETTINGS_COOKIE);
331
+ tmFlags = timeline_ss_submenu();
332
+ if( tmFlags & TIMELINE_COLUMNAR ){
333
+ zStyle = "Columnar";
334
+ }else if( tmFlags & TIMELINE_COMPACT ){
335
+ zStyle = "Compact";
336
+ }else if( tmFlags & TIMELINE_VERBOSE ){
337
+ zStyle = "Verbose";
338
+ }else{
339
+ zStyle = "Modern";
340
+ }
329341
url_initialize(&url, "finfo");
330342
if( brBg ) url_add_parameter(&url, "brbg", 0);
331343
if( uBg ) url_add_parameter(&url, "ubg", 0);
332344
baseCheckin = name_to_rid_www("ci");
333345
zPrevDate[0] = 0;
334346
zFilename = PD("name","");
347
+ cookie_render();
348
+#if 0
335349
eCommentFormat = db_get_int("timeline-comment-format", 4);
336350
bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
337351
bSeparateDetail = (eCommentFormat & 8)!=0;
338352
switch( (eCommentFormat>>1)&3 ){
339353
case 1: bHashAfterComment = 1; break;
340354
case 2: bHashInDetail = 1; break;
341355
default: bHashBeforeComment = 1; break;
342356
}
357
+#endif
343358
fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
344359
if( fnid==0 ){
345360
@ No such file: %h(zFilename)
346361
style_footer();
347362
return;
@@ -445,12 +460,10 @@
445460
}else{
446461
blob_appendf(&title, "History of ");
447462
hyperlinked_path(zFilename, &title, 0, "tree", "");
448463
if( fShowId ) blob_appendf(&title, " (%d)", fnid);
449464
}
450
- style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
451
- style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
452465
@ <h2>%b(&title)</h2>
453466
blob_reset(&title);
454467
pGraph = graph_init();
455468
@ <table id="timelineTable%d(iTableId)" class="timelineTable">
456469
if( baseCheckin ){
@@ -514,81 +527,86 @@
514527
@ <tr><td class="timelineTime">
515528
@ %z(href("%R/artifact/%!S",zUuid))%s(zTime)</a></td>
516529
@ <td class="timelineGraph"><div id="m%d(gidx)" class="tl-nodemark"></div>
517530
@ </td>
518531
if( zBgClr && zBgClr[0] ){
519
- @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
520
- }else{
521
- @ <td class="timelineTableCell">
522
- }
523
- if( bHashBeforeComment && zUuid ){
524
- hyperlink_to_uuid(zUuid);
525
- }
526
- @ <span class="timelineComment timelineCheckinComment" \
527
- @ onclick='toggleDetail(%d(frid))'>
528
- @ %W(zCom)</span>
529
- if( bHashAfterComment && zUuid ){
530
- hyperlink_to_uuid(zUuid);
531
- }
532
- if( bShowDetail ){
533
- @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
534
- @ onclick='toggleDetail(%d(frid))'>...</span>
535
- if( bSeparateDetail ){
536
- if( zBgClr && zBgClr[0] ){
537
- @ <td class="timelineTableCell timelineDetailCell"
538
- @ style="background-color: %h(zBgClr);">
539
- }else{
540
- @ <td class="timelineTableCell timelineDetailCell">
541
- }
542
- }
543
- cgi_printf("<span class='clutter' id='detail-%d'>", frid);
544
- cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
545
- if( zUuid && bHashInDetail ){
546
- @ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
547
- if( fShowId ){
548
- int srcId = delta_source_rid(frid);
549
- if( srcId>0 ){
550
- @ id: %d(frid)&larr;%d(srcId)
551
- }else{
552
- @ id: %d(frid)
553
- }
554
- }
555
- }
556
- @ check-in:
557
- hyperlink_to_uuid(zCkin);
558
- if( fShowId ){
559
- @ (%d(fmid))
560
- }
561
- @ user:
562
- hyperlink_to_user(zUser, zDate, ",");
563
- @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
564
- @ size: %d(szFile))
565
- if( zUuid && origCheckin==0 ){
566
- if( nParent==0 ){
567
- @ <b>Added</b>
568
- }else if( pfnid ){
569
- char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
570
- pfnid);
571
- @ <b>Renamed</b> from
572
- @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
573
- }
574
- }
575
- if( zUuid==0 ){
576
- char *zNewName;
577
- zNewName = db_text(0,
578
- "SELECT name FROM filename WHERE fnid = "
579
- " (SELECT fnid FROM mlink"
580
- " WHERE mid=%d"
581
- " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
582
- fmid, zFilename);
583
- if( zNewName ){
584
- @ <b>Renamed</b> to
585
- @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
586
- fossil_free(zNewName);
587
- }else{
588
- @ <b>Deleted</b>
589
- }
532
+ @ <td class="timeline%s(zStyle)Cell" \
533
+ @ style="background-color: %h(zBgClr);">
534
+ }else{
535
+ @ <td class="timeline%s(zStyle)Cell">
536
+ }
537
+ if( tmFlags & TIMELINE_COMPACT ){
538
+ @ <span class='timelineCompactComment' onclick='toggleDetail(%d(frid))'>
539
+ }else{
540
+ @ <span class='timeline%s(zStyle)Comment'>
541
+ if( (tmFlags & TIMELINE_VERBOSE)!=0 && zUuid ){
542
+ hyperlink_to_uuid(zUuid);
543
+ @ part of check-in \
544
+ hyperlink_to_uuid(zCkin);
545
+ }
546
+ }
547
+ @ %W(zCom)</span>
548
+ if( (tmFlags & TIMELINE_COMPACT)!=0 ){
549
+ @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
550
+ @ onclick='toggleDetail(%d(frid))'>...</span>
551
+ @ <span class='clutter timelineCompactDetail'
552
+ }
553
+ if( tmFlags & TIMELINE_COLUMNAR ){
554
+ if( zBgClr && zBgClr[0] ){
555
+ @ <td class="timelineDetailCell" style="background-color: %h(zBgClr);">
556
+ }else{
557
+ @ <td class="timelineDetailCell">
558
+ }
559
+ }
560
+ if( tmFlags & TIMELINE_COMPACT ){
561
+ cgi_printf("<span class='clutter' id='detail-%d'>",frid);
562
+ }
563
+ cgi_printf("<span class='timeline%sDetail'>", zStyle);
564
+ if( zUuid && (tmFlags & TIMELINE_VERBOSE)==0 ){
565
+ @ file:&nbsp;%z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
566
+ if( fShowId ){
567
+ int srcId = delta_source_rid(frid);
568
+ if( srcId>0 ){
569
+ @ id:&nbsp;%d(frid)&larr;%d(srcId)
570
+ }else{
571
+ @ id:&nbsp;%d(frid)
572
+ }
573
+ }
574
+ }
575
+ @ check-in:&nbsp;\
576
+ hyperlink_to_uuid(zCkin);
577
+ if( fShowId ){
578
+ @ (%d(fmid))
579
+ }
580
+ @ user:&nbsp;\
581
+ hyperlink_to_user(zUser, zDate, ",");
582
+ @ branch:&nbsp;%z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
583
+ @ size:&nbsp;%d(szFile))
584
+ if( zUuid && origCheckin==0 ){
585
+ if( nParent==0 ){
586
+ @ <b>Added</b>
587
+ }else if( pfnid ){
588
+ char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
589
+ pfnid);
590
+ @ <b>Renamed</b> from
591
+ @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
592
+ }
593
+ }
594
+ if( zUuid==0 ){
595
+ char *zNewName;
596
+ zNewName = db_text(0,
597
+ "SELECT name FROM filename WHERE fnid = "
598
+ " (SELECT fnid FROM mlink"
599
+ " WHERE mid=%d"
600
+ " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
601
+ fmid, zFilename);
602
+ if( zNewName ){
603
+ @ <b>Renamed</b> to
604
+ @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
605
+ fossil_free(zNewName);
606
+ }else{
607
+ @ <b>Deleted</b>
590608
}
591609
}
592610
if( g.perm.Hyperlink && zUuid ){
593611
const char *z = zFilename;
594612
@ <span id='links-%d(frid)'><span class='timelineExtraLinks'>
@@ -614,12 +632,15 @@
614632
}
615633
zAncLink = href("%R/finfo?name=%T&ci=%!S&debug=1",zFilename,zCkin);
616634
@ %z(zAncLink)[ancestry]</a>
617635
}
618636
tag_private_status(frid);
619
- if( bShowDetail ){
637
+ /* End timelineDetail */
638
+ if( tmFlags & TIMELINE_COMPACT ){
620639
@ </span></span>
640
+ }else{
641
+ @ </span>
621642
}
622643
@ </td></tr>
623644
}
624645
db_finalize(&q);
625646
db_finalize(&qparent);
626647
--- src/finfo.c
+++ src/finfo.c
@@ -314,34 +314,49 @@
314 int fDebug = atoi(PD("debug","0"));
315 int fShowId = P("showid")!=0;
316 Stmt qparent;
317 int iTableId = timeline_tableid();
318 int bHashBeforeComment = 0; /* Show hash before the comment */
319 int bHashAfterComment = 0; /* Show hash after the comment */
320 int bHashInDetail = 0; /* Show the hash inside the detail section */
321 int bShowDetail; /* Show the detail section */
322 int bSeparateDetail; /* Detail section in a separate column */
323 int eCommentFormat; /* value for timeline-comment-format */
 
 
324
325 login_check_credentials();
326 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
327 style_header("File History");
328 login_anonymous_available();
 
 
 
 
 
 
 
 
 
 
 
329 url_initialize(&url, "finfo");
330 if( brBg ) url_add_parameter(&url, "brbg", 0);
331 if( uBg ) url_add_parameter(&url, "ubg", 0);
332 baseCheckin = name_to_rid_www("ci");
333 zPrevDate[0] = 0;
334 zFilename = PD("name","");
 
 
335 eCommentFormat = db_get_int("timeline-comment-format", 4);
336 bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
337 bSeparateDetail = (eCommentFormat & 8)!=0;
338 switch( (eCommentFormat>>1)&3 ){
339 case 1: bHashAfterComment = 1; break;
340 case 2: bHashInDetail = 1; break;
341 default: bHashBeforeComment = 1; break;
342 }
 
343 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
344 if( fnid==0 ){
345 @ No such file: %h(zFilename)
346 style_footer();
347 return;
@@ -445,12 +460,10 @@
445 }else{
446 blob_appendf(&title, "History of ");
447 hyperlinked_path(zFilename, &title, 0, "tree", "");
448 if( fShowId ) blob_appendf(&title, " (%d)", fnid);
449 }
450 style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
451 style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
452 @ <h2>%b(&title)</h2>
453 blob_reset(&title);
454 pGraph = graph_init();
455 @ <table id="timelineTable%d(iTableId)" class="timelineTable">
456 if( baseCheckin ){
@@ -514,81 +527,86 @@
514 @ <tr><td class="timelineTime">
515 @ %z(href("%R/artifact/%!S",zUuid))%s(zTime)</a></td>
516 @ <td class="timelineGraph"><div id="m%d(gidx)" class="tl-nodemark"></div>
517 @ </td>
518 if( zBgClr && zBgClr[0] ){
519 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
520 }else{
521 @ <td class="timelineTableCell">
522 }
523 if( bHashBeforeComment && zUuid ){
524 hyperlink_to_uuid(zUuid);
525 }
526 @ <span class="timelineComment timelineCheckinComment" \
527 @ onclick='toggleDetail(%d(frid))'>
528 @ %W(zCom)</span>
529 if( bHashAfterComment && zUuid ){
530 hyperlink_to_uuid(zUuid);
531 }
532 if( bShowDetail ){
533 @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
534 @ onclick='toggleDetail(%d(frid))'>...</span>
535 if( bSeparateDetail ){
536 if( zBgClr && zBgClr[0] ){
537 @ <td class="timelineTableCell timelineDetailCell"
538 @ style="background-color: %h(zBgClr);">
539 }else{
540 @ <td class="timelineTableCell timelineDetailCell">
541 }
542 }
543 cgi_printf("<span class='clutter' id='detail-%d'>", frid);
544 cgi_printf("<span class='timelineDetail timelineCheckinDetail'>(");
545 if( zUuid && bHashInDetail ){
546 @ file: %z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
547 if( fShowId ){
548 int srcId = delta_source_rid(frid);
549 if( srcId>0 ){
550 @ id: %d(frid)&larr;%d(srcId)
551 }else{
552 @ id: %d(frid)
553 }
554 }
555 }
556 @ check-in:
557 hyperlink_to_uuid(zCkin);
558 if( fShowId ){
559 @ (%d(fmid))
560 }
561 @ user:
562 hyperlink_to_user(zUser, zDate, ",");
563 @ branch: %z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
564 @ size: %d(szFile))
565 if( zUuid && origCheckin==0 ){
566 if( nParent==0 ){
567 @ <b>Added</b>
568 }else if( pfnid ){
569 char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
570 pfnid);
571 @ <b>Renamed</b> from
572 @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
573 }
574 }
575 if( zUuid==0 ){
576 char *zNewName;
577 zNewName = db_text(0,
578 "SELECT name FROM filename WHERE fnid = "
579 " (SELECT fnid FROM mlink"
580 " WHERE mid=%d"
581 " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
582 fmid, zFilename);
583 if( zNewName ){
584 @ <b>Renamed</b> to
585 @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
586 fossil_free(zNewName);
587 }else{
588 @ <b>Deleted</b>
589 }
 
 
 
 
 
590 }
591 }
592 if( g.perm.Hyperlink && zUuid ){
593 const char *z = zFilename;
594 @ <span id='links-%d(frid)'><span class='timelineExtraLinks'>
@@ -614,12 +632,15 @@
614 }
615 zAncLink = href("%R/finfo?name=%T&ci=%!S&debug=1",zFilename,zCkin);
616 @ %z(zAncLink)[ancestry]</a>
617 }
618 tag_private_status(frid);
619 if( bShowDetail ){
 
620 @ </span></span>
 
 
621 }
622 @ </td></tr>
623 }
624 db_finalize(&q);
625 db_finalize(&qparent);
626
--- src/finfo.c
+++ src/finfo.c
@@ -314,34 +314,49 @@
314 int fDebug = atoi(PD("debug","0"));
315 int fShowId = P("showid")!=0;
316 Stmt qparent;
317 int iTableId = timeline_tableid();
318 int bHashBeforeComment = 0; /* Show hash before the comment */
 
319 int bHashInDetail = 0; /* Show the hash inside the detail section */
320 int bShowDetail; /* Show the detail section */
321 int bSeparateDetail; /* Detail section in a separate column */
322 int eCommentFormat; /* value for timeline-comment-format */
323 int tmFlags = 0; /* Viewing mode */
324 const char *zStyle; /* Viewing mode name */
325
326 login_check_credentials();
327 if( !g.perm.Read ){ login_needed(g.anon.Read); return; }
328 style_header("File History");
329 login_anonymous_available();
330 cookie_parse(DISPLAY_SETTINGS_COOKIE);
331 tmFlags = timeline_ss_submenu();
332 if( tmFlags & TIMELINE_COLUMNAR ){
333 zStyle = "Columnar";
334 }else if( tmFlags & TIMELINE_COMPACT ){
335 zStyle = "Compact";
336 }else if( tmFlags & TIMELINE_VERBOSE ){
337 zStyle = "Verbose";
338 }else{
339 zStyle = "Modern";
340 }
341 url_initialize(&url, "finfo");
342 if( brBg ) url_add_parameter(&url, "brbg", 0);
343 if( uBg ) url_add_parameter(&url, "ubg", 0);
344 baseCheckin = name_to_rid_www("ci");
345 zPrevDate[0] = 0;
346 zFilename = PD("name","");
347 cookie_render();
348 #if 0
349 eCommentFormat = db_get_int("timeline-comment-format", 4);
350 bShowDetail = (eCommentFormat & 1)==0; /* Bit 0 suppresses the comment */
351 bSeparateDetail = (eCommentFormat & 8)!=0;
352 switch( (eCommentFormat>>1)&3 ){
353 case 1: bHashAfterComment = 1; break;
354 case 2: bHashInDetail = 1; break;
355 default: bHashBeforeComment = 1; break;
356 }
357 #endif
358 fnid = db_int(0, "SELECT fnid FROM filename WHERE name=%Q", zFilename);
359 if( fnid==0 ){
360 @ No such file: %h(zFilename)
361 style_footer();
362 return;
@@ -445,12 +460,10 @@
460 }else{
461 blob_appendf(&title, "History of ");
462 hyperlinked_path(zFilename, &title, 0, "tree", "");
463 if( fShowId ) blob_appendf(&title, " (%d)", fnid);
464 }
 
 
465 @ <h2>%b(&title)</h2>
466 blob_reset(&title);
467 pGraph = graph_init();
468 @ <table id="timelineTable%d(iTableId)" class="timelineTable">
469 if( baseCheckin ){
@@ -514,81 +527,86 @@
527 @ <tr><td class="timelineTime">
528 @ %z(href("%R/artifact/%!S",zUuid))%s(zTime)</a></td>
529 @ <td class="timelineGraph"><div id="m%d(gidx)" class="tl-nodemark"></div>
530 @ </td>
531 if( zBgClr && zBgClr[0] ){
532 @ <td class="timeline%s(zStyle)Cell" \
533 @ style="background-color: %h(zBgClr);">
534 }else{
535 @ <td class="timeline%s(zStyle)Cell">
536 }
537 if( tmFlags & TIMELINE_COMPACT ){
538 @ <span class='timelineCompactComment' onclick='toggleDetail(%d(frid))'>
539 }else{
540 @ <span class='timeline%s(zStyle)Comment'>
541 if( (tmFlags & TIMELINE_VERBOSE)!=0 && zUuid ){
542 hyperlink_to_uuid(zUuid);
543 @ part of check-in \
544 hyperlink_to_uuid(zCkin);
545 }
546 }
547 @ %W(zCom)</span>
548 if( (tmFlags & TIMELINE_COMPACT)!=0 ){
549 @ <span class='timelineEllipsis anticlutter' id='ellipsis-%d(frid)' \
550 @ onclick='toggleDetail(%d(frid))'>...</span>
551 @ <span class='clutter timelineCompactDetail'
552 }
553 if( tmFlags & TIMELINE_COLUMNAR ){
554 if( zBgClr && zBgClr[0] ){
555 @ <td class="timelineDetailCell" style="background-color: %h(zBgClr);">
556 }else{
557 @ <td class="timelineDetailCell">
558 }
559 }
560 if( tmFlags & TIMELINE_COMPACT ){
561 cgi_printf("<span class='clutter' id='detail-%d'>",frid);
562 }
563 cgi_printf("<span class='timeline%sDetail'>", zStyle);
564 if( zUuid && (tmFlags & TIMELINE_VERBOSE)==0 ){
565 @ file:&nbsp;%z(href("%R/artifact/%!S",zUuid))[%S(zUuid)]</a>
566 if( fShowId ){
567 int srcId = delta_source_rid(frid);
568 if( srcId>0 ){
569 @ id:&nbsp;%d(frid)&larr;%d(srcId)
570 }else{
571 @ id:&nbsp;%d(frid)
572 }
573 }
574 }
575 @ check-in:&nbsp;\
576 hyperlink_to_uuid(zCkin);
577 if( fShowId ){
578 @ (%d(fmid))
579 }
580 @ user:&nbsp;\
581 hyperlink_to_user(zUser, zDate, ",");
582 @ branch:&nbsp;%z(href("%R/timeline?t=%T&n=200",zBr))%h(zBr)</a>,
583 @ size:&nbsp;%d(szFile))
584 if( zUuid && origCheckin==0 ){
585 if( nParent==0 ){
586 @ <b>Added</b>
587 }else if( pfnid ){
588 char *zPrevName = db_text(0,"SELECT name FROM filename WHERE fnid=%d",
589 pfnid);
590 @ <b>Renamed</b> from
591 @ %z(href("%R/finfo?name=%t", zPrevName))%h(zPrevName)</a>
592 }
593 }
594 if( zUuid==0 ){
595 char *zNewName;
596 zNewName = db_text(0,
597 "SELECT name FROM filename WHERE fnid = "
598 " (SELECT fnid FROM mlink"
599 " WHERE mid=%d"
600 " AND pfnid IN (SELECT fnid FROM filename WHERE name=%Q))",
601 fmid, zFilename);
602 if( zNewName ){
603 @ <b>Renamed</b> to
604 @ %z(href("%R/finfo?name=%t",zNewName))%h(zNewName)</a>
605 fossil_free(zNewName);
606 }else{
607 @ <b>Deleted</b>
608 }
609 }
610 if( g.perm.Hyperlink && zUuid ){
611 const char *z = zFilename;
612 @ <span id='links-%d(frid)'><span class='timelineExtraLinks'>
@@ -614,12 +632,15 @@
632 }
633 zAncLink = href("%R/finfo?name=%T&ci=%!S&debug=1",zFilename,zCkin);
634 @ %z(zAncLink)[ancestry]</a>
635 }
636 tag_private_status(frid);
637 /* End timelineDetail */
638 if( tmFlags & TIMELINE_COMPACT ){
639 @ </span></span>
640 }else{
641 @ </span>
642 }
643 @ </td></tr>
644 }
645 db_finalize(&q);
646 db_finalize(&qparent);
647
+26 -17
--- src/timeline.c
+++ src/timeline.c
@@ -1324,10 +1324,35 @@
13241324
}
13251325
if( i>2 ){
13261326
style_submenu_multichoice("y", i/2, az, isDisabled);
13271327
}
13281328
}
1329
+
1330
+/*
1331
+** Add the select/option box to the timeline submenu that is used to
1332
+** set the ss= parameter that determines the viewing mode.
1333
+**
1334
+** Return the TIMELINE_* value appropriate for the view-style.
1335
+*/
1336
+int timeline_ss_submenu(void){
1337
+ static const char *azViewStyles[] = {
1338
+ "m", "Modern View",
1339
+ "c", "Compact View",
1340
+ "v", "Verbose View",
1341
+ "j", "Columnar View",
1342
+ };
1343
+ int tmFlags;
1344
+ cookie_link_parameter("ss","ss","m");
1345
+ style_submenu_multichoice("ss", 4, azViewStyles, 0);
1346
+ switch( PD("ss","m")[0] ){
1347
+ case 'c': tmFlags = TIMELINE_COMPACT; break;
1348
+ case 'v': tmFlags = TIMELINE_VERBOSE; break;
1349
+ case 'j': tmFlags = TIMELINE_COLUMNAR; break;
1350
+ default: tmFlags = TIMELINE_MODERN; break;
1351
+ }
1352
+ return tmFlags;
1353
+}
13291354
13301355
/*
13311356
** If the zChng string is not NULL, then it should be a comma-separated
13321357
** list of glob patterns for filenames. Add an term to the WHERE clause
13331358
** for the SQL statement under construction that excludes any check-in that
@@ -1665,17 +1690,10 @@
16651690
const char *z;
16661691
char *zOlderButton = 0; /* URL for Older button at the bottom */
16671692
char *zNewerButton = 0; /* URL for Newer button at the top */
16681693
int selectedRid = -9999999; /* Show a highlight on this RID */
16691694
int disableY = 0; /* Disable type selector on submenu */
1670
- char cViewStyle; /* Overall style of the page */
1671
- static const char *azViewStyles[] = {
1672
- "m", "Modern View",
1673
- "c", "Compact View",
1674
- "v", "Verbose View",
1675
- "j", "Columnar View",
1676
- };
16771695
16781696
/* Set number of rows to display */
16791697
cookie_parse(DISPLAY_SETTINGS_COOKIE);
16801698
cookie_read_parameter("n","n");
16811699
z = P("n");
@@ -1694,14 +1712,11 @@
16941712
z = "50";
16951713
nEntry = 50;
16961714
}
16971715
cgi_replace_query_parameter("n",z);
16981716
cookie_write_parameter("n","n",0);
1699
- cookie_link_parameter("ss","ss","n");
1700
- cViewStyle = PD("ss","n")[0];
1701
- style_submenu_multichoice("ss", 4, azViewStyles, 0);
1702
-
1717
+ tmFlags |= timeline_ss_submenu();
17031718
17041719
/* To view the timeline, must have permission to read project data.
17051720
*/
17061721
pd_rid = name_to_typed_rid(P("dp"),"ci");
17071722
if( pd_rid ){
@@ -1771,16 +1786,10 @@
17711786
"FROM tagxref NATURAL JOIN tag WHERE %s",zTagSql/*safe-for-%s*/)<=nEntry)
17721787
){
17731788
nEntry = -1;
17741789
zCirca = 0;
17751790
}
1776
- switch( cViewStyle ){
1777
- case 'c': tmFlags |= TIMELINE_COMPACT; break;
1778
- case 'v': tmFlags |= TIMELINE_VERBOSE; break;
1779
- case 'j': tmFlags |= TIMELINE_COLUMNAR; break;
1780
- default: tmFlags |= TIMELINE_MODERN; break;
1781
- }
17821791
if( zType[0]=='a' ){
17831792
tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
17841793
}else{
17851794
tmFlags |= TIMELINE_GRAPH;
17861795
}
17871796
--- src/timeline.c
+++ src/timeline.c
@@ -1324,10 +1324,35 @@
1324 }
1325 if( i>2 ){
1326 style_submenu_multichoice("y", i/2, az, isDisabled);
1327 }
1328 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1329
1330 /*
1331 ** If the zChng string is not NULL, then it should be a comma-separated
1332 ** list of glob patterns for filenames. Add an term to the WHERE clause
1333 ** for the SQL statement under construction that excludes any check-in that
@@ -1665,17 +1690,10 @@
1665 const char *z;
1666 char *zOlderButton = 0; /* URL for Older button at the bottom */
1667 char *zNewerButton = 0; /* URL for Newer button at the top */
1668 int selectedRid = -9999999; /* Show a highlight on this RID */
1669 int disableY = 0; /* Disable type selector on submenu */
1670 char cViewStyle; /* Overall style of the page */
1671 static const char *azViewStyles[] = {
1672 "m", "Modern View",
1673 "c", "Compact View",
1674 "v", "Verbose View",
1675 "j", "Columnar View",
1676 };
1677
1678 /* Set number of rows to display */
1679 cookie_parse(DISPLAY_SETTINGS_COOKIE);
1680 cookie_read_parameter("n","n");
1681 z = P("n");
@@ -1694,14 +1712,11 @@
1694 z = "50";
1695 nEntry = 50;
1696 }
1697 cgi_replace_query_parameter("n",z);
1698 cookie_write_parameter("n","n",0);
1699 cookie_link_parameter("ss","ss","n");
1700 cViewStyle = PD("ss","n")[0];
1701 style_submenu_multichoice("ss", 4, azViewStyles, 0);
1702
1703
1704 /* To view the timeline, must have permission to read project data.
1705 */
1706 pd_rid = name_to_typed_rid(P("dp"),"ci");
1707 if( pd_rid ){
@@ -1771,16 +1786,10 @@
1771 "FROM tagxref NATURAL JOIN tag WHERE %s",zTagSql/*safe-for-%s*/)<=nEntry)
1772 ){
1773 nEntry = -1;
1774 zCirca = 0;
1775 }
1776 switch( cViewStyle ){
1777 case 'c': tmFlags |= TIMELINE_COMPACT; break;
1778 case 'v': tmFlags |= TIMELINE_VERBOSE; break;
1779 case 'j': tmFlags |= TIMELINE_COLUMNAR; break;
1780 default: tmFlags |= TIMELINE_MODERN; break;
1781 }
1782 if( zType[0]=='a' ){
1783 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
1784 }else{
1785 tmFlags |= TIMELINE_GRAPH;
1786 }
1787
--- src/timeline.c
+++ src/timeline.c
@@ -1324,10 +1324,35 @@
1324 }
1325 if( i>2 ){
1326 style_submenu_multichoice("y", i/2, az, isDisabled);
1327 }
1328 }
1329
1330 /*
1331 ** Add the select/option box to the timeline submenu that is used to
1332 ** set the ss= parameter that determines the viewing mode.
1333 **
1334 ** Return the TIMELINE_* value appropriate for the view-style.
1335 */
1336 int timeline_ss_submenu(void){
1337 static const char *azViewStyles[] = {
1338 "m", "Modern View",
1339 "c", "Compact View",
1340 "v", "Verbose View",
1341 "j", "Columnar View",
1342 };
1343 int tmFlags;
1344 cookie_link_parameter("ss","ss","m");
1345 style_submenu_multichoice("ss", 4, azViewStyles, 0);
1346 switch( PD("ss","m")[0] ){
1347 case 'c': tmFlags = TIMELINE_COMPACT; break;
1348 case 'v': tmFlags = TIMELINE_VERBOSE; break;
1349 case 'j': tmFlags = TIMELINE_COLUMNAR; break;
1350 default: tmFlags = TIMELINE_MODERN; break;
1351 }
1352 return tmFlags;
1353 }
1354
1355 /*
1356 ** If the zChng string is not NULL, then it should be a comma-separated
1357 ** list of glob patterns for filenames. Add an term to the WHERE clause
1358 ** for the SQL statement under construction that excludes any check-in that
@@ -1665,17 +1690,10 @@
1690 const char *z;
1691 char *zOlderButton = 0; /* URL for Older button at the bottom */
1692 char *zNewerButton = 0; /* URL for Newer button at the top */
1693 int selectedRid = -9999999; /* Show a highlight on this RID */
1694 int disableY = 0; /* Disable type selector on submenu */
 
 
 
 
 
 
 
1695
1696 /* Set number of rows to display */
1697 cookie_parse(DISPLAY_SETTINGS_COOKIE);
1698 cookie_read_parameter("n","n");
1699 z = P("n");
@@ -1694,14 +1712,11 @@
1712 z = "50";
1713 nEntry = 50;
1714 }
1715 cgi_replace_query_parameter("n",z);
1716 cookie_write_parameter("n","n",0);
1717 tmFlags |= timeline_ss_submenu();
 
 
 
1718
1719 /* To view the timeline, must have permission to read project data.
1720 */
1721 pd_rid = name_to_typed_rid(P("dp"),"ci");
1722 if( pd_rid ){
@@ -1771,16 +1786,10 @@
1786 "FROM tagxref NATURAL JOIN tag WHERE %s",zTagSql/*safe-for-%s*/)<=nEntry)
1787 ){
1788 nEntry = -1;
1789 zCirca = 0;
1790 }
 
 
 
 
 
 
1791 if( zType[0]=='a' ){
1792 tmFlags |= TIMELINE_BRIEF | TIMELINE_GRAPH;
1793 }else{
1794 tmFlags |= TIMELINE_GRAPH;
1795 }
1796

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button