Page MenuHomePhabricator

D8300.id.diff
No OneTemporary

D8300.id.diff

Index: src/applications/diffusion/controller/DiffusionBrowseFileController.php
===================================================================
--- src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -208,7 +208,7 @@
if (!$show_color) {
$style =
- "margin: 1em 2em; width: 90%; height: 80em; font-family: monospace";
+ "border: none; width: 100%; height: 80em; font-family: monospace";
if (!$show_blame) {
$corpus = phutil_tag(
'textarea',
@@ -301,13 +301,18 @@
),
$corpus_table);
- $corpus = id(new PHUIObjectBoxView())
- ->setHeaderText('File Contents')
- ->appendChild($corpus);
-
Javelin::initBehavior('load-blame', array('id' => $id));
}
+ $button = $this->createEditButton();
+ $header = id(new PHUIHeaderView())
+ ->setHeader(pht('File Contents'))
+ ->addActionLink($button);
+
+ $corpus = id(new PHUIObjectBoxView())
+ ->setHeader($header)
+ ->appendChild($corpus);
+
return $corpus;
}
@@ -349,7 +354,6 @@
->setUser($viewer)
->setRenderAsForm(true));
-
if ($show_color) {
$highlight_text = pht('Disable Highlighting');
$highlight_icon = 'highlight-grey';
@@ -406,12 +410,10 @@
->setIcon('file'));
}
- $view->addAction($this->createEditAction());
-
return $view;
}
- private function createEditAction() {
+ private function createEditButton() {
$request = $this->getRequest();
$user = $request->getUser();
@@ -424,14 +426,17 @@
$callsign = $repository->getCallsign();
$editor_link = $user->loadEditorLink($path, $line, $callsign);
- $action = id(new PhabricatorActionView())
- ->setName(pht('Open in Editor'))
- ->setIcon('edit');
-
- $action->setHref($editor_link);
- $action->setDisabled(!$editor_link);
-
- return $action;
+ $icon_edit = id(new PHUIIconView())
+ ->setSpriteSheet(PHUIIconView::SPRITE_ICONS)
+ ->setSpriteIcon('edit');
+ $button = id(new PHUIButtonView())
+ ->setTag('a')
+ ->setText(pht('Open in Editor'))
+ ->setHref($editor_link)
+ ->setIcon($icon_edit)
+ ->setDisabled(!$editor_link);
+
+ return $button;
}
private function buildDisplayRows(
Index: src/view/phui/PHUIButtonView.php
===================================================================
--- src/view/phui/PHUIButtonView.php
+++ src/view/phui/PHUIButtonView.php
@@ -20,6 +20,7 @@
private $icon;
private $href = null;
private $title = null;
+ private $disabled;
public function setText($text) {
$this->text = $text;
@@ -46,6 +47,11 @@
return $this;
}
+ public function setDisabled($disabled) {
+ $this->disabled = $disabled;
+ return $this;
+ }
+
public function setTag($tag) {
$this->tag = $tag;
return $this;
@@ -93,6 +99,10 @@
$classes[] = 'has-icon';
}
+ if ($this->disabled) {
+ $classes[] = 'disabled';
+ }
+
return array('class' => $classes,
'href' => $this->href,
'title' => $this->title);

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 8:42 PM (4 h, 3 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6805946
Default Alt Text
D8300.id.diff (3 KB)

Event Timeline