diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'dd1447be', + 'core.pkg.css' => '8b3cf1d3', 'core.pkg.js' => '7d8faf57', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '2de124c9', @@ -135,7 +135,7 @@ 'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e', 'rsrc/css/phui/phui-form.css' => 'aac1d51d', 'rsrc/css/phui/phui-head-thing.css' => '11731da0', - 'rsrc/css/phui/phui-header-view.css' => 'fc4acf14', + 'rsrc/css/phui/phui-header-view.css' => '24a1d1e4', 'rsrc/css/phui/phui-hovercard.css' => 'de1a2119', 'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad', 'rsrc/css/phui/phui-icon.css' => '3f33ab57', @@ -153,7 +153,7 @@ 'rsrc/css/phui/phui-segment-bar-view.css' => '46342871', 'rsrc/css/phui/phui-spacing.css' => '042804d6', 'rsrc/css/phui/phui-status.css' => '37309046', - 'rsrc/css/phui/phui-tag-view.css' => '9d5d4400', + 'rsrc/css/phui/phui-tag-view.css' => '6bbd83e2', 'rsrc/css/phui/phui-timeline-view.css' => '2efceff8', 'rsrc/css/phui/phui-two-column-view.css' => 'd0ad8c10', 'rsrc/css/phui/workboards/phui-workboard-color.css' => 'ac6fe6a7', @@ -820,7 +820,7 @@ 'phui-form-css' => 'aac1d51d', 'phui-form-view-css' => '4a1a0f5e', 'phui-head-thing-view-css' => '11731da0', - 'phui-header-view-css' => 'fc4acf14', + 'phui-header-view-css' => '24a1d1e4', 'phui-hovercard' => '1bd28176', 'phui-hovercard-view-css' => 'de1a2119', 'phui-icon-set-selector-css' => '1ab67aad', @@ -840,7 +840,7 @@ 'phui-segment-bar-view-css' => '46342871', 'phui-spacing-css' => '042804d6', 'phui-status-list-view-css' => '37309046', - 'phui-tag-view-css' => '9d5d4400', + 'phui-tag-view-css' => '6bbd83e2', 'phui-theme-css' => '027ba77e', 'phui-timeline-view-css' => '2efceff8', 'phui-two-column-view-css' => 'd0ad8c10', diff --git a/src/applications/maniphest/constants/ManiphestTaskStatus.php b/src/applications/maniphest/constants/ManiphestTaskStatus.php --- a/src/applications/maniphest/constants/ManiphestTaskStatus.php +++ b/src/applications/maniphest/constants/ManiphestTaskStatus.php @@ -82,29 +82,19 @@ return self::getStatusAttribute($status, 'name', pht('Unknown Status')); } - public static function renderFullDescription($status) { + public static function renderFullDescription($status, $priority) { if (self::isOpenStatus($status)) { - $color = 'status'; - $icon_color = 'bluegrey'; + $name = pht('%s, %s', self::getTaskStatusFullName($status), $priority); + $color = 'grey'; } else { - $color = 'status-dark'; - $icon_color = ''; + $name = self::getTaskStatusFullName($status); + $color = 'indigo'; } - $icon = self::getStatusIcon($status); - - $img = id(new PHUIIconView()) - ->setIcon($icon.' '.$icon_color); - - $tag = phutil_tag( - 'span', - array( - 'class' => 'phui-header-status phui-header-'.$color, - ), - array( - $img, - self::getTaskStatusFullName($status), - )); + $tag = id(new PHUITagView()) + ->setName($name) + ->setType(PHUITagView::TYPE_SHADE) + ->setShade($color); return $tag; } diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -65,24 +65,17 @@ new ManiphestTransactionQuery(), $engine); - $actions = $this->buildActionView($task); - $monogram = $task->getMonogram(); $crumbs = $this->buildApplicationCrumbs() - ->addTextCrumb($monogram, '/'.$monogram); + ->addTextCrumb($monogram) + ->setBorder(true); $header = $this->buildHeaderView($task); - $properties = $this->buildPropertyView( - $task, $field_list, $edges, $actions, $handles); + $details = $this->buildPropertyView($task, $field_list, $edges, $handles); $description = $this->buildDescriptionView($task, $engine); - - $object_box = id(new PHUIObjectBoxView()) - ->setHeader($header) - ->addPropertyList($properties); - - if ($description) { - $object_box->addPropertyList($description); - } + $actions = $this->buildActionView($task); + $properties = $this->buildPropertyListView($task, $handles); + $subheader = $this->buildSubheaderView($task); $title = pht('%s %s', $monogram, $task->getTitle()); @@ -93,6 +86,18 @@ $timeline->setQuoteRef($monogram); $comment_view->setTransactionTimeline($timeline); + $view = id(new PHUITwoColumnView()) + ->setHeader($header) + ->setSubheader($subheader) + ->setMainColumn(array( + $timeline, + $comment_view, + )) + ->addPropertySection(pht('DETAILS'), $details) + ->addPropertySection(pht('DESCRIPTION'), $description) + ->setPropertyList($properties) + ->setActionList($actions); + return $this->newPage() ->setTitle($title) ->setCrumbs($crumbs) @@ -102,10 +107,9 @@ )) ->appendChild( array( - $object_box, - $timeline, - $comment_view, - )); + $view, + )); + } private function buildHeaderView(ManiphestTask $task) { @@ -114,11 +118,34 @@ ->setUser($this->getRequest()->getUser()) ->setPolicyObject($task); - $status = $task->getStatus(); - $status_name = ManiphestTaskStatus::renderFullDescription($status); + $priority_name = ManiphestTaskPriority::getTaskPriorityName( + $task->getPriority()); + $priority_color = ManiphestTaskPriority::getTaskPriorityColor( + $task->getPriority()); + $status = $task->getStatus(); + $status_name = ManiphestTaskStatus::renderFullDescription( + $status, $priority_name, $priority_color); $view->addProperty(PHUIHeaderView::PROPERTY_STATUS, $status_name); + $view->setHeaderIcon(ManiphestTaskStatus::getStatusIcon( + $task->getStatus()).' '.$priority_color); + + if (ManiphestTaskPoints::getIsEnabled()) { + $points = $task->getPoints(); + if ($points !== null) { + $points_name = pht('%s %s', + $task->getPoints(), + ManiphestTaskPoints::getPointsLabel()); + $tag = id(new PHUITagView()) + ->setName($points_name) + ->setShade('blue') + ->setType(PHUITagView::TYPE_SHADE); + + $view->addTag($tag); + } + } + return $view; } @@ -194,49 +221,37 @@ return $view; } + private function buildSubheaderView( + ManiphestTask $task) { + $viewer = $this->getViewer(); + + $author_phid = $task->getAuthorPHID(); + + $author = $viewer->renderHandle($author_phid)->render(); + $date = phabricator_datetime($task->getDateCreated(), $viewer); + $author = phutil_tag('strong', array(), $author); + + $handles = $viewer->loadHandles(array($author_phid)); + $image_uri = $handles[$author_phid]->getImageURI(); + $image_href = $handles[$author_phid]->getURI(); + + $content = pht('Created by %s on %s.', $author, $date); + + return id(new PHUIHeadThingView()) + ->setImage($image_uri) + ->setImageHref($image_href) + ->setContent($content); + } + private function buildPropertyView( ManiphestTask $task, PhabricatorCustomFieldList $field_list, array $edges, - PhabricatorActionListView $actions, $handles) { $viewer = $this->getRequest()->getUser(); - $view = id(new PHUIPropertyListView()) - ->setUser($viewer) - ->setObject($task) - ->setActionList($actions); - - $owner_phid = $task->getOwnerPHID(); - if ($owner_phid) { - $assigned_to = $handles - ->renderHandle($owner_phid) - ->setShowHovercard(true); - } else { - $assigned_to = phutil_tag('em', array(), pht('None')); - } - - $view->addProperty(pht('Assigned To'), $assigned_to); - - $view->addProperty( - pht('Priority'), - ManiphestTaskPriority::getTaskPriorityName($task->getPriority())); - - $author = $handles - ->renderHandle($task->getAuthorPHID()) - ->setShowHovercard(true); - - $view->addProperty(pht('Author'), $author); - - if (ManiphestTaskPoints::getIsEnabled()) { - $points = $task->getPoints(); - if ($points !== null) { - $view->addProperty( - ManiphestTaskPoints::getPointsLabel(), - $task->getPoints()); - } - } + ->setUser($viewer); $source = $task->getOriginalEmailSource(); if ($source) { @@ -304,13 +319,36 @@ phutil_implode_html(phutil_tag('br'), $revisions_commits)); } - $view->invokeWillRenderEvent(); - $field_list->appendFieldsToPropertyList( $task, $viewer, $view); + if ($view->hasAnyProperties()) { + return $view; + } + + return null; + } + + private function buildPropertyListView(ManiphestTask $task, $handles) { + $viewer = $this->getRequest()->getUser(); + $view = id(new PHUIPropertyListView()) + ->setUser($viewer) + ->setObject($task); + + $owner_phid = $task->getOwnerPHID(); + if ($owner_phid) { + $assigned_to = $handles + ->renderHandle($owner_phid) + ->setShowHovercard(true); + } else { + $assigned_to = phutil_tag('em', array(), pht('None')); + } + + $view->addProperty(pht('Assigned To'), $assigned_to); + + $view->invokeWillRenderEvent(); return $view; } @@ -321,9 +359,6 @@ $section = null; if (strlen($task->getDescription())) { $section = new PHUIPropertyListView(); - $section->addSectionHeader( - pht('Description'), - PHUIPropertyListView::ICON_SUMMARY); $section->addTextContent( phutil_tag( 'div', diff --git a/src/view/phui/PHUIHeaderView.php b/src/view/phui/PHUIHeaderView.php --- a/src/view/phui/PHUIHeaderView.php +++ b/src/view/phui/PHUIHeaderView.php @@ -285,7 +285,7 @@ $this->buttonBar); } - if ($this->actionIcons || $this->tags) { + if ($this->actionIcons) { $action_list = array(); if ($this->actionIcons) { foreach ($this->actionIcons as $icon) { @@ -297,14 +297,6 @@ $icon); } } - if ($this->tags) { - $action_list[] = phutil_tag( - 'li', - array( - 'class' => 'phui-header-action-tag', - ), - array_interleave(' ', $this->tags)); - } $right[] = phutil_tag( 'ul', array( @@ -379,6 +371,10 @@ $property_list[] = $this->renderPolicyProperty($this->policyObject); } + if ($this->tags) { + $property_list[] = $this->tags; + } + $left[] = phutil_tag( 'div', array( diff --git a/webroot/rsrc/css/phui/phui-header-view.css b/webroot/rsrc/css/phui/phui-header-view.css --- a/webroot/rsrc/css/phui/phui-header-view.css +++ b/webroot/rsrc/css/phui/phui-header-view.css @@ -175,7 +175,8 @@ margin-top: 8px; } -.phui-header-subheader .phui-icon-view { +.phui-header-subheader .phui-tag-view .phui-icon-view, +.phui-header-subheader .policy-header-callout .phui-icon-view { display: inline-block; margin: -2px 4px -2px 0; font-size: 15px; @@ -187,11 +188,19 @@ } .policy-header-callout, -.phui-header-subheader .phui-header-status { +.phui-header-subheader .phui-header-status, +.phui-header-subheader .phui-tag-core { padding: 3px 9px; border-radius: 3px; - background: rgba({$alphablue}, 0.08); + background: rgba({$alphablue}, 0.1); margin-right: 8px; + -webkit-font-smoothing: auto; + border-color: transparent; +} + +.phui-header-subheader .phui-tag-type-shade .phui-tag-core { + border: none; + -webkit-font-smoothing: auto; } .policy-header-callout.policy-adjusted-weaker { diff --git a/webroot/rsrc/css/phui/phui-tag-view.css b/webroot/rsrc/css/phui/phui-tag-view.css --- a/webroot/rsrc/css/phui/phui-tag-view.css +++ b/webroot/rsrc/css/phui/phui-tag-view.css @@ -257,6 +257,26 @@ border-color: {$sh-blueborder}; } +/* - Sky ------------------------------------------------------------------- */ + +.phui-tag-shade-sky .phui-tag-core, +.jx-tokenizer-token.sky { + background: #E0F0FA; + border-color: {$sh-lightblueborder}; + color: {$sh-bluetext}; +} + +.phui-tag-shade-sky .phui-icon-view, +.jx-tokenizer-token.sky .phui-icon-view, +.jx-tokenizer-token.sky .jx-tokenizer-x { + color: {$sh-blueicon}; +} + +a.phui-tag-view:hover.phui-tag-shade-sky .phui-tag-core, +.jx-tokenizer-token.sky:hover { + border-color: {$sh-blueborder}; +} + /* - Indigo ----------------------------------------------------------------- */ .phui-tag-shade-indigo .phui-tag-core,