@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.

Share code for context link rendering on side-by-side diffs

Summary: Ref T2009. I've clicked these links like 200 times in testing now, so I'm feeling pretty good about them.

Test Plan: Viewed links in side-by-side diff, clicked them.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T2009

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

+2 -62
+2 -62
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 88 88 // increments $ii by the entire size of the gap and then continues 89 89 // the loop. 90 90 $gap = array_pop($gaps); 91 - 92 - // TODO: Move this to renderShowContextLinks() once that is stable. 93 - 94 91 $top = $gap[0]; 95 92 $len = $gap[1]; 96 93 97 - $end = $top + $len - 20; 98 - 99 - $contents = array(); 100 - 101 - if ($len > 40) { 102 - $is_first_block = false; 103 - if ($ii == 0) { 104 - $is_first_block = true; 105 - } 106 - 107 - $contents[] = javelin_tag( 108 - 'a', 109 - array( 110 - 'href' => '#', 111 - 'mustcapture' => true, 112 - 'sigil' => 'show-more', 113 - 'meta' => array( 114 - 'ref' => $reference, 115 - 'range' => "{$top}-{$len}/{$top}-20", 116 - ), 117 - ), 118 - $is_first_block 119 - ? pht('Show First 20 Lines') 120 - : pht("\xE2\x96\xB2 Show 20 Lines")); 121 - } 122 - 123 - $contents[] = javelin_tag( 124 - 'a', 125 - array( 126 - 'href' => '#', 127 - 'mustcapture' => true, 128 - 'sigil' => 'show-more', 129 - 'meta' => array( 130 - 'type' => 'all', 131 - 'ref' => $reference, 132 - 'range' => "{$top}-{$len}/{$top}-{$len}", 133 - ), 134 - ), 135 - pht('Show All %d Lines', $len)); 94 + $contents = $this->renderShowContextLinks($top, $len, $rows); 136 95 137 96 $is_last_block = false; 138 97 if ($ii + $len >= $rows) { 139 98 $is_last_block = true; 140 99 } 141 100 142 - if ($len > 40) { 143 - $contents[] = javelin_tag( 144 - 'a', 145 - array( 146 - 'href' => '#', 147 - 'mustcapture' => true, 148 - 'sigil' => 'show-more', 149 - 'meta' => array( 150 - 'ref' => $reference, 151 - 'range' => "{$top}-{$len}/{$end}-20", 152 - ), 153 - ), 154 - $is_last_block 155 - ? pht('Show Last 20 Lines') 156 - : pht("\xE2\x96\xBC Show 20 Lines")); 157 - } 158 - 159 101 $context = null; 160 102 $context_line = null; 161 103 if (!$is_last_block && $depths[$ii + $len]) { ··· 181 123 'colspan' => 2, 182 124 'class' => 'show-more', 183 125 ), 184 - phutil_implode_html( 185 - " \xE2\x80\xA2 ", // Bullet 186 - $contents)), 126 + $contents), 187 127 phutil_tag( 188 128 'th', 189 129 array(