mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 21:32:43 +01:00
Remove nonfunctional links from Differential inline comment previews
Summary: They currently have "Next", "Previous" and "Reply" links which don't work. Don't render these links. Test Plan: Looked at inline previews, didn't see any silly/nonfunctional links. Reviewed By: tuomaspelkonen Reviewers: aran, jungejason, tuomaspelkonen CC: aran, epriestley, tuomaspelkonen Differential Revision: 419
This commit is contained in:
parent
2521621074
commit
4d3ef5ee0b
2 changed files with 33 additions and 25 deletions
|
@ -53,6 +53,7 @@ class DifferentialInlineCommentPreviewController
|
||||||
$view->setMarkupEngine($engine);
|
$view->setMarkupEngine($engine);
|
||||||
$view->setHandles($handles);
|
$view->setHandles($handles);
|
||||||
$view->setEditable(false);
|
$view->setEditable(false);
|
||||||
|
$view->setPreview(true);
|
||||||
$views[] = $view->render();
|
$views[] = $view->render();
|
||||||
}
|
}
|
||||||
$views = implode("\n", $views);
|
$views = implode("\n", $views);
|
||||||
|
|
|
@ -24,6 +24,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
private $handles;
|
private $handles;
|
||||||
private $markupEngine;
|
private $markupEngine;
|
||||||
private $editable;
|
private $editable;
|
||||||
|
private $preview;
|
||||||
|
|
||||||
public function setInlineComment(DifferentialInlineComment $comment) {
|
public function setInlineComment(DifferentialInlineComment $comment) {
|
||||||
$this->inlineComment = $comment;
|
$this->inlineComment = $comment;
|
||||||
|
@ -55,6 +56,10 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setPreview($preview) {
|
||||||
|
$this->preview = $preview;
|
||||||
|
}
|
||||||
|
|
||||||
public function render() {
|
public function render() {
|
||||||
|
|
||||||
$inline = $this->inlineComment;
|
$inline = $this->inlineComment;
|
||||||
|
@ -83,6 +88,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
|
|
||||||
$links = array();
|
$links = array();
|
||||||
|
|
||||||
|
if (!$this->preview) {
|
||||||
$links[] = javelin_render_tag(
|
$links[] = javelin_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
@ -109,8 +115,9 @@ final class DifferentialInlineCommentView extends AphrontView {
|
||||||
'sigil' => 'differential-inline-reply',
|
'sigil' => 'differential-inline-reply',
|
||||||
),
|
),
|
||||||
'Reply');
|
'Reply');
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->editable) {
|
if ($this->editable && !$this->preview) {
|
||||||
$links[] = javelin_render_tag(
|
$links[] = javelin_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
|
|
Loading…
Reference in a new issue