From 0a749ad51b690cdc3be3f76760fa6236f5f4027d Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 14 Jun 2011 12:42:27 -0700 Subject: [PATCH] Give unposted comments a distinct visual style Summary: See attached tasks. See D459 for the ability to merge tasks. Test Plan: Looked at posted and unposted inline comments. Reviewed By: aran Reviewers: edward, viyer, aran, jungejason, tuomaspelkonen CC: aran, epriestley Differential Revision: 461 --- src/__celerity_resource_map__.php | 52 +++++++++---------- .../DifferentialInlineCommentView.php | 16 +++++- .../differential/changeset-view.css | 9 ++++ 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index d78089ceb3..fc506ddcb2 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -145,7 +145,7 @@ celerity_register_resource_map(array( ), 'differential-changeset-view-css' => array( - 'uri' => '/res/27f196e3/rsrc/css/application/differential/changeset-view.css', + 'uri' => '/res/2a59525c/rsrc/css/application/differential/changeset-view.css', 'type' => 'css', 'requires' => array( @@ -1116,23 +1116,6 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/03ef179e/diffusion.pkg.css', 'type' => 'css', ), - '0e6e36aa' => - array ( - 'name' => 'differential.pkg.css', - 'symbols' => - array ( - 0 => 'differential-core-view-css', - 1 => 'differential-changeset-view-css', - 2 => 'differential-revision-detail-css', - 3 => 'differential-revision-history-css', - 4 => 'differential-table-of-contents-css', - 5 => 'differential-revision-comment-css', - 6 => 'differential-revision-add-comment-css', - 7 => 'differential-revision-comment-list-css', - ), - 'uri' => '/res/pkg/0e6e36aa/differential.pkg.css', - 'type' => 'css', - ), '2892314d' => array ( 'name' => 'typeahead.pkg.js', @@ -1165,6 +1148,23 @@ celerity_register_resource_map(array( 'uri' => '/res/pkg/861d7db0/workflow.pkg.js', 'type' => 'js', ), + '8f3a55d1' => + array ( + 'name' => 'differential.pkg.css', + 'symbols' => + array ( + 0 => 'differential-core-view-css', + 1 => 'differential-changeset-view-css', + 2 => 'differential-revision-detail-css', + 3 => 'differential-revision-history-css', + 4 => 'differential-table-of-contents-css', + 5 => 'differential-revision-comment-css', + 6 => 'differential-revision-add-comment-css', + 7 => 'differential-revision-comment-list-css', + ), + 'uri' => '/res/pkg/8f3a55d1/differential.pkg.css', + 'type' => 'css', + ), 'acfddc38' => array ( 'name' => 'core.pkg.css', @@ -1234,14 +1234,14 @@ celerity_register_resource_map(array( 'aphront-table-view-css' => 'acfddc38', 'aphront-tokenizer-control-css' => 'acfddc38', 'aphront-typeahead-control-css' => 'acfddc38', - 'differential-changeset-view-css' => '0e6e36aa', - 'differential-core-view-css' => '0e6e36aa', - 'differential-revision-add-comment-css' => '0e6e36aa', - 'differential-revision-comment-css' => '0e6e36aa', - 'differential-revision-comment-list-css' => '0e6e36aa', - 'differential-revision-detail-css' => '0e6e36aa', - 'differential-revision-history-css' => '0e6e36aa', - 'differential-table-of-contents-css' => '0e6e36aa', + 'differential-changeset-view-css' => '8f3a55d1', + 'differential-core-view-css' => '8f3a55d1', + 'differential-revision-add-comment-css' => '8f3a55d1', + 'differential-revision-comment-css' => '8f3a55d1', + 'differential-revision-comment-list-css' => '8f3a55d1', + 'differential-revision-detail-css' => '8f3a55d1', + 'differential-revision-history-css' => '8f3a55d1', + 'differential-table-of-contents-css' => '8f3a55d1', 'diffusion-commit-view-css' => '03ef179e', 'javelin-behavior' => 'db95a6d0', 'javelin-behavior-aphront-basic-tokenizer' => '2892314d', diff --git a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php index 6678340cf9..dea3466eec 100644 --- a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php +++ b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php @@ -88,6 +88,12 @@ final class DifferentialInlineCommentView extends AphrontView { $links = array(); + $is_draft = false; + if (!$inline->getCommentID()) { + $links[] = 'Unsaved Draft'; + $is_draft = true; + } + if (!$this->preview) { $links[] = javelin_render_tag( 'a', @@ -163,10 +169,18 @@ final class DifferentialInlineCommentView extends AphrontView { ), ''); + $classes = array( + 'differential-inline-comment', + ); + if ($is_draft) { + $classes[] = 'differential-inline-comment-unsaved-draft'; + } + $classes = implode(' ', $classes); + $markup = javelin_render_tag( 'div', array( - 'class' => 'differential-inline-comment', + 'class' => $classes, 'sigil' => $sigil, 'meta' => $metadata, ), diff --git a/webroot/rsrc/css/application/differential/changeset-view.css b/webroot/rsrc/css/application/differential/changeset-view.css index 56aec58c7c..ac78c5a6e4 100644 --- a/webroot/rsrc/css/application/differential/changeset-view.css +++ b/webroot/rsrc/css/application/differential/changeset-view.css @@ -145,6 +145,11 @@ white-space: normal; } +.differential-inline-comment-unsaved-draft { + background: #f1f1f1; + border: 1px dashed #666666; +} + .differential-inline-comment-head { font-weight: bold; color: #333333; @@ -153,6 +158,10 @@ margin-bottom: 4px; } +.differential-inline-comment-unsaved-draft .differential-inline-comment-head { + border-bottom: 1px solid #aaaaaa; +} + .differential-inline-comment-links, .differential-inline-comment-line { font-weight: normal;