mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +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->setHandles($handles);
|
||||
$view->setEditable(false);
|
||||
$view->setPreview(true);
|
||||
$views[] = $view->render();
|
||||
}
|
||||
$views = implode("\n", $views);
|
||||
|
|
|
@ -24,6 +24,7 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
private $handles;
|
||||
private $markupEngine;
|
||||
private $editable;
|
||||
private $preview;
|
||||
|
||||
public function setInlineComment(DifferentialInlineComment $comment) {
|
||||
$this->inlineComment = $comment;
|
||||
|
@ -55,6 +56,10 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function setPreview($preview) {
|
||||
$this->preview = $preview;
|
||||
}
|
||||
|
||||
public function render() {
|
||||
|
||||
$inline = $this->inlineComment;
|
||||
|
@ -83,34 +88,36 @@ final class DifferentialInlineCommentView extends AphrontView {
|
|||
|
||||
$links = array();
|
||||
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-prev',
|
||||
),
|
||||
'Previous');
|
||||
if (!$this->preview) {
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-prev',
|
||||
),
|
||||
'Previous');
|
||||
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-next',
|
||||
),
|
||||
'Next');
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-next',
|
||||
),
|
||||
'Next');
|
||||
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-reply',
|
||||
),
|
||||
'Reply');
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => '#',
|
||||
'mustcapture' => true,
|
||||
'sigil' => 'differential-inline-reply',
|
||||
),
|
||||
'Reply');
|
||||
}
|
||||
|
||||
if ($this->editable) {
|
||||
if ($this->editable && !$this->preview) {
|
||||
$links[] = javelin_render_tag(
|
||||
'a',
|
||||
array(
|
||||
|
|
Loading…
Reference in a new issue