diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index 2b4e5245d5..0f789ff193 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -43,6 +43,15 @@ celerity_register_resource_map(array( ), 'disk' => '/rsrc/css/aphront/form-view.css', ), + 'aphront-headsup-action-list-view-css' => + array( + 'uri' => '/res/099b7588/rsrc/css/aphront/headsup-action-list-view.css', + 'type' => 'css', + 'requires' => + array( + ), + 'disk' => '/rsrc/css/aphront/headsup-action-list-view.css', + ), 'aphront-panel-view-css' => array( 'uri' => '/res/63672373/rsrc/css/aphront/panel-view.css', @@ -154,7 +163,7 @@ celerity_register_resource_map(array( ), 'differential-revision-detail-css' => array( - 'uri' => '/res/7b5e95cc/rsrc/css/application/differential/revision-detail.css', + 'uri' => '/res/623e3946/rsrc/css/application/differential/revision-detail.css', 'type' => 'css', 'requires' => array( @@ -486,7 +495,7 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/04b474ba/core.pkg.css', 'type' => 'css', ), - 'fcf7ec68' => + '76f3c1f8' => array ( 'name' => 'differential.pkg.css', 'symbols' => @@ -500,7 +509,7 @@ celerity_register_resource_map(array( 6 => 'differential-revision-add-comment-css', 7 => 'differential-revision-comment-list-css', ), - 'uri' => '/res/pkg/fcf7ec68/differential.pkg.css', + 'uri' => '/res/pkg/76f3c1f8/differential.pkg.css', 'type' => 'css', ), '30d594cf' => @@ -533,14 +542,14 @@ celerity_register_resource_map(array( 'phabricator-directory-css' => '04b474ba', 'phabricator-remarkup-css' => '04b474ba', 'syntax-highlighting-css' => '04b474ba', - 'differential-core-view-css' => 'fcf7ec68', - 'differential-changeset-view-css' => 'fcf7ec68', - 'differential-revision-detail-css' => 'fcf7ec68', - 'differential-revision-history-css' => 'fcf7ec68', - 'differential-table-of-contents-css' => 'fcf7ec68', - 'differential-revision-comment-css' => 'fcf7ec68', - 'differential-revision-add-comment-css' => 'fcf7ec68', - 'differential-revision-comment-list-css' => 'fcf7ec68', + 'differential-core-view-css' => '76f3c1f8', + 'differential-changeset-view-css' => '76f3c1f8', + 'differential-revision-detail-css' => '76f3c1f8', + 'differential-revision-history-css' => '76f3c1f8', + 'differential-table-of-contents-css' => '76f3c1f8', + 'differential-revision-comment-css' => '76f3c1f8', + 'differential-revision-add-comment-css' => '76f3c1f8', + 'differential-revision-comment-list-css' => '76f3c1f8', 'javelin-behavior-differential-feedback-preview' => '30d594cf', 'javelin-behavior-differential-edit-inline-comments' => '30d594cf', 'javelin-behavior-differential-populate' => '30d594cf', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 81e017f63c..481aa89e27 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -35,6 +35,8 @@ phutil_register_library_map(array( 'AphrontFormTextControl' => 'view/form/control/text', 'AphrontFormTokenizerControl' => 'view/form/control/tokenizer', 'AphrontFormView' => 'view/form/base', + 'AphrontHeadsupActionListView' => 'view/layout/headsup/actionlist', + 'AphrontHeadsupActionView' => 'view/layout/headsup/action', 'AphrontMySQLDatabaseConnection' => 'storage/connection/mysql', 'AphrontNullView' => 'view/null', 'AphrontPageView' => 'view/page/base', @@ -312,6 +314,8 @@ phutil_register_library_map(array( 'AphrontFormTextControl' => 'AphrontFormControl', 'AphrontFormTokenizerControl' => 'AphrontFormControl', 'AphrontFormView' => 'AphrontView', + 'AphrontHeadsupActionListView' => 'AphrontView', + 'AphrontHeadsupActionView' => 'AphrontView', 'AphrontMySQLDatabaseConnection' => 'AphrontDatabaseConnection', 'AphrontNullView' => 'AphrontView', 'AphrontPageView' => 'AphrontView', diff --git a/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php b/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php index f965d165a0..40364783c1 100644 --- a/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php +++ b/src/applications/differential/view/revisiondetail/DifferentialRevisionDetailView.php @@ -60,25 +60,20 @@ final class DifferentialRevisionDetailView extends AphrontView { $actions = array(); foreach ($this->actions as $action) { - if (empty($action['href'])) { - $tag = 'span'; - } else { - $tag = 'a'; - } - $name = $action['name']; - unset($action['name']); - $actions[] = javelin_render_tag( - $tag, - $action, - phutil_escape_html($name)); + $obj = new AphrontHeadsupActionView(); + $obj->setName($action['name']); + $obj->setURI(idx($action, 'href')); + $obj->setWorkflow(idx($action, 'sigil') == 'workflow'); + $obj->setClass(idx($action, 'class')); + $actions[] = $obj; } - $actions = implode("\n", $actions); + + $action_list = new AphrontHeadsupActionListView(); + $action_list->setActions($actions); return '
'. - '
'. - $actions. - '
'. + $action_list->render(). '
'. '

'.phutil_escape_html($revision->getTitle()).'

'. $properties. diff --git a/src/applications/differential/view/revisiondetail/__init__.php b/src/applications/differential/view/revisiondetail/__init__.php index c48aa84247..e569d5d380 100644 --- a/src/applications/differential/view/revisiondetail/__init__.php +++ b/src/applications/differential/view/revisiondetail/__init__.php @@ -7,10 +7,12 @@ phutil_require_module('phabricator', 'infrastructure/celerity/api'); -phutil_require_module('phabricator', 'infrastructure/javelin/markup'); 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('phutil', 'markup'); +phutil_require_module('phutil', 'utils'); phutil_require_source('DifferentialRevisionDetailView.php'); diff --git a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php index df9e788f45..09a690f75a 100644 --- a/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/taskdetail/ManiphestTaskDetailController.php @@ -125,8 +125,31 @@ class ManiphestTaskDetailController extends ManiphestController { implode("\n", $table). ''; + + $actions = array(); + + $action = new AphrontHeadsupActionView(); + $action->setName('Edit Task'); + $action->setURI('/maniphest/edit/'.$task->getID().'/'); + $action->setClass('action-edit'); + $actions[] = $action; + + $action = new AphrontHeadsupActionView(); + $action->setName('Upload File'); + $action->setClass('action-upload unavailable'); + $actions[] = $action; + + $action = new AphrontHeadsupActionView(); + $action->setName('Edit Differential Revisions'); + $action->setClass('action-attach unavailable'); + $actions[] = $action; + + $action_list = new AphrontHeadsupActionListView(); + $action_list->setActions($actions); + $panel = '
'. + $action_list->render(). '
'. '

'. phutil_escape_html('T'.$task->getID().' '.$task->getTitle()). diff --git a/src/view/layout/headsup/action/AphrontHeadsupActionView.php b/src/view/layout/headsup/action/AphrontHeadsupActionView.php new file mode 100755 index 0000000000..32a61e1bf2 --- /dev/null +++ b/src/view/layout/headsup/action/AphrontHeadsupActionView.php @@ -0,0 +1,69 @@ +name = $name; + return $this; + } + + public function setClass($class) { + $this->class = $class; + return $this; + } + + public function setURI($uri) { + $this->uri = $uri; + return $this; + } + + public function setWorkflow($workflow) { + $this->workflow = $workflow; + return $this; + } + + public function render() { + + if ($this->uri) { + $tag = 'a'; + } else { + $tag = 'span'; + } + + $attrs = array( + 'href' => $this->uri, + 'class' => $this->class, + ); + + if ($this->workflow) { + $attrs['sigil'] = 'workflow'; + } + + return javelin_render_tag( + $tag, + $attrs, + phutil_escape_html($this->name)); + } + +} diff --git a/src/view/layout/headsup/action/__init__.php b/src/view/layout/headsup/action/__init__.php new file mode 100644 index 0000000000..cf91a9a157 --- /dev/null +++ b/src/view/layout/headsup/action/__init__.php @@ -0,0 +1,15 @@ +actions = $actions; + } + + public function render() { + + require_celerity_resource('aphront-headsup-action-list-view-css'); + + $actions = array(); + foreach ($this->actions as $action_view) { + $actions[] = $action_view->render(); + } + $actions = implode("\n", $actions); + + return + '
'. + $actions. + '
'; + } + +} diff --git a/src/view/layout/headsup/actionlist/__init__.php b/src/view/layout/headsup/actionlist/__init__.php new file mode 100644 index 0000000000..c5f5e313e5 --- /dev/null +++ b/src/view/layout/headsup/actionlist/__init__.php @@ -0,0 +1,12 @@ +