1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-29 16:08:22 +01:00

Provide "diff-1up" and "diff-2up" classes and tweak some styles

Summary: Ref T2009. Remove forced min-width of 780px in 1-up mode, and tweak a few other things to look better.

Test Plan: Looks better on mobile.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T2009

Differential Revision: https://secure.phabricator.com/D11974
This commit is contained in:
epriestley 2015-03-05 14:01:52 -08:00
parent 17702f3984
commit 79cb47116e
5 changed files with 41 additions and 9 deletions

View file

@ -10,7 +10,7 @@ return array(
'core.pkg.css' => '1a530a25', 'core.pkg.css' => '1a530a25',
'core.pkg.js' => 'a77025a1', 'core.pkg.js' => 'a77025a1',
'darkconsole.pkg.js' => '8ab24e01', 'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '4c3242f8', 'differential.pkg.css' => 'd8866ed8',
'differential.pkg.js' => '7b5a4aa4', 'differential.pkg.js' => '7b5a4aa4',
'diffusion.pkg.css' => '591664fa', 'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => 'bfc0737b', 'diffusion.pkg.js' => 'bfc0737b',
@ -55,7 +55,7 @@ return array(
'rsrc/css/application/dashboard/dashboard.css' => '17937d22', 'rsrc/css/application/dashboard/dashboard.css' => '17937d22',
'rsrc/css/application/diff/inline-comment-summary.css' => 'eb5f8e8c', 'rsrc/css/application/diff/inline-comment-summary.css' => 'eb5f8e8c',
'rsrc/css/application/differential/add-comment.css' => 'c478bcaa', 'rsrc/css/application/differential/add-comment.css' => 'c478bcaa',
'rsrc/css/application/differential/changeset-view.css' => 'a7781046', 'rsrc/css/application/differential/changeset-view.css' => 'b600950c',
'rsrc/css/application/differential/core.css' => '7ac3cabc', 'rsrc/css/application/differential/core.css' => '7ac3cabc',
'rsrc/css/application/differential/results-table.css' => '181aa9d9', 'rsrc/css/application/differential/results-table.css' => '181aa9d9',
'rsrc/css/application/differential/revision-comment.css' => '48186045', 'rsrc/css/application/differential/revision-comment.css' => '48186045',
@ -519,7 +519,7 @@ return array(
'conpherence-notification-css' => '04a6e10a', 'conpherence-notification-css' => '04a6e10a',
'conpherence-update-css' => '1099a660', 'conpherence-update-css' => '1099a660',
'conpherence-widget-pane-css' => '3d575438', 'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => 'a7781046', 'differential-changeset-view-css' => 'b600950c',
'differential-core-view-css' => '7ac3cabc', 'differential-core-view-css' => '7ac3cabc',
'differential-inline-comment-editor' => 'f2441746', 'differential-inline-comment-editor' => 'f2441746',
'differential-results-table-css' => '181aa9d9', 'differential-results-table-css' => '181aa9d9',

View file

@ -3,6 +3,8 @@
abstract class DifferentialChangesetHTMLRenderer abstract class DifferentialChangesetHTMLRenderer
extends DifferentialChangesetRenderer { extends DifferentialChangesetRenderer {
abstract protected function getRendererTableClass();
protected function renderChangeTypeHeader($force) { protected function renderChangeTypeHeader($force) {
$changeset = $this->getChangeset(); $changeset = $this->getChangeset();
@ -392,10 +394,16 @@ abstract class DifferentialChangesetHTMLRenderer
return null; return null;
} }
$classes = array();
$classes[] = 'differential-diff';
$classes[] = 'remarkup-code';
$classes[] = 'PhabricatorMonospaced';
$classes[] = $this->getRendererTableClass();
return javelin_tag( return javelin_tag(
'table', 'table',
array( array(
'class' => 'differential-diff remarkup-code PhabricatorMonospaced', 'class' => implode(' ', $classes),
'sigil' => 'differential-diff', 'sigil' => 'differential-diff',
), ),
array( array(

View file

@ -7,6 +7,10 @@ final class DifferentialChangesetOneUpRenderer
return true; return true;
} }
protected function getRendererTableClass() {
return 'diff-1up';
}
protected function renderColgroup() { protected function renderColgroup() {
return phutil_tag('colgroup', array(), array( return phutil_tag('colgroup', array(), array(
phutil_tag('col', array('class' => 'num')), phutil_tag('col', array('class' => 'num')),

View file

@ -7,6 +7,10 @@ final class DifferentialChangesetTwoUpRenderer
return false; return false;
} }
protected function getRendererTableClass() {
return 'diff-2up';
}
protected function renderColgroup() { protected function renderColgroup() {
return phutil_tag('colgroup', array(), array( return phutil_tag('colgroup', array(), array(
phutil_tag('col', array('class' => 'num')), phutil_tag('col', array('class' => 'num')),

View file

@ -17,18 +17,25 @@
.differential-diff { .differential-diff {
background: #fff; background: #fff;
width: 100%; width: 100%;
min-width: 780px;
border-top: 1px solid {$lightblueborder}; border-top: 1px solid {$lightblueborder};
border-bottom: 1px solid {$lightblueborder}; border-bottom: 1px solid {$lightblueborder};
table-layout: fixed; table-layout: fixed;
} }
.differential-diff.diff-2up {
min-width: 780px;
}
.differential-diff col.num { .differential-diff col.num {
width: 45px; width: 45px;
} }
.differential-diff col.left, .device .differential-diff.diff-1up col.num {
.differential-diff col.right { width: 32px;
}
.differential-diff.diff-2up col.left,
.differential-diff.diff-2up col.right {
width: 49.25%; width: 49.25%;
} }
@ -48,6 +55,10 @@
line-height: 16px; line-height: 16px;
} }
.device .differential-diff td {
padding: 0 4px 1px;
}
.differential-diff td .zwsp { .differential-diff td .zwsp {
position: absolute; position: absolute;
width: 0; width: 0;
@ -163,8 +174,6 @@ td.cov-I {
background: #f3f6ff; background: #f3f6ff;
} }
.differential-diff td.show-more, .differential-diff td.show-more,
.differential-diff th.show-context-line, .differential-diff th.show-context-line,
.differential-diff td.show-context, .differential-diff td.show-context,
@ -175,6 +184,13 @@ td.cov-I {
border-bottom: 1px solid {$thinblueborder}; border-bottom: 1px solid {$thinblueborder};
} }
.device .differential-diff td.show-more,
.device .differential-diff th.show-context-line,
.device .differential-diff td.show-context,
.device .differential-diff td.differential-shield {
padding: 6px 0;
}
.differential-diff td.show-more, .differential-diff td.show-more,
.differential-diff td.differential-shield { .differential-diff td.differential-shield {
font: {$basefont}; font: {$basefont};