diff --git a/src/applications/diffusion/view/DiffusionHistoryListView.php b/src/applications/diffusion/view/DiffusionHistoryListView.php index f72bffcbe6..50713695be 100644 --- a/src/applications/diffusion/view/DiffusionHistoryListView.php +++ b/src/applications/diffusion/view/DiffusionHistoryListView.php @@ -105,13 +105,14 @@ final class DiffusionHistoryListView extends DiffusionHistoryView { } } - $browse = $this->linkBrowse( + $browse_button = $this->linkBrowse( $history->getPath(), array( 'commit' => $history->getCommitIdentifier(), 'branch' => $drequest->getBranch(), 'type' => $history->getFileType(), - )); + ), + true); $differential_view = null; if ($show_revisions && $commit) { @@ -192,13 +193,6 @@ final class DiffusionHistoryListView extends DiffusionHistoryView { ->setColor(PHUITagView::COLOR_INDIGO) ->setSlimShady(true); - $browse_button = id(new PHUIButtonView()) - ->setText(pht('Browse')) - ->setIcon('fa-code') - ->setTag('a') - ->setColor(PHUIButtonView::SIMPLE) - ->appendChild($audit_view); - $item = id(new PHUIObjectItemView()) ->setHeader($commit_desc) ->setHref($commit_link) diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php index b615ce855c..1d89a9dbd7 100644 --- a/src/applications/diffusion/view/DiffusionView.php +++ b/src/applications/diffusion/view/DiffusionView.php @@ -58,7 +58,10 @@ abstract class DiffusionView extends AphrontView { id(new PHUIIconView())->setIcon('fa-history bluegrey')); } - final public function linkBrowse($path, array $details = array()) { + final public function linkBrowse( + $path, + array $details = array(), + $button = false) { require_celerity_resource('diffusion-icons-css'); Javelin::initBehavior('phabricator-tooltips'); @@ -111,6 +114,15 @@ abstract class DiffusionView extends AphrontView { ); } + if ($button) { + return id(new PHUIButtonView()) + ->setText(pht('Browse')) + ->setIcon('fa-code') + ->setHref($href) + ->setTag('a') + ->setButtonType(PHUIButtonView::BUTTONTYPE_SIMPLE); + } + return javelin_tag( 'a', array(