Page MenuHomePhabricator

D8504.diff
No OneTemporary

D8504.diff

diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -61,14 +61,15 @@
$disable = false;
$radios = array();
$last_base = null;
+ $rowc = array();
foreach ($data as $row) {
$diff = $row['obj'];
$name = $row['name'];
$id = $row['id'];
- $old_class = null;
- $new_class = null;
+ $old_class = false;
+ $new_class = false;
if ($id) {
$new_checked = ($this->selectedDiffID == $id);
@@ -82,9 +83,15 @@
'sigil' => 'differential-new-radio',
));
if ($new_checked) {
- $new_class = " revhistory-new-now";
+ $new_class = true;
$disable = true;
}
+ $new = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-update-history-radio',
+ ),
+ $new);
} else {
$new = null;
}
@@ -104,8 +111,14 @@
));
$radios[] = $uniq;
if ($old_checked) {
- $old_class = " revhistory-old-now";
+ $old_class = true;
}
+ $old = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-update-history-radio',
+ ),
+ $old);
} else {
$old = null;
}
@@ -118,19 +131,25 @@
$age = null;
}
- if (++$idx % 2) {
- $class = 'alt';
- } else {
- $class = null;
- }
-
- $lint_attrs = array('class' => 'revhistory-star');
- $unit_attrs = array('class' => 'revhistory-star');
if ($diff) {
$lint = self::renderDiffLintStar($row['obj']);
+ $lint = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'lintunit-star',
+ 'title' => self::getDiffLintMessage($diff),
+ ),
+ $lint);
+
$unit = self::renderDiffUnitStar($row['obj']);
- $lint_attrs['title'] = self::getDiffLintMessage($diff);
- $unit_attrs['title'] = self::getDiffUnitMessage($diff);
+ $unit = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'lintunit-star',
+ 'title' => self::getDiffUnitMessage($diff),
+ ),
+ $unit);
+
$base = $this->renderBaseRevision($diff);
} else {
$lint = null;
@@ -145,22 +164,31 @@
$id_link = phutil_tag(
'a',
- array('href' => '/differential/diff/'.$id.'/'),
- $id);
- $rows[] = phutil_tag(
- 'tr',
- array('class' => $class),
array(
- phutil_tag('td', array('class' => 'revhistory-name'), $name),
- phutil_tag('td', array('class' => 'revhistory-id'), $id_link),
- phutil_tag('td', array('class' => 'revhistory-base'), $base),
- phutil_tag('td', array('class' => 'revhistory-desc'), $desc),
- phutil_tag('td', array('class' => 'revhistory-age'), $age),
- phutil_tag('td', $lint_attrs, $lint),
- phutil_tag('td', $unit_attrs, $unit),
- phutil_tag('td', array('class' => 'revhistory-old'.$old_class), $old),
- phutil_tag('td', array('class' => 'revhistory-new'.$new_class), $new),
- ));
+ 'href' => '/differential/diff/'.$id.'/',
+ ),
+ $id);
+
+ $rows[] = array(
+ $name,
+ $id_link,
+ $base,
+ $desc,
+ $age,
+ $lint,
+ $unit,
+ $old,
+ $new,
+ );
+
+ $classes = array();
+ if ($old_class) {
+ $classes[] = 'differential-update-history-old-now';
+ }
+ if ($new_class) {
+ $classes[] = 'differential-update-history-new-now';
+ }
+ $rowc[] = nonempty(implode(' ', $classes), null);
}
Javelin::initBehavior(
@@ -190,35 +218,74 @@
}
$select = phutil_tag('select', array('name' => 'whitespace'), $options);
- array_unshift($rows, phutil_tag('tr', array(), array(
- phutil_tag('th', array(), pht('Diff')),
- phutil_tag('th', array(), pht('ID')),
- phutil_tag('th', array(), pht('Base')),
- phutil_tag('th', array(), pht('Description')),
- phutil_tag('th', array(), pht('Created')),
- phutil_tag('th', array(), pht('Lint')),
- phutil_tag('th', array(), pht('Unit')),
- )));
-
- $label = pht('Whitespace Changes: %s', $select);
-
- $content = phutil_tag_div(
- 'differential-revision-history differential-panel',
- phutil_tag(
- 'form',
- array('action' => '#toc'),
+
+ $table = id(new AphrontTableView($rows));
+ $table->setHeaders(
+ array(
+ pht('Diff'),
+ pht('ID'),
+ pht('Base'),
+ pht('Description'),
+ pht('Created'),
+ pht('Lint'),
+ pht('Unit'),
+ '',
+ '',
+ ));
+ $table->setColumnClasses(
+ array(
+ 'pri',
+ '',
+ '',
+ 'wide',
+ 'date',
+ 'center',
+ 'center',
+ 'center differential-update-history-old',
+ 'center differential-update-history-new',
+ ));
+ $table->setRowClasses($rowc);
+ $table->setDeviceVisibility(
+ array(
+ true,
+ true,
+ false,
+ true,
+ false,
+ false,
+ false,
+ true,
+ true,
+ ));
+
+ $show_diff = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'differential-update-history-footer',
+ ),
+ array(
+ phutil_tag(
+ 'label',
+ array(),
+ array(
+ pht('Whitespace Changes:'),
+ $select,
+ )),
phutil_tag(
- 'table',
- array('class' => 'differential-revision-history-table'), array(
- phutil_implode_html("\n", $rows),
- phutil_tag('tr', array(), phutil_tag(
- 'td',
- array('colspan' => 9, 'class' => 'diff-differ-submit'),
- array(
- phutil_tag('label', array(), $label),
- phutil_tag('button', array(), pht('Show Diff')),
- )))
- ))));
+ 'button',
+ array(),
+ pht('Show Diff')),
+ ));
+
+ $content = phabricator_form(
+ $this->getUser(),
+ array(
+ 'action' => '#toc',
+ ),
+ array(
+ $table,
+ $show_diff,
+ ));
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Revision Update History'))
diff --git a/src/view/control/AphrontTableView.php b/src/view/control/AphrontTableView.php
--- a/src/view/control/AphrontTableView.php
+++ b/src/view/control/AphrontTableView.php
@@ -153,8 +153,8 @@
$classes[] = $col_classes[$col_num];
}
- if (empty($device_visiblity[$col_num])) {
- $classes[] = 'aphront-table-nodevice';
+ if (empty($device_visibility[$col_num])) {
+ $classes[] = 'aphront-table-view-nodevice';
}
if ($sort_values[$col_num] !== null) {
@@ -251,6 +251,9 @@
continue;
}
$class = $col_classes[$col_num];
+ if (empty($device_visibility[$col_num])) {
+ $class = trim($class.' aphront-table-view-nodevice');
+ }
if (!empty($this->cellClasses[$row_num][$col_num])) {
$class = trim($class.' '.$this->cellClasses[$row_num][$col_num]);
}
diff --git a/webroot/rsrc/css/aphront/table-view.css b/webroot/rsrc/css/aphront/table-view.css
--- a/webroot/rsrc/css/aphront/table-view.css
+++ b/webroot/rsrc/css/aphront/table-view.css
@@ -144,6 +144,7 @@
.aphront-table-view td.pri {
font-weight: bold;
+ color: {$darkbluetext};
}
.aphront-table-view td.wide {
@@ -231,6 +232,17 @@
padding: 2px 4px 0px;
}
+.aphront-table-view th.center,
+.aphront-table-view td.center {
+ text-align: center;
+}
+
+.device .aphront-table-view td + td.center,
+.device .aphront-table-view th + th.center {
+ padding-left: 3px;
+ padding-right: 3px;
+}
+
.device-desktop .aphront-table-view-device {
display: none;
}
diff --git a/webroot/rsrc/css/application/differential/revision-history.css b/webroot/rsrc/css/application/differential/revision-history.css
--- a/webroot/rsrc/css/application/differential/revision-history.css
+++ b/webroot/rsrc/css/application/differential/revision-history.css
@@ -2,77 +2,60 @@
* @provides differential-revision-history-css
*/
-.differential-revision-history-table {
- width: 100%;
- border-collapse: separate;
- border-spacing: 1px;
-}
-
-.differential-revision-history-table th,
-.differential-revision-history-table td {
- color: {$darkbluetext};
+.differential-update-history-footer {
+ text-align: right;
+ vertical-align: middle;
padding: 4px 8px;
+ border-top: 1px solid {$lightblueborder};
+ background: {$lightbluebackground};
}
-.differential-revision-history-table td {
- white-space: nowrap;
+.differential-update-history-footer label {
+ margin-right: 12px;
+ color: {$greytext};
}
-.differential-revision-history-table tr.alt {
- background: {$greybackground};
+.differential-update-history-footer select {
+ margin-left: 8px;
}
-.differential-revision-history-table td.revhistory-desc {
- width: 100%;
- white-space: normal;
+.device .differential-update-history-footer label {
+ display: block;
+ margin-right: 0;
+ margin-bottom: 4px;
}
-.differential-revision-history-table td.revhistory-name {
- font-weight: bold;
-}
-
-.differential-revision-history-table td.revhistory-age {
- text-align: right;
+.differential-update-history-radio {
+ padding: 0 8px;
}
-.differential-revision-history-table td.revhistory-old,
-.differential-revision-history-table td.revhistory-new {
- padding: 0 16px;
- text-align: center;
-}
-
-.differential-revision-history-table td.revhistory-old {
+.aphront-table-view td.differential-update-history-old {
background: #f9d0d0;
}
-.differential-revision-history-table td.revhistory-old-now {
- background: #ffaaaa;
+.aphront-table-view td.differential-update-history-new {
+ background: #d0ffd0;
}
-.differential-revision-history-table td.revhistory-new {
- background: #d0ffd0;
+.aphront-table-view
+ .differential-update-history-old-now
+ td.differential-update-history-old,
+.aphront-table-view
+ .alt-differential-update-history-old-now
+ td.differential-update-history-old {
+ background: #ffaaaa;
}
-.differential-revision-history-table td.revhistory-new-now {
+.aphront-table-view
+ .differential-update-history-new-now
+ td.differential-update-history-new,
+.aphront-table-view
+ .alt-differential-update-history-new-now
+ td.differential-update-history-new {
background: #aaffaa;
}
-.differential-revision-history-table td.revhistory-star {
+.lintunit-star {
text-align: center;
-}
-
-.differential-revision-history-table td.diff-differ-submit {
- text-align: right;
- border-bottom: none;
- padding: 8px 0 4px 0;
-}
-
-.differential-revision-history-table td.diff-differ-submit button {
- margin-left: 12px;
-}
-
-.differential-revision-history-table td.diff-differ-submit label {
- font-weight: bold;
- padding-right: 4px;
- color: {$darkgreytext};
+ padding: 0 16px;
}

File Metadata

Mime Type
text/plain
Expires
Tue, May 21, 10:55 PM (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6292421
Default Alt Text
D8504.diff (11 KB)

Event Timeline