@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add "via", timestamps and anchors to new timeline/transaction view

Summary: I got rid of the "#4" and just linked the timestamps.

Test Plan: {F26826}

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2104

Differential Revision: https://secure.phabricator.com/D4138

+117 -4
+8 -1
src/applications/pholio/controller/PholioMockViewController.php
··· 196 196 197 197 $view = new PhabricatorTimelineView(); 198 198 199 + $anchor_name = 0; 199 200 foreach ($xactions as $xaction) { 200 201 if ($xaction->shouldHide()) { 201 202 continue; 202 203 } 204 + 205 + $anchor_name++; 203 206 204 207 $event = id(new PhabricatorTimelineEventView()) 208 + ->setViewer($this->getRequest()->getUser()) 205 209 ->setUserHandle($xaction->getHandle($xaction->getAuthorPHID())) 206 210 ->setIcon($xaction->getIcon()) 207 211 ->setColor($xaction->getColor()) 208 - ->setTitle($xaction->getTitle()); 212 + ->setTitle($xaction->getTitle()) 213 + ->setDateCreated($xaction->getDateCreated()) 214 + ->setContentSource($xaction->getContentSource()) 215 + ->setAnchor($anchor_name); 209 216 210 217 if ($xaction->getComment()) { 211 218 $event->appendChild(
+7
src/applications/uiexample/examples/PhabricatorTimelineExample.php
··· 97 97 ->setColor($color); 98 98 } 99 99 100 + $anchor = 0; 101 + foreach ($events as $event) { 102 + $event->setViewer($user); 103 + $event->setDateCreated(time() + ($anchor * 60 * 8)); 104 + $event->setAnchor(++$anchor); 105 + } 106 + 100 107 $timeline = id(new PhabricatorTimelineView()); 101 108 foreach ($events as $event) { 102 109 $timeline->addEvent($event);
+81 -2
src/view/layout/PhabricatorTimelineEventView.php
··· 7 7 private $icon; 8 8 private $color; 9 9 private $classes = array(); 10 + private $contentSource; 11 + private $dateCreated; 12 + private $viewer; 13 + private $anchor; 14 + 15 + public function setViewer(PhabricatorUser $viewer) { 16 + $this->viewer = $viewer; 17 + return $this; 18 + } 19 + 20 + public function getViewer() { 21 + return $this->viewer; 22 + } 23 + 24 + public function setDateCreated($date_created) { 25 + $this->dateCreated = $date_created; 26 + return $this; 27 + } 28 + 29 + public function getDateCreated() { 30 + return $this->dateCreated; 31 + } 32 + 33 + public function setContentSource(PhabricatorContentSource $content_source) { 34 + $this->contentSource = $content_source; 35 + return $this; 36 + } 37 + 38 + public function getContentSource() { 39 + return $this->contentSource; 40 + } 10 41 11 42 public function setUserHandle(PhabricatorObjectHandle $handle) { 12 43 $this->userHandle = $handle; 44 + return $this; 45 + } 46 + 47 + public function setAnchor($anchor) { 48 + $this->anchor = $anchor; 13 49 return $this; 14 50 } 15 51 ··· 41 77 $title = ''; 42 78 } 43 79 44 - if ($title !== null) { 80 + $extra = array(); 81 + 82 + $source = $this->getContentSource(); 83 + if ($source) { 84 + $extra[] = id(new PhabricatorContentSourceView()) 85 + ->setContentSource($source) 86 + ->setUser($this->getViewer()) 87 + ->render(); 88 + } 89 + 90 + if ($this->getDateCreated()) { 91 + $date = phabricator_datetime( 92 + $this->getDateCreated(), 93 + $this->getViewer()); 94 + if ($this->anchor) { 95 + Javelin::initBehavior('phabricator-watch-anchor'); 96 + 97 + $anchor = id(new PhabricatorAnchorView()) 98 + ->setAnchorName($this->anchor) 99 + ->render(); 100 + 101 + $date = $anchor.phutil_render_tag( 102 + 'a', 103 + array( 104 + 'href' => '#'.$this->anchor, 105 + ), 106 + $date); 107 + } 108 + $extra[] = $date; 109 + } 110 + 111 + $extra = implode(' · ', $extra); 112 + if ($extra) { 113 + $extra = phutil_render_tag( 114 + 'span', 115 + array( 116 + 'class' => 'phabricator-timeline-extra', 117 + ), 118 + $extra); 119 + } 120 + 121 + if ($title !== null || $extra !== null) { 45 122 $title_classes = array(); 46 123 $title_classes[] = 'phabricator-timeline-title'; 47 124 ··· 68 145 array( 69 146 'class' => implode(' ', $title_classes), 70 147 ), 71 - $icon.$title); 148 + $icon.$title.$extra); 72 149 } 73 150 74 151 $wedge = phutil_render_tag( ··· 124 201 } 125 202 126 203 $outer_classes = $this->classes; 204 + $outer_classes[] = 'phabricator-timeline-shell'; 127 205 if ($this->color) { 128 206 $outer_classes[] = 'phabricator-timeline-'.$this->color; 129 207 } ··· 132 210 'div', 133 211 array( 134 212 'class' => implode(' ', $outer_classes), 213 + 'id' => $this->anchor ? 'anchor-'.$this->anchor : null, 135 214 ), 136 215 phutil_render_tag( 137 216 'div',
+21 -1
webroot/rsrc/css/layout/phabricator-timeline-view.css
··· 36 36 } 37 37 38 38 .phabricator-timeline-content { 39 + background: #ffffff; 39 40 border-style: solid; 40 41 border-color: #c0c5d1; 41 42 border-width: 1px 0; ··· 136 137 width: 14px; 137 138 } 138 139 140 + .phabricator-timeline-extra, .phabricator-timeline-extra a { 141 + font-size: 11px; 142 + color: #888888; 143 + } 144 + 145 + .device-desktop .phabricator-timeline-extra { 146 + float: right; 147 + } 148 + 149 + .device .phabricator-timeline-extra { 150 + display: block; 151 + text-align: right; 152 + line-height: 16px; 153 + } 154 + 139 155 .phabricator-timeline-red .phabricator-timeline-border { 140 156 border-color: #cc0000; 141 157 } ··· 175 191 .phabricator-timeline-black .phabricator-timeline-border { 176 192 border-color: #333333; 177 193 } 178 - 179 194 180 195 .phabricator-timeline-red .phabricator-timeline-icon-fill { 181 196 background-color: #cc0000; ··· 216 231 .phabricator-timeline-black .phabricator-timeline-icon-fill { 217 232 background-color: #333333; 218 233 } 234 + 235 + .phabricator-timeline-shell.anchor-target { 236 + background: rgba(255, 255, 0, 0.50); 237 + box-shadow: 0 0 3px 6px rgba(255, 255, 0, 0.50); 238 + }