Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15282580
D13957.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13957.diff
View Options
diff --git a/src/applications/ponder/view/PonderAddAnswerView.php b/src/applications/ponder/view/PonderAddAnswerView.php
--- a/src/applications/ponder/view/PonderAddAnswerView.php
+++ b/src/applications/ponder/view/PonderAddAnswerView.php
@@ -34,13 +34,42 @@
$info_panel = null;
if ($question->getStatus() != PonderQuestionStatus::STATUS_OPEN) {
$info_panel = id(new PHUIInfoView())
- ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
+ ->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->appendChild(
pht(
'This question has been marked as closed,
but you can still leave a new answer.'));
}
+ $box_style = null;
+ $own_question = null;
+ $hide_action_id = celerity_generate_unique_node_id();
+ $show_action_id = celerity_generate_unique_node_id();
+ if ($question->getAuthorPHID() == $viewer->getPHID()) {
+ $box_style = 'display: none;';
+ $open_link = javelin_tag(
+ 'a',
+ array(
+ 'sigil' => 'reveal-content',
+ 'class' => 'mml',
+ 'id' => $hide_action_id,
+ 'href' => '#',
+ 'meta' => array(
+ 'showIDs' => array($show_action_id),
+ 'hideIDs' => array($hide_action_id),
+ ),
+ ),
+ pht('Add an answer.'));
+ $own_question = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
+ ->setID($hide_action_id)
+ ->appendChild(
+ pht(
+ 'This is your own question. You are welcome to provide
+ an answer if you have found a resolution.'))
+ ->appendChild($open_link);
+ }
+
$header = id(new PHUIHeaderView())
->setHeader(pht('Add Answer'));
@@ -69,6 +98,15 @@
$box->setInfoView($info_panel);
}
- return $box;
+ $box = phutil_tag(
+ 'div',
+ array(
+ 'style' => $box_style,
+ 'class' => 'mlt',
+ 'id' => $show_action_id,
+ ),
+ $box);
+
+ return array($own_question, $box);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 5, 12:24 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223190
Default Alt Text
D13957.diff (2 KB)
Attached To
Mode
D13957: Hide answer box if you asked the question in Ponder
Attached
Detach File
Event Timeline
Log In to Comment