Add a contextual "scope" dropdown for searches

Summary: Add a "Search for ... in (document group)" thing that picks the current
scope based on the current application.

Test Plan: Conducted searches in several browsers.

Reviewers: btrahan, skrul

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T858

Differential Revision: https://secure.phabricator.com/D1610
This commit is contained in:
epriestley
2012-02-14 17:00:12 -08:00
parent 6e48bfcb0a
commit cd651001b6
16 changed files with 149 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +35,7 @@ abstract class DifferentialController extends PhabricatorController {
$page->setGlyph("\xE2\x9A\x99");
$page->appendChild($view);
$page->setIsLoggedOut($viewer_is_anonymous);
$page->setSearchDefaultScope(PhabricatorSearchScope::SCOPE_OPEN_REVISIONS);
$response = new AphrontWebpageResponse();
return $response->setContent($page->render());

View File

@@ -8,6 +8,7 @@
phutil_require_module('phabricator', 'aphront/response/webpage');
phutil_require_module('phabricator', 'applications/base/controller/base');
phutil_require_module('phabricator', 'applications/search/constants/scope');
phutil_require_module('phabricator', 'infrastructure/celerity/api');
phutil_require_module('phabricator', 'infrastructure/env');