From c8578b9fa8c6f90e105eb0f5ca427bcbb8ee8fe0 Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Mon, 30 Jul 2012 09:09:40 -0700 Subject: [PATCH] Add a link to repository tool if there are no configured repositories Summary: helping noobs help themselves Test Plan: set $rows = array() and verified the txt. also threw a false && for my isAdmin conditional to check the other txt Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T1086, T1360 Differential Revision: https://secure.phabricator.com/D3100 --- .../controller/DiffusionHomeController.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/applications/diffusion/controller/DiffusionHomeController.php b/src/applications/diffusion/controller/DiffusionHomeController.php index f15e5b9856..0872a42831 100644 --- a/src/applications/diffusion/controller/DiffusionHomeController.php +++ b/src/applications/diffusion/controller/DiffusionHomeController.php @@ -121,7 +121,24 @@ final class DiffusionHomeController extends DiffusionController { ); } + $repository_tool_uri = PhabricatorEnv::getProductionURI('/repository/'); + $repository_tool = phutil_render_tag('a', + array( + 'href' => $repository_tool_uri, + ), + 'repository tool'); + $no_repositories_txt = 'This instance of Phabricator does not have any '. + 'configured repositories. '; + if ($user->getIsAdmin()) { + $no_repositories_txt .= 'To setup one or more repositories, visit the '. + $repository_tool.'.'; + } else { + $no_repositories_txt .= 'Ask an administrator to setup one or more '. + 'repositories via the '.$repository_tool.'.'; + } + $table = new AphrontTableView($rows); + $table->setNoDataString($no_repositories_txt); $table->setHeaders( array( 'Repository',