mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Unmisplace edit button in Diffusion
Summary: It is misplaced from the beginning but it got worse after some CSS tweaks. I was also thinking about using the same DropdownMenu as in Differential but I don't feel strongly about it to do it myself. Test Plan: Display file in Diffusion. Repeat with disabled Editor. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1892
This commit is contained in:
parent
0553b32b37
commit
e0bd67f77b
1 changed files with 19 additions and 19 deletions
|
@ -84,6 +84,23 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
|||
|
||||
require_celerity_resource('diffusion-source-css');
|
||||
|
||||
$edit_button = '';
|
||||
$user = $request->getUser();
|
||||
if ($user) {
|
||||
$line = 1;
|
||||
$repository = $this->getDiffusionRequest()->getRepository();
|
||||
$editor_link = $user->loadEditorLink($path, $line, $repository);
|
||||
if ($editor_link) {
|
||||
$edit_button = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $editor_link,
|
||||
'class' => 'button',
|
||||
),
|
||||
'Edit');
|
||||
}
|
||||
}
|
||||
|
||||
$view_select_panel = new AphrontPanelView();
|
||||
$view_select_form = phutil_render_tag(
|
||||
'form',
|
||||
|
@ -93,27 +110,10 @@ final class DiffusionBrowseFileController extends DiffusionController {
|
|||
'class' => 'diffusion-browse-type-form',
|
||||
),
|
||||
$select.
|
||||
'<button>View</button>');
|
||||
' <button>View</button> '.
|
||||
$edit_button);
|
||||
$view_select_panel->appendChild($view_select_form);
|
||||
|
||||
$user = $request->getUser();
|
||||
if ($user) {
|
||||
$line = 1;
|
||||
$repository = $this->getDiffusionRequest()->getRepository();
|
||||
$editor_link = $user->loadEditorLink($path, $line, $repository);
|
||||
if ($editor_link) {
|
||||
$view_select_panel->addButton(
|
||||
phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
'href' => $editor_link,
|
||||
'class' => 'button',
|
||||
),
|
||||
'Edit'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$view_select_panel->appendChild('<div style="clear: both;"></div>');
|
||||
|
||||
// Build the content of the file.
|
||||
|
|
Loading…
Reference in a new issue