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

Unify Differential/Maniphest/Diffusion styles and allow commits to be flagged explicitly

Summary:
  - Differential, Maniphest and Diffusion use slightly different styles for the object detail panels.
  - Instead, use the same styles and CSS.
  - Add object actions to Diffusion, including "Flag".

Test Plan: Looked at revisions, tasks and commit. Flagged and unflagged commits.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T1041

Differential Revision: https://secure.phabricator.com/D2062
This commit is contained in:
epriestley 2012-03-30 14:12:10 -07:00
parent fcec4c368c
commit 5945546440
16 changed files with 356 additions and 184 deletions

View file

@ -81,13 +81,22 @@ celerity_register_resource_map(array(
),
'aphront-headsup-action-list-view-css' =>
array(
'uri' => '/res/84743e20/rsrc/css/aphront/headsup-action-list-view.css',
'uri' => '/res/aff0a541/rsrc/css/aphront/headsup-action-list-view.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/aphront/headsup-action-list-view.css',
),
'aphront-headsup-view-css' =>
array(
'uri' => '/res/39ffc2e7/rsrc/css/aphront/headsup.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/aphront/headsup.css',
),
'aphront-list-filter-view-css' =>
array(
'uri' => '/res/0f5ddaba/rsrc/css/aphront/list-filter-view.css',
@ -241,7 +250,7 @@ celerity_register_resource_map(array(
),
'differential-revision-detail-css' =>
array(
'uri' => '/res/2433dbdc/rsrc/css/application/differential/revision-detail.css',
'uri' => '/res/a838bf31/rsrc/css/application/differential/revision-detail.css',
'type' => 'css',
'requires' =>
array(
@ -1409,7 +1418,7 @@ celerity_register_resource_map(array(
),
'maniphest-task-detail-css' =>
array(
'uri' => '/res/15c28f68/rsrc/css/application/maniphest/task-detail.css',
'uri' => '/res/7599c878/rsrc/css/application/maniphest/task-detail.css',
'type' => 'css',
'requires' =>
array(
@ -2039,7 +2048,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/21d01ed8/core.pkg.js',
'type' => 'js',
),
'28d8e85a' =>
'18be02e0' =>
array(
'name' => 'differential.pkg.css',
'symbols' =>
@ -2057,7 +2066,7 @@ celerity_register_resource_map(array(
10 => 'phabricator-content-source-view-css',
11 => 'differential-local-commits-view-css',
),
'uri' => '/res/pkg/28d8e85a/differential.pkg.css',
'uri' => '/res/pkg/18be02e0/differential.pkg.css',
'type' => 'css',
),
'06ebcd69' =>
@ -2115,7 +2124,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/4fbae2af/javelin.pkg.js',
'type' => 'js',
),
31583232 =>
'7cc1c9a3' =>
array(
'name' => 'maniphest.pkg.css',
'symbols' =>
@ -2125,7 +2134,7 @@ celerity_register_resource_map(array(
2 => 'maniphest-task-detail-css',
3 => 'aphront-attached-file-view-css',
),
'uri' => '/res/pkg/31583232/maniphest.pkg.css',
'uri' => '/res/pkg/7cc1c9a3/maniphest.pkg.css',
'type' => 'css',
),
'86fc0b0c' =>
@ -2160,11 +2169,11 @@ celerity_register_resource_map(array(
),
'reverse' =>
array(
'aphront-attached-file-view-css' => '31583232',
'aphront-attached-file-view-css' => '7cc1c9a3',
'aphront-crumbs-view-css' => '82263727',
'aphront-dialog-view-css' => '82263727',
'aphront-form-view-css' => '82263727',
'aphront-headsup-action-list-view-css' => '28d8e85a',
'aphront-headsup-action-list-view-css' => '18be02e0',
'aphront-list-filter-view-css' => '82263727',
'aphront-pager-view-css' => '82263727',
'aphront-panel-view-css' => '82263727',
@ -2172,16 +2181,16 @@ celerity_register_resource_map(array(
'aphront-table-view-css' => '82263727',
'aphront-tokenizer-control-css' => '82263727',
'aphront-typeahead-control-css' => '82263727',
'differential-changeset-view-css' => '28d8e85a',
'differential-core-view-css' => '28d8e85a',
'differential-changeset-view-css' => '18be02e0',
'differential-core-view-css' => '18be02e0',
'differential-inline-comment-editor' => '06ebcd69',
'differential-local-commits-view-css' => '28d8e85a',
'differential-revision-add-comment-css' => '28d8e85a',
'differential-revision-comment-css' => '28d8e85a',
'differential-revision-comment-list-css' => '28d8e85a',
'differential-revision-detail-css' => '28d8e85a',
'differential-revision-history-css' => '28d8e85a',
'differential-table-of-contents-css' => '28d8e85a',
'differential-local-commits-view-css' => '18be02e0',
'differential-revision-add-comment-css' => '18be02e0',
'differential-revision-comment-css' => '18be02e0',
'differential-revision-comment-list-css' => '18be02e0',
'differential-revision-detail-css' => '18be02e0',
'differential-revision-history-css' => '18be02e0',
'differential-table-of-contents-css' => '18be02e0',
'diffusion-commit-view-css' => '61f9d480',
'javelin-behavior' => '4fbae2af',
'javelin-behavior-aphront-basic-tokenizer' => '2af849fb',
@ -2226,11 +2235,11 @@ celerity_register_resource_map(array(
'javelin-util' => '4fbae2af',
'javelin-vector' => '4fbae2af',
'javelin-workflow' => '21d01ed8',
'maniphest-task-detail-css' => '31583232',
'maniphest-task-summary-css' => '31583232',
'maniphest-transaction-detail-css' => '31583232',
'maniphest-task-detail-css' => '7cc1c9a3',
'maniphest-task-summary-css' => '7cc1c9a3',
'maniphest-transaction-detail-css' => '7cc1c9a3',
'phabricator-app-buttons-css' => '82263727',
'phabricator-content-source-view-css' => '28d8e85a',
'phabricator-content-source-view-css' => '18be02e0',
'phabricator-core-buttons-css' => '82263727',
'phabricator-core-css' => '82263727',
'phabricator-directory-css' => '82263727',
@ -2240,7 +2249,7 @@ celerity_register_resource_map(array(
'phabricator-keyboard-shortcut' => '21d01ed8',
'phabricator-keyboard-shortcut-manager' => '21d01ed8',
'phabricator-menu-item' => '21d01ed8',
'phabricator-object-selector-css' => '28d8e85a',
'phabricator-object-selector-css' => '18be02e0',
'phabricator-paste-file-upload' => '21d01ed8',
'phabricator-remarkup-css' => '82263727',
'phabricator-shaped-request' => '06ebcd69',

View file

@ -52,6 +52,7 @@ phutil_register_library_map(array(
'AphrontHTTPSinkTestCase' => 'aphront/sink/base/__tests__',
'AphrontHeadsupActionListView' => 'view/layout/headsup/actionlist',
'AphrontHeadsupActionView' => 'view/layout/headsup/action',
'AphrontHeadsupView' => 'view/layout/headsup/panel',
'AphrontIsolatedDatabaseConnection' => 'storage/connection/isolated',
'AphrontIsolatedDatabaseConnectionTestCase' => 'storage/connection/isolated/__tests__',
'AphrontIsolatedHTTPSink' => 'aphront/sink/test',
@ -383,7 +384,6 @@ phutil_register_library_map(array(
'DrydockWebrootInterface' => 'applications/drydock/interface/webroot/base',
'HeraldAction' => 'applications/herald/storage/action',
'HeraldActionConfig' => 'applications/herald/config/action',
'HeraldAllRulesController' => 'applications/herald/controller/all',
'HeraldApplyTranscript' => 'applications/herald/storage/transcript/apply',
'HeraldCommitAdapter' => 'applications/herald/adapter/commit',
'HeraldCondition' => 'applications/herald/storage/condition',
@ -989,6 +989,7 @@ phutil_register_library_map(array(
'AphrontHTTPSinkTestCase' => 'PhabricatorTestCase',
'AphrontHeadsupActionListView' => 'AphrontView',
'AphrontHeadsupActionView' => 'AphrontView',
'AphrontHeadsupView' => 'AphrontView',
'AphrontIsolatedDatabaseConnection' => 'AphrontDatabaseConnection',
'AphrontIsolatedDatabaseConnectionTestCase' => 'PhabricatorTestCase',
'AphrontIsolatedHTTPSink' => 'AphrontHTTPSink',
@ -1263,7 +1264,6 @@ phutil_register_library_map(array(
'DrydockSSHCommandInterface' => 'DrydockCommandInterface',
'DrydockWebrootInterface' => 'DrydockInterface',
'HeraldAction' => 'HeraldDAO',
'HeraldAllRulesController' => 'HeraldController',
'HeraldApplyTranscript' => 'HeraldDAO',
'HeraldCommitAdapter' => 'HeraldObjectAdapter',
'HeraldCondition' => 'HeraldDAO',
@ -1344,6 +1344,7 @@ phutil_register_library_map(array(
'PhabricatorChatLogDAO' => 'PhabricatorLiskDAO',
'PhabricatorChatLogEvent' => 'PhabricatorChatLogDAO',
'PhabricatorChatLogEventType' => 'PhabricatorChatLogConstants',
'PhabricatorChatLogQuery' => 'PhabricatorOffsetPagedQuery',
'PhabricatorConduitAPIController' => 'PhabricatorConduitController',
'PhabricatorConduitCertificateToken' => 'PhabricatorConduitDAO',
'PhabricatorConduitConnectionLog' => 'PhabricatorConduitDAO',

View file

@ -322,9 +322,7 @@ final class DifferentialRevisionViewController extends DifferentialController {
$page_pane = id(new DifferentialPrimaryPaneView())
->setLineWidthFromChangesets($changesets)
->setID($pane_id)
->appendChild($reviewer_warning)
->appendChild(
$revision_detail->render().
$comment_view->render().
$diff_history->render().
$warning.
@ -336,7 +334,11 @@ final class DifferentialRevisionViewController extends DifferentialController {
$page_pane->appendChild($comment_form->render());
}
return $this->buildStandardPageResponse(
$page_pane,
array(
$reviewer_warning,
$revision_detail,
$page_pane,
),
array(
'title' => 'D'.$revision->getID().' '.$revision->getTitle(),
));
@ -446,11 +448,13 @@ final class DifferentialRevisionViewController extends DifferentialController {
);
}
$links[] = array(
'class' => 'transcripts-metamta',
'name' => 'MetaMTA Transcripts',
'href' => "/mail/?phid={$revision_phid}",
);
if ($user->getIsAdmin()) {
$links[] = array(
'class' => 'transcripts-metamta',
'name' => 'MetaMTA Transcripts',
'href' => "/mail/?phid={$revision_phid}",
);
}
$links[] = array(
'class' => 'transcripts-herald',

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -50,24 +50,15 @@ final class DifferentialRevisionDetailView extends AphrontView {
$revision = $this->revision;
$rows = array();
$dict = array();
foreach ($this->auxiliaryFields as $field) {
$value = $field->renderValueForRevisionView();
if (strlen($value)) {
$label = $field->renderLabelForRevisionView();
$rows[] =
'<tr>'.
'<th>'.$label.'</th>'.
'<td>'.$value.'</td>'.
'</tr>';
$label = rtrim($field->renderLabelForRevisionView(), ':');
$dict[$label] = $value;
}
}
$properties =
'<table class="differential-revision-properties">'.
implode("\n", $rows).
'</table>';
$actions = array();
foreach ($this->actions as $action) {
$obj = new AphrontHeadsupActionView();
@ -83,22 +74,14 @@ final class DifferentialRevisionDetailView extends AphrontView {
$action_list = new AphrontHeadsupActionListView();
$action_list->setActions($actions);
return
'<div class="differential-revision-detail differential-panel">'.
$action_list->render().
'<div class="differential-keyboard-shortcuts">'.
id(new AphrontKeyboardShortcutsAvailableView())->render().
'</div>'.
'<div class="differential-revision-detail-core">'.
'<h1>'.
'<span class="aphront-headsup-object-name">'.
phutil_escape_html('D'.$revision->getID()).
'</span>'.
' '.
phutil_escape_html($revision->getTitle()).'</h1>'.
$properties.
'</div>'.
'<div style="clear: both;"></div>'.
'</div>';
$action_panel = new AphrontHeadsupView();
$action_panel->setActionList($action_list);
$action_panel->setHasKeyboardShortcuts(true);
$action_panel->setProperties($dict);
$action_panel->setObjectName('D'.$revision->getID());
$action_panel->setHeader($revision->getTitle());
return $action_panel->render();
}
}

View file

@ -10,9 +10,8 @@ phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'view/base');
phutil_require_module('phabricator', 'view/layout/headsup/action');
phutil_require_module('phabricator', 'view/layout/headsup/actionlist');
phutil_require_module('phabricator', 'view/widget/keyboardshortcuts');
phutil_require_module('phabricator', 'view/layout/headsup/panel');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils');

View file

@ -41,8 +41,6 @@ final class DiffusionCommitController extends DiffusionController {
'commit' => true,
));
$detail_panel = new AphrontPanelView();
$repository = $drequest->getRepository();
$commit = $drequest->loadCommit();
@ -76,31 +74,23 @@ final class DiffusionCommitController extends DiffusionController {
$parent_query = DiffusionCommitParentsQuery::newFromDiffusionRequest(
$drequest);
$parents = $parent_query->loadParents();
$property_table = $this->renderPropertyTable(
$commit,
$commit_data,
$parents);
$headsup_panel = new AphrontHeadsupView();
$headsup_panel->setHeader('Commit Detail');
$headsup_panel->setActionList(
$this->renderHeadsupActionList($commit));
$headsup_panel->setProperties(
$this->getCommitProperties(
$commit,
$commit_data,
$parent_query->loadParents()));
$detail_panel->setHeader('Revision Detail');
$detail_panel->addButton(
'<div class="diffusion-commit-dateline">'.
'r'.$callsign.$commit->getCommitIdentifier().
' &middot; '.
phabricator_datetime($commit->getEpoch(), $user).
$headsup_panel->appendChild(
'<div class="diffusion-commit-message phabricator-remarkup">'.
$engine->markupText($commit_data->getCommitMessage()).
'</div>');
$detail_panel->appendChild(
'<div class="diffusion-commit-details">'.
$property_table.
'<hr />'.
'<div class="diffusion-commit-message phabricator-remarkup">'.
$engine->markupText($commit_data->getCommitMessage()).
'</div>'.
'</div>');
$content[] = $detail_panel;
$content[] = $headsup_panel;
}
$query = new PhabricatorAuditQuery();
@ -273,10 +263,11 @@ final class DiffusionCommitController extends DiffusionController {
));
}
private function renderPropertyTable(
private function getCommitProperties(
PhabricatorRepositoryCommit $commit,
PhabricatorRepositoryCommitData $data,
array $parents) {
$user = $this->getRequest()->getUser();
$phids = array();
if ($data->getCommitDetail('authorPHID')) {
@ -302,6 +293,17 @@ final class DiffusionCommitController extends DiffusionController {
$props = array();
if ($commit->getAuditStatus()) {
$status = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
$props['Status'] = phutil_render_tag(
'strong',
array(),
phutil_escape_html($status));
}
$props['Committed'] = phabricator_datetime($commit->getEpoch(), $user);
$author_phid = $data->getCommitDetail('authorPHID');
if ($data->getCommitDetail('authorPHID')) {
$props['Author'] = $handles[$author_phid]->renderLink();
@ -322,11 +324,6 @@ final class DiffusionCommitController extends DiffusionController {
$props['Differential Revision'] = $handles[$revision_phid]->renderLink();
}
if ($commit->getAuditStatus()) {
$props['Audit'] = PhabricatorAuditCommitStatusConstants::getStatusName(
$commit->getAuditStatus());
}
if ($parents) {
$parent_links = array();
foreach ($parents as $parent) {
@ -347,19 +344,7 @@ final class DiffusionCommitController extends DiffusionController {
$props['Branches'] = $branches;
}
$rows = array();
foreach ($props as $key => $value) {
$rows[] =
'<tr>'.
'<th>'.$key.':</th>'.
'<td>'.$value.'</td>'.
'</tr>';
}
return
'<table class="diffusion-commit-properties">'.
implode("\n", $rows).
'</table>';
return $props;
}
private function buildAuditTable($commit, $audits) {
@ -378,6 +363,7 @@ final class DiffusionCommitController extends DiffusionController {
$panel = new AphrontPanelView();
$panel->setHeader('Audits');
$panel->setCaption('Audits you are responsible for are highlighted.');
$panel->appendChild($view);
return $panel;
@ -609,5 +595,68 @@ final class DiffusionCommitController extends DiffusionController {
return $panel;
}
private function renderHeadsupActionList(
PhabricatorRepositoryCommit $commit) {
$user = $this->getRequest()->getUser();
$actions = array();
require_celerity_resource('phabricator-flag-css');
$flag = PhabricatorFlagQuery::loadUserFlag($user, $commit->getPHID());
if ($flag) {
$class = PhabricatorFlagColor::getCSSClass($flag->getColor());
$color = PhabricatorFlagColor::getColorName($flag->getColor());
$action = new AphrontHeadsupActionView();
$action->setClass('flag-clear '.$class);
$action->setURI('/flag/delete/'.$flag->getID().'/');
$action->setName('Remove '.$color.' Flag');
$action->setWorkflow(true);
$actions[] = $action;
} else {
$action = new AphrontHeadsupActionView();
$action->setClass('phabricator-flag-ghost');
$action->setURI('/flag/edit/'.$commit->getPHID().'/');
$action->setName('Flag Commit');
$action->setWorkflow(true);
$actions[] = $action;
}
require_celerity_resource('phabricator-object-selector-css');
require_celerity_resource('javelin-behavior-phabricator-object-selector');
/*
TODO: Implement this.
$action = new AphrontHeadsupActionView();
$action->setName('Edit Maniphest Tasks');
$action->setURI('/search/attach/'.$commit->getPHID().'/TASK/');
$action->setWorkflow(true);
$action->setClass('attach-maniphest');
$actions[] = $action;
*/
if ($user->getIsAdmin()) {
$action = new AphrontHeadsupActionView();
$action->setName('MetaMTA Transcripts');
$action->setURI('/mail/?phid='.$commit->getPHID());
$action->setClass('transcripts-metamta');
$actions[] = $action;
}
$action = new AphrontHeadsupActionView();
$action->setName('Herald Transcripts');
$action->setURI('/herald/transcript/?phid='.$commit->getPHID());
$action->setClass('transcripts-herald');
$actions[] = $action;
$action_list = new AphrontHeadsupActionListView();
$action_list->setActions($actions);
return $action_list;
}
}

View file

@ -29,6 +29,8 @@ phutil_require_module('phabricator', 'applications/diffusion/view/commentlist');
phutil_require_module('phabricator', 'applications/diffusion/view/commitchangetable');
phutil_require_module('phabricator', 'applications/diffusion/view/historytable');
phutil_require_module('phabricator', 'applications/draft/storage/draft');
phutil_require_module('phabricator', 'applications/flag/constants/color');
phutil_require_module('phabricator', 'applications/flag/query/flag');
phutil_require_module('phabricator', 'applications/markup/engine');
phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');
@ -42,6 +44,9 @@ phutil_require_module('phabricator', 'view/form/control/select');
phutil_require_module('phabricator', 'view/form/control/submit');
phutil_require_module('phabricator', 'view/form/control/textarea');
phutil_require_module('phabricator', 'view/form/error');
phutil_require_module('phabricator', 'view/layout/headsup/action');
phutil_require_module('phabricator', 'view/layout/headsup/actionlist');
phutil_require_module('phabricator', 'view/layout/headsup/panel');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phabricator', 'view/null');
phutil_require_module('phabricator', 'view/utils');

View file

@ -30,10 +30,8 @@ final class ManiphestTaskDescriptionPreviewController
$engine = PhabricatorMarkupEngine::newManiphestMarkupEngine();
$content =
'<div class="maniphest-task-description">'.
'<div class="phabricator-remarkup">'.
$engine->markupText($description).
'</div>'.
'<div class="phabricator-remarkup">'.
$engine->markupText($description).
'</div>';
return id(new AphrontAjaxResponse())

View file

@ -185,28 +185,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
$dict['Files'] = implode('', $views);
}
$dict['Description'] =
'<div class="maniphest-task-description">'.
'<div class="phabricator-remarkup">'.
$engine->markupText($task->getDescription()).
'</div>'.
'</div>';
require_celerity_resource('maniphest-task-detail-css');
$table = array();
foreach ($dict as $key => $value) {
$table[] =
'<tr>'.
'<th>'.phutil_escape_html($key).':</th>'.
'<td>'.$value.'</td>'.
'</tr>';
}
$table =
'<table class="maniphest-task-properties">'.
implode("\n", $table).
'</table>';
$context_bar = null;
if ($parent_task) {
@ -308,20 +286,16 @@ final class ManiphestTaskDetailController extends ManiphestController {
$action_list = new AphrontHeadsupActionListView();
$action_list->setActions($actions);
$panel =
'<div class="maniphest-panel">'.
$action_list->render().
'<div class="maniphest-task-detail-core">'.
'<h1>'.
'<span class="aphront-headsup-object-name">'.
phutil_escape_html('T'.$task->getID()).
'</span>'.
' '.
phutil_escape_html($task->getTitle()).
'</h1>'.
$table.
'</div>'.
'</div>';
$headsup_panel = new AphrontHeadsupView();
$headsup_panel->setObjectName('T'.$task->getID());
$headsup_panel->setHeader($task->getTitle());
$headsup_panel->setActionList($action_list);
$headsup_panel->setProperties($dict);
$headsup_panel->appendChild(
'<div class="phabricator-remarkup">'.
$engine->markupText($task->getDescription()).
'</div>');
$transaction_types = ManiphestTransactionType::getTransactionTypeMap();
$resolution_types = ManiphestTaskStatus::getTaskStatusMap();
@ -523,7 +497,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
return $this->buildStandardPageResponse(
array(
$context_bar,
$panel,
$headsup_panel,
$transaction_view,
$comment_panel,
$preview_panel,

View file

@ -36,6 +36,7 @@ phutil_require_module('phabricator', 'view/layout/contextbar');
phutil_require_module('phabricator', 'view/layout/filepreview');
phutil_require_module('phabricator', 'view/layout/headsup/action');
phutil_require_module('phabricator', 'view/layout/headsup/actionlist');
phutil_require_module('phabricator', 'view/layout/headsup/panel');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phutil', 'markup');

View file

@ -0,0 +1,112 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class AphrontHeadsupView extends AphrontView {
private $actionList;
private $header;
private $properties;
private $objectName;
private $hasKeyboardShortcuts;
public function setActionList(AphrontHeadsupActionListView $action_list) {
$this->actionList = $action_list;
return $this;
}
public function setHeader($header) {
$this->header = $header;
return $this;
}
public function setProperties(array $dict) {
$this->properties = $dict;
return $this;
}
public function setObjectName($name) {
$this->objectName = $name;
return $this;
}
public function setHasKeyboardShortcuts($has_keyboard_shortcuts) {
$this->hasKeyboardShortcuts = $has_keyboard_shortcuts;
return $this;
}
public function getHasKeyboardShortcuts() {
return $this->hasKeyboardShortcuts;
}
public function render() {
$header =
'<h1>'.
'<span class="aphront-headsup-object-name">'.
phutil_escape_html($this->objectName).
'</span>'.
' '.
phutil_escape_html($this->header).
'</h1>';
require_celerity_resource('aphront-headsup-view-css');
$shortcuts = null;
if ($this->hasKeyboardShortcuts) {
$shortcuts =
'<div class="aphront-headsup-keyboard-shortcuts">'.
id(new AphrontKeyboardShortcutsAvailableView())->render().
'</div>';
}
$prop_table = null;
if ($this->properties) {
$prop_table = array();
foreach ($this->properties as $key => $value) {
$prop_table[] =
'<tr>'.
'<th>'.phutil_escape_html($key.':').'</th>'.
'<td>'.$value.'</td>'.
'</tr>';
}
$prop_table =
'<table class="aphront-headsup-property-table">'.
implode("\n", $prop_table).
'</table>';
}
$children = $this->renderChildren();
if (strlen($children)) {
$children =
'<div class="aphront-headsup-details">'.
$children.
'</div>';
}
return
'<div class="aphront-headsup-panel">'.
self::renderSingleView($this->actionList).
$shortcuts.
'<div class="aphront-headsup-core">'.
$header.
$prop_table.
$children.
'</div>'.
'</div>';
}
}

View file

@ -0,0 +1,17 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'view/base');
phutil_require_module('phabricator', 'view/widget/keyboardshortcuts');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils');
phutil_require_source('AphrontHeadsupView.php');

View file

@ -13,7 +13,7 @@
background: #cfcfbf;
border: 1px solid #666622;
border-width: 0px 0px 1px 1px;
margin: -15px -20px 1em 0;
margin: -15px 0px 1em 0;
font-size: 11px;
}

View file

@ -0,0 +1,55 @@
/**
* @provides aphront-headsup-view-css
*/
.aphront-headsup-panel {
border: 1px solid #666622;
background: #efefdf;
font-size: 13px;
margin: .5em 2em .25em;
padding: 15px 0 0;
}
.aphront-headsup-panel h1 {
border-bottom: 1px solid #aaaa99;
margin: 0 285px 8px 20px;
padding-bottom: 8px;
}
.aphront-headsup-property-table {
font-size: 12px;
width: auto;
margin: 0 285px 15px 20px;
}
.aphront-headsup-property-table th {
font-weight: bold;
width: 100px;
text-align: right;
padding: 3px;
color: #333333;
white-space: nowrap;
}
.aphront-headsup-property-table td {
padding: 3px;
}
.aphront-headsup-details {
clear: both;
border-top: 1px solid #666622;
background: #fbfbef;
margin-top: 1em;
padding: .75em 20px;
}
.aphront-headsup-object-name {
color: #666666;
margin-right: 0.25em;
}
.aphront-headsup-keyboard-shortcuts {
float: right;
margin-right: 20px;
}

View file

@ -2,32 +2,6 @@
* @provides differential-revision-detail-css
*/
.differential-revision-properties {
font-size: 12px;
width: 100%;
table-layout: fixed;
}
.differential-revision-properties tt {
letter-spacing: 1.1px;
}
.differential-revision-properties th {
font-weight: bold;
width: 120px;
text-align: right;
padding: 3px 4px 3px 3px;
color: #333333;
}
.differential-revision-properties td {
padding: 3px 2px;
}
.differential-revision-detail-core {
margin-right: 265px;
}
.differential-unit-block,
.differential-lint-block {
padding: .5em;
@ -92,7 +66,3 @@
color: #ffff66;
font-size: 12px;
}
.differential-keyboard-shortcuts {
float: right;
}

View file

@ -41,8 +41,3 @@
.maniphest-task-detail-core {
margin-right: 265px;
}
.maniphest-task-detail-core .create-button-container {
float:right;
margin-top:-0.5em;
}