From e0bd67f77bc4c4add41e40d2389fd007015f6456 Mon Sep 17 00:00:00 2001 From: vrana Date: Tue, 13 Mar 2012 23:50:34 -0700 Subject: [PATCH] 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 --- .../file/DiffusionBrowseFileController.php | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php index 2b16b36683..6a32304c18 100644 --- a/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/file/DiffusionBrowseFileController.php @@ -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. - ''); + ' '. + $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('
'); // Build the content of the file.