mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 23:02:42 +01:00
Have Browse button in History actually work
Summary: Ref T12780. Makes the button do something useful, like link to the history at the right spot in the graph. Test Plan: Click on various browse buttons, get correct url. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T12780 Differential Revision: https://secure.phabricator.com/D18054
This commit is contained in:
parent
683647f1fb
commit
6295e37857
2 changed files with 16 additions and 10 deletions
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue