From b8ea6c441ff2ca387578c84d03699065398395a6 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 9 Apr 2013 15:50:48 -0700 Subject: [PATCH] Allow AphrontDialogView to use PhabricatorActionHeaderView Summary: We're baking some useful things into ActionHeader, would like to consolidate it's use around the site for consistency. Test Plan: Tested log out dialog, attach dependencies, delete document in phriction. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin, AnhNhan Differential Revision: https://secure.phabricator.com/D5635 --- .../sprite/gradients/dark-grey-header.png | Bin 0 -> 966 bytes resources/sprite/manifest/gradient.json | 25 +++-- src/__celerity_resource_map__.php | 86 +++++++++--------- .../controller/PhrictionDeleteController.php | 3 +- .../celerity/CeleritySpriteGenerator.php | 3 +- src/view/AphrontDialogView.php | 12 ++- .../layout/PhabricatorActionHeaderView.php | 1 + webroot/rsrc/css/aphront/dialog-view.css | 18 ++-- .../layout/phabricator-action-header-view.css | 2 +- webroot/rsrc/css/sprite-gradient.css | 12 ++- webroot/rsrc/image/sprite-gradient.png | Bin 873 -> 914 bytes 11 files changed, 91 insertions(+), 71 deletions(-) create mode 100644 resources/sprite/gradients/dark-grey-header.png diff --git a/resources/sprite/gradients/dark-grey-header.png b/resources/sprite/gradients/dark-grey-header.png new file mode 100644 index 0000000000000000000000000000000000000000..4a169a5054c8d9d24973bc96820e4d5bca5b8414 GIT binary patch literal 966 zcmaJ=O=#0l9FH4<4u*mte!(7@2L+q2E@=}QOV_lvU`pxARup7u^4f+jc`e z6wlr~?CL=e;!Q*ZFS~mZk6t{eFg%Uve6MRe57v<6z4zz$`~5%P<7(x`;=+XmhG7=V zC8I{x{)GCgO)S6y8|-}Gk@8wH*mwe zsoBWmEQ;Y`kFpsilZ^w*?m`TjuQQ`&iDhY8#lNC)$f$_r<8Y;6+ZLDNTT; z`G2VAP0{wQ3>W#V1>{#+MxjYGmr>*^~ z)e{q$AG)0mE;&p`ANpk8Lps=RpKp*$kuDp#di<%m|MTma`E&aR2TP?__kZm@J$6zM zx9842lAi6pUeA91;=XvW{cY*{?~DHK$MsXEH<{ZXdY5k9*~9c^l?xT) array( - 'hash' => '72614b1679a3c69fcef9766c0f2be53d', - 'uri' => '/res/72614b16/rsrc/image/sprite-gradient.png', + 'hash' => 'e52f57d64edfddfcc2f8bd26a262dda2', + 'uri' => '/res/e52f57d6/rsrc/image/sprite-gradient.png', 'disk' => '/rsrc/image/sprite-gradient.png', 'type' => 'png', ), @@ -761,7 +761,7 @@ celerity_register_resource_map(array( ), 'aphront-dialog-view-css' => array( - 'uri' => '/res/215b3ab1/rsrc/css/aphront/dialog-view.css', + 'uri' => '/res/7060a2fe/rsrc/css/aphront/dialog-view.css', 'type' => 'css', 'requires' => array( @@ -2831,7 +2831,7 @@ celerity_register_resource_map(array( ), 'phabricator-action-header-view-css' => array( - 'uri' => '/res/1c0142de/rsrc/css/layout/phabricator-action-header-view.css', + 'uri' => '/res/948f998b/rsrc/css/layout/phabricator-action-header-view.css', 'type' => 'css', 'requires' => array( @@ -3821,7 +3821,7 @@ celerity_register_resource_map(array( ), 'sprite-gradient-css' => array( - 'uri' => '/res/5bce353e/rsrc/css/sprite-gradient.css', + 'uri' => '/res/fdc4dd44/rsrc/css/sprite-gradient.css', 'type' => 'css', 'requires' => array( @@ -3903,7 +3903,7 @@ celerity_register_resource_map(array( ), array( 'packages' => array( - '60914b69' => + 'b3deb720' => array( 'name' => 'core.pkg.css', 'symbols' => @@ -3945,7 +3945,7 @@ celerity_register_resource_map(array( 34 => 'phabricator-object-item-list-view-css', 35 => 'global-drag-and-drop-css', ), - 'uri' => '/res/pkg/60914b69/core.pkg.css', + 'uri' => '/res/pkg/b3deb720/core.pkg.css', 'type' => 'css', ), 'bf16b308' => @@ -4135,16 +4135,16 @@ celerity_register_resource_map(array( 'reverse' => array( 'aphront-attached-file-view-css' => '6b1fccc6', - 'aphront-dialog-view-css' => '60914b69', - 'aphront-error-view-css' => '60914b69', - 'aphront-form-view-css' => '60914b69', - 'aphront-list-filter-view-css' => '60914b69', - 'aphront-pager-view-css' => '60914b69', - 'aphront-panel-view-css' => '60914b69', - 'aphront-table-view-css' => '60914b69', - 'aphront-tokenizer-control-css' => '60914b69', - 'aphront-tooltip-css' => '60914b69', - 'aphront-typeahead-control-css' => '60914b69', + 'aphront-dialog-view-css' => 'b3deb720', + 'aphront-error-view-css' => 'b3deb720', + 'aphront-form-view-css' => 'b3deb720', + 'aphront-list-filter-view-css' => 'b3deb720', + 'aphront-pager-view-css' => 'b3deb720', + 'aphront-panel-view-css' => 'b3deb720', + 'aphront-table-view-css' => 'b3deb720', + 'aphront-tokenizer-control-css' => 'b3deb720', + 'aphront-tooltip-css' => 'b3deb720', + 'aphront-typeahead-control-css' => 'b3deb720', 'differential-changeset-view-css' => '8aaacd1b', 'differential-core-view-css' => '8aaacd1b', 'differential-inline-comment-editor' => 'e96b08f8', @@ -4158,7 +4158,7 @@ celerity_register_resource_map(array( 'differential-table-of-contents-css' => '8aaacd1b', 'diffusion-commit-view-css' => 'c8ce2d88', 'diffusion-icons-css' => 'c8ce2d88', - 'global-drag-and-drop-css' => '60914b69', + 'global-drag-and-drop-css' => 'b3deb720', 'inline-comment-summary-css' => '8aaacd1b', 'javelin-aphlict' => 'bf16b308', 'javelin-behavior' => 'a2f94024', @@ -4230,47 +4230,47 @@ celerity_register_resource_map(array( 'javelin-util' => 'a2f94024', 'javelin-vector' => 'a2f94024', 'javelin-workflow' => 'a2f94024', - 'lightbox-attachment-css' => '60914b69', + 'lightbox-attachment-css' => 'b3deb720', 'maniphest-task-summary-css' => '6b1fccc6', 'maniphest-transaction-detail-css' => '6b1fccc6', 'phabricator-busy' => 'bf16b308', 'phabricator-content-source-view-css' => '8aaacd1b', - 'phabricator-core-buttons-css' => '60914b69', - 'phabricator-core-css' => '60914b69', - 'phabricator-crumbs-view-css' => '60914b69', - 'phabricator-directory-css' => '60914b69', + 'phabricator-core-buttons-css' => 'b3deb720', + 'phabricator-core-css' => 'b3deb720', + 'phabricator-crumbs-view-css' => 'b3deb720', + 'phabricator-directory-css' => 'b3deb720', 'phabricator-drag-and-drop-file-upload' => 'e96b08f8', 'phabricator-dropdown-menu' => 'bf16b308', 'phabricator-file-upload' => 'bf16b308', - 'phabricator-filetree-view-css' => '60914b69', - 'phabricator-flag-css' => '60914b69', - 'phabricator-form-view-css' => '60914b69', - 'phabricator-header-view-css' => '60914b69', - 'phabricator-jump-nav' => '60914b69', + 'phabricator-filetree-view-css' => 'b3deb720', + 'phabricator-flag-css' => 'b3deb720', + 'phabricator-form-view-css' => 'b3deb720', + 'phabricator-header-view-css' => 'b3deb720', + 'phabricator-jump-nav' => 'b3deb720', 'phabricator-keyboard-shortcut' => 'bf16b308', 'phabricator-keyboard-shortcut-manager' => 'bf16b308', - 'phabricator-main-menu-view' => '60914b69', + 'phabricator-main-menu-view' => 'b3deb720', 'phabricator-menu-item' => 'bf16b308', - 'phabricator-nav-view-css' => '60914b69', + 'phabricator-nav-view-css' => 'b3deb720', 'phabricator-notification' => 'bf16b308', - 'phabricator-notification-css' => '60914b69', - 'phabricator-notification-menu-css' => '60914b69', - 'phabricator-object-item-list-view-css' => '60914b69', + 'phabricator-notification-css' => 'b3deb720', + 'phabricator-notification-menu-css' => 'b3deb720', + 'phabricator-object-item-list-view-css' => 'b3deb720', 'phabricator-object-selector-css' => '8aaacd1b', 'phabricator-prefab' => 'bf16b308', 'phabricator-project-tag-css' => '6b1fccc6', - 'phabricator-remarkup-css' => '60914b69', + 'phabricator-remarkup-css' => 'b3deb720', 'phabricator-shaped-request' => 'e96b08f8', - 'phabricator-side-menu-view-css' => '60914b69', - 'phabricator-standard-page-view' => '60914b69', + 'phabricator-side-menu-view-css' => 'b3deb720', + 'phabricator-standard-page-view' => 'b3deb720', 'phabricator-textareautils' => 'bf16b308', 'phabricator-tooltip' => 'bf16b308', - 'phabricator-transaction-view-css' => '60914b69', - 'phabricator-zindex-css' => '60914b69', - 'sprite-apps-large-css' => '60914b69', - 'sprite-gradient-css' => '60914b69', - 'sprite-icon-css' => '60914b69', - 'sprite-menu-css' => '60914b69', - 'syntax-highlighting-css' => '60914b69', + 'phabricator-transaction-view-css' => 'b3deb720', + 'phabricator-zindex-css' => 'b3deb720', + 'sprite-apps-large-css' => 'b3deb720', + 'sprite-gradient-css' => 'b3deb720', + 'sprite-icon-css' => 'b3deb720', + 'sprite-menu-css' => 'b3deb720', + 'syntax-highlighting-css' => 'b3deb720', ), )); diff --git a/src/applications/phriction/controller/PhrictionDeleteController.php b/src/applications/phriction/controller/PhrictionDeleteController.php index 649a5a0849..6df2dab66e 100644 --- a/src/applications/phriction/controller/PhrictionDeleteController.php +++ b/src/applications/phriction/controller/PhrictionDeleteController.php @@ -49,7 +49,8 @@ final class PhrictionDeleteController extends PhrictionController { } else { $dialog = id(new AphrontDialogView()) ->setUser($user) - ->setTitle(pht('Delete document?')) + ->setTitle(pht('Delete Document?')) + ->setHeaderColor(PhabricatorActionHeaderView::HEADER_RED) ->appendChild( pht('Really delete this document? You can recover it later by '. 'reverting to a previous version.')) diff --git a/src/infrastructure/celerity/CeleritySpriteGenerator.php b/src/infrastructure/celerity/CeleritySpriteGenerator.php index 4ba28ee18a..88b75332d0 100644 --- a/src/infrastructure/celerity/CeleritySpriteGenerator.php +++ b/src/infrastructure/celerity/CeleritySpriteGenerator.php @@ -415,7 +415,8 @@ final class CeleritySpriteGenerator { 'blue-header' => 70, 'green-header' => 70, 'yellow-header' => 70, - 'grey-header' => 70 + 'grey-header' => 70, + 'dark-grey-header' => 70, ); $extra_css = array( diff --git a/src/view/AphrontDialogView.php b/src/view/AphrontDialogView.php index 686f97deb6..514a6c42be 100644 --- a/src/view/AphrontDialogView.php +++ b/src/view/AphrontDialogView.php @@ -11,6 +11,7 @@ final class AphrontDialogView extends AphrontView { private $class; private $renderAsForm = true; private $formID; + private $headerColor = PhabricatorActionHeaderView::HEADER_DARK_GREY; private $width = 'default'; const WIDTH_DEFAULT = 'default'; @@ -82,6 +83,11 @@ final class AphrontDialogView extends AphrontView { return $this; } + public function setHeaderColor($color) { + $this->headerColor = $color; + return $this; + } + final public function render() { require_celerity_resource('aphront-dialog-view-css'); @@ -168,9 +174,13 @@ final class AphrontDialogView extends AphrontView { $buttons[] = phutil_tag('div', array('style' => 'clear: both;'), ''); $children = $this->renderChildren(); + $header = new PhabricatorActionHeaderView(); + $header->setHeaderTitle($this->title); + $header->setHeaderColor($this->headerColor); + $content = hsprintf( '%s%s%s', - phutil_tag('div', array('class' => 'aphront-dialog-head'), $this->title), + phutil_tag('div', array('class' => 'aphront-dialog-head'), $header), phutil_tag('div', array('class' => 'aphront-dialog-body'), $children), phutil_tag('div', array('class' => 'aphront-dialog-tail'), $buttons)); diff --git a/src/view/layout/PhabricatorActionHeaderView.php b/src/view/layout/PhabricatorActionHeaderView.php index 5b0a952f04..f7d3e3391d 100644 --- a/src/view/layout/PhabricatorActionHeaderView.php +++ b/src/view/layout/PhabricatorActionHeaderView.php @@ -6,6 +6,7 @@ final class PhabricatorActionHeaderView extends AphrontView { const ICON_WHITE = 'white'; const HEADER_GREY = 'grey'; + const HEADER_DARK_GREY = 'dark-grey'; const HEADER_BLUE = 'blue'; const HEADER_GREEN = 'green'; const HEADER_RED = 'red'; diff --git a/webroot/rsrc/css/aphront/dialog-view.css b/webroot/rsrc/css/aphront/dialog-view.css index 5716385df9..b43bc4e304 100644 --- a/webroot/rsrc/css/aphront/dialog-view.css +++ b/webroot/rsrc/css/aphront/dialog-view.css @@ -13,21 +13,19 @@ width: 300px; } -.aphront-dialog-head { - border: 1px solid #d4dadf; - font-size: 15px; - padding: 10px 15px; - font-weight: bold; +.aphront-dialog-head .phabricator-action-header { + border-bottom: 1px solid #d4dadf; + padding: 5px 15px; white-space: nowrap; - color: #525252; - text-shadow: 0 1px 0 white; - font-weight: bold; - background-image: url(/rsrc/image/texture/table_header_tall.png); - background-repeat: repeat-x; border-top-left-radius: 6px; border-top-right-radius: 6px; } +.aphront-dialog-head .phabricator-action-header + .phabricator-action-header-title { + font-size: 15px; +} + .aphront-dialog-view-width-form { width: 600px; } diff --git a/webroot/rsrc/css/layout/phabricator-action-header-view.css b/webroot/rsrc/css/layout/phabricator-action-header-view.css index 2cb9a4ab7b..cbe0e8ba33 100644 --- a/webroot/rsrc/css/layout/phabricator-action-header-view.css +++ b/webroot/rsrc/css/layout/phabricator-action-header-view.css @@ -45,7 +45,7 @@ .gradient-blue-header .phabricator-action-header-link, .gradient-yellow-header .phabricator-action-header-link { color: #fff; - text-shadow: 0 -1px 1px rgba(0,0,0,.5); + text-shadow: 0 -1px 1px rgba(0,0,0,.7); } .phabricator-action-header-title span { diff --git a/webroot/rsrc/css/sprite-gradient.css b/webroot/rsrc/css/sprite-gradient.css index cbe647dc52..9df95d7c62 100644 --- a/webroot/rsrc/css/sprite-gradient.css +++ b/webroot/rsrc/css/sprite-gradient.css @@ -19,16 +19,20 @@ background-position: 0px -109px; } +.gradient-dark-grey-header { + background-position: 0px -212px; +} + .gradient-dark-menu-label, .phabricator-dark-menu .phabricator-menu-item-type-label { background-position: 0px -25px; } .gradient-green-header { - background-position: 0px -212px; + background-position: 0px -283px; } .gradient-grey-header { - background-position: 0px -283px; + background-position: 0px -354px; } .gradient-menu-hover, .device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover, .phabricator-filetree a.phabricator-filetree-item:hover { @@ -44,9 +48,9 @@ } .gradient-red-header { - background-position: 0px -354px; + background-position: 0px -425px; } .gradient-yellow-header { - background-position: 0px -425px; + background-position: 0px -496px; } diff --git a/webroot/rsrc/image/sprite-gradient.png b/webroot/rsrc/image/sprite-gradient.png index c484e425a1ebdac20a932fd4470c72fd03031545..93d5b39e4665a083ff0dcffb42eafe73b811c66a 100644 GIT binary patch delta 906 zcmV;519klA29gJm7JmXa2nGNE0K9DODi6j4rCTY~i>>f~ry0Ys`$8G$Nd2Mnu&45$?!d^>PMh z%A(oWQZ_Oq$WlS0jaid*O~7PAHF35pkwcErYM3Dc!pKnbVHmO?TTYv7)kuf;s=X%B zfBpos`hpVK{`h$e%2*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