1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 01:08:50 +02:00

Display property changes on files

Summary:
Never converted this TODO over from XHP.

NOTE: This looks terrible since the CSS didn't make it over, can one of you grab
the rules for .differential-property-table and .property-table-header? If they
aren't still in trunk, try history for html/intern/css/tools/differential/

Test Plan:
Made a property change, looked at it in Differentila.

Reviewed By: aran
Reviewers: jungejason, tuomaspelkonen, aran
CC: codeblock, aran
Differential Revision: 409
This commit is contained in:
epriestley 2011-06-07 18:59:42 -07:00
parent 543fdb3b39
commit 9284c85876
3 changed files with 85 additions and 33 deletions

View file

@ -145,7 +145,7 @@ celerity_register_resource_map(array(
),
'differential-changeset-view-css' =>
array(
'uri' => '/res/a239213a/rsrc/css/application/differential/changeset-view.css',
'uri' => '/res/d92a2fb5/rsrc/css/application/differential/changeset-view.css',
'type' => 'css',
'requires' =>
array(
@ -1057,7 +1057,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/33f413ef/typeahead.pkg.js',
'type' => 'js',
),
'613cf273' =>
'3bf80070' =>
array (
'name' => 'differential.pkg.css',
'symbols' =>
@ -1071,7 +1071,7 @@ celerity_register_resource_map(array(
6 => 'differential-revision-add-comment-css',
7 => 'differential-revision-comment-list-css',
),
'uri' => '/res/pkg/613cf273/differential.pkg.css',
'uri' => '/res/pkg/3bf80070/differential.pkg.css',
'type' => 'css',
),
'64383b02' =>
@ -1159,14 +1159,14 @@ celerity_register_resource_map(array(
'aphront-table-view-css' => '64383b02',
'aphront-tokenizer-control-css' => '64383b02',
'aphront-typeahead-control-css' => '64383b02',
'differential-changeset-view-css' => '613cf273',
'differential-core-view-css' => '613cf273',
'differential-revision-add-comment-css' => '613cf273',
'differential-revision-comment-css' => '613cf273',
'differential-revision-comment-list-css' => '613cf273',
'differential-revision-detail-css' => '613cf273',
'differential-revision-history-css' => '613cf273',
'differential-table-of-contents-css' => '613cf273',
'differential-changeset-view-css' => '3bf80070',
'differential-core-view-css' => '3bf80070',
'differential-revision-add-comment-css' => '3bf80070',
'differential-revision-comment-css' => '3bf80070',
'differential-revision-comment-list-css' => '3bf80070',
'differential-revision-detail-css' => '3bf80070',
'differential-revision-history-css' => '3bf80070',
'differential-table-of-contents-css' => '3bf80070',
'diffusion-commit-view-css' => '03ef179e',
'javelin-behavior' => 'db95a6d0',
'javelin-behavior-aphront-basic-tokenizer' => '33f413ef',

View file

@ -1340,41 +1340,44 @@ EOSYNTHETIC;
return null;
}
return null;
/*
TODO
$table = <table class="differential-property-table" />;
$table->appendChild(
<tr class="property-table-header">
<th>Property Changes</th>
<td class="oval">Old Value</td>
<td class="nval">New Value</td>
</tr>);
$keys = array_keys($old + $new);
sort($keys);
$rows = array();
foreach ($keys as $key) {
$oval = idx($old, $key);
$nval = idx($new, $key);
if ($oval !== $nval) {
if ($oval === null) {
$oval = <em>null</em>;
$oval = '<em>null</em>';
} else {
$oval = phutil_escape_html($oval);
}
if ($nval === null) {
$nval = <em>null</em>;
$nval = '<em>null</em>';
} else {
$nval = phutil_escape_html($nval);
}
$table->appendChild(
<tr>
<th>{$key}</th>
<td class="oval">{$oval}</td>
<td class="nval">{$nval}</td>
</tr>);
$rows[] =
'<tr>'.
'<th>'.phutil_escape_html($key).'</th>'.
'<td class="oval">'.$oval.'</td>'.
'<td class="nval">'.$nval.'</td>'.
'</tr>';
}
}
return $table;
*/
return
'<table class="differential-property-table">'.
'<tr class="property-table-header">'.
'<th>Property Changes</th>'.
'<td class="oval">Old Value</td>'.
'<td class="nval">New Value</td>'.
'</tr>'.
implode('', $rows).
'</table>';
}
protected function renderChangesetTable($changeset, $contents) {

View file

@ -180,3 +180,52 @@
.differential-changeset-buttons a.button {
margin-left: 8px;
}
.differential-property-table {
width: auto;
margin: .75em auto;
background: #e3e3e3;
}
.differential-property-table th {
text-align: right;
width: 10em;
font-weight: bold;
color: #666666;
white-space: nowrap;
padding: 4px 8px;
border-right: 1px solid #666666;
}
.differential-property-table td {
padding: 4px 8px;
width: 35em;
}
.differential-property-table td em {
color: #888888;
}
.differential-property-table tr.property-table-header th,
.differential-property-table tr.property-table-header td {
text-align: center;
font-weight: bold;
border-bottom: 1px solid #666666;
}
.differential-property-table td.oval {
background: #ffd0d0;
}
.differential-property-table td.nval {
background: #d0ffd0;
}
.differential-property-table tr.property-table-header td.oval {
background: #ffaaaa;
}
.differential-property-table tr.property-table-header td.nval {
background: #aaffaa;
}