1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Be more explicit in rendering context links in Differential

Summary: See T368. The current rendering result can cause some confusion for the
first/last chunks, make their behavior more explicit.
Test Plan:
  - Clicked various "show more" links on a bunch of top/bottom/middle omitted
context blocks in a variety of diffs.
  - Located a @generated shielded file and verified the initial render is
correct when the entire file is default-hidden.

Reviewed By: avitaloliver
Reviewers: avitaloliver, jungejason, tuomaspelkonen, aran
CC: aran, avitaloliver
Differential Revision: 744
This commit is contained in:
epriestley 2011-07-29 13:46:53 -07:00
parent eb23539141
commit b70b9bb6d7

View file

@ -1207,6 +1207,11 @@ class DifferentialChangesetParser {
$contents = array();
if ($len > 40) {
$is_first_block = false;
if ($ii == 0) {
$is_first_block = true;
}
$contents[] = javelin_render_tag(
'a',
array(
@ -1218,7 +1223,9 @@ class DifferentialChangesetParser {
'range' => "{$top}-{$len}/{$top}-20",
),
),
"\xE2\x96\xB2 Show 20 Lines");
$is_first_block
? "Show First 20 Lines"
: "\xE2\x96\xB2 Show 20 Lines");
}
$contents[] = javelin_render_tag(
@ -1235,6 +1242,11 @@ class DifferentialChangesetParser {
'Show All '.$len.' Lines');
if ($len > 40) {
$is_last_block = false;
if ($ii + $len >= $rows) {
$is_last_block = true;
}
$contents[] = javelin_render_tag(
'a',
array(
@ -1246,7 +1258,9 @@ class DifferentialChangesetParser {
'range' => "{$top}-{$len}/{$end}-20",
),
),
"\xE2\x96\xBC Show 20 Lines");
$is_last_block
? "Show Last 20 Lines"
: "\xE2\x96\xBC Show 20 Lines");
};
$container = javelin_render_tag(