Page MenuHomePhabricator

D18428.id44281.diff
No OneTemporary

D18428.id44281.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -75,7 +75,7 @@
'rsrc/css/application/diffusion/diffusion-readme.css' => '419dd5b6',
'rsrc/css/application/diffusion/diffusion-repository.css' => 'ee6f20ec',
'rsrc/css/application/diffusion/diffusion-source.css' => '750add59',
- 'rsrc/css/application/diffusion/diffusion.css' => '59f4ac67',
+ 'rsrc/css/application/diffusion/diffusion.css' => '8a6eb632',
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948',
'rsrc/css/application/flag/flag.css' => 'bba8f811',
@@ -570,7 +570,7 @@
'differential-revision-history-css' => '0e8eb855',
'differential-revision-list-css' => 'f3c47d33',
'differential-table-of-contents-css' => 'ae4b7a55',
- 'diffusion-css' => '59f4ac67',
+ 'diffusion-css' => '8a6eb632',
'diffusion-icons-css' => '0c15255e',
'diffusion-readme-css' => '419dd5b6',
'diffusion-repository-css' => 'ee6f20ec',
diff --git a/src/applications/diffusion/controller/DiffusionBrowseController.php b/src/applications/diffusion/controller/DiffusionBrowseController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseController.php
@@ -22,8 +22,7 @@
// list.
$grep = $request->getStr('grep');
- $find = $request->getStr('find');
- if (strlen($grep) || strlen($find)) {
+ if (strlen($grep)) {
return $this->browseSearch();
}
@@ -58,13 +57,15 @@
$drequest = $this->getDiffusionRequest();
$header = $this->buildHeaderView($drequest);
- $search_form = $this->renderSearchForm();
$search_results = $this->renderSearchResults();
+ $search_form = $this->renderSearchForm();
- $search_form = id(new PHUIObjectBoxView())
- ->setHeaderText(pht('Search'))
- ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->appendChild($search_form);
+ $search_form = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'diffusion-mobile-search-form',
+ ),
+ $search_form);
$crumbs = $this->buildCrumbs(
array(
@@ -329,8 +330,6 @@
$header = $this->buildHeaderView($drequest);
$header->setHeaderIcon('fa-folder-open');
- $search_form = $this->renderSearchForm();
-
$empty_result = null;
$browse_panel = null;
$branch_panel = null;
@@ -369,12 +368,6 @@
->setTable($browse_table)
->setPager($pager);
- $browse_panel->setShowHide(
- array(pht('Show Search')),
- pht('Hide Search'),
- $search_form,
- '#');
-
$path = $drequest->getPath();
$is_branch = (!strlen($path) && $repository->supportsBranchComparison());
if ($is_branch) {
@@ -1565,32 +1558,48 @@
protected function renderSearchForm() {
$drequest = $this->getDiffusionRequest();
-
- $forms = array();
- $form = id(new AphrontFormView())
- ->setUser($this->getViewer())
- ->setMethod('GET');
-
+ $viewer = $this->getViewer();
switch ($drequest->getRepository()->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:
- $forms[] = id(clone $form)
- ->appendChild(pht('Search is not available in Subversion.'));
- break;
- default:
- $forms[] = id(clone $form)
- ->appendChild(
- id(new AphrontFormTextWithSubmitControl())
- ->setLabel(pht('Pattern'))
- ->setSubmitLabel(pht('Grep File Content'))
- ->setName('grep')
- ->setValue($this->getRequest()->getStr('grep')));
- break;
+ return null;
}
+ $search_term = $this->getRequest()->getStr('grep');
require_celerity_resource('diffusion-icons-css');
- $form_box = phutil_tag_div('diffusion-search-boxen', $forms);
+ require_celerity_resource('diffusion-css');
+
+ $bar = javelin_tag(
+ 'input',
+ array(
+ 'type' => 'text',
+ 'id' => 'diffusion-search-input',
+ 'name' => 'grep',
+ 'class' => 'diffusion-search-input',
+ 'sigil' => 'diffusion-search-input',
+ 'placeholder' => pht('Pattern Search'),
+ 'value' => $search_term,
+ ));
+
+ $form = phabricator_form(
+ $viewer,
+ array(
+ 'method' => 'GET',
+ 'sigil' => 'diffusion-search-form',
+ 'class' => 'diffusion-search-form',
+ 'id' => 'diffusion-search-form',
+ ),
+ array(
+ $bar,
+ ));
+
+ $form_view = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'diffusion-search-form-view',
+ ),
+ $form);
- return $form_box;
+ return $form_view;
}
protected function markupText($text) {
@@ -1612,11 +1621,14 @@
$viewer = $this->getViewer();
$tag = $this->renderCommitHashTag($drequest);
+ $search = $this->renderSearchForm();
$header = id(new PHUIHeaderView())
->setUser($viewer)
->setHeader($this->renderPathLinks($drequest, $mode = 'browse'))
- ->addTag($tag);
+ ->addActionItem($search)
+ ->addTag($tag)
+ ->addClass('diffusion-browse-header');
return $header;
}
diff --git a/webroot/rsrc/css/application/diffusion/diffusion.css b/webroot/rsrc/css/application/diffusion/diffusion.css
--- a/webroot/rsrc/css/application/diffusion/diffusion.css
+++ b/webroot/rsrc/css/application/diffusion/diffusion.css
@@ -122,6 +122,40 @@
color: {$darkbluetext};
}
+/* - Search Input ------------------------------------------------------------*/
+
+.diffusion-search-form-view {
+ width: 240px;
+}
+
+.diffusion-search-form-view .diffusion-search-input {
+ width: 240px;
+ border-radius: 20px;
+ padding-left: 12px;
+}
+
+.device-phone .diffusion-browse-header .diffusion-search-form-view {
+ display: none;
+}
+
+.diffusion-mobile-search-form {
+ display: none;
+}
+
+.device-phone .diffusion-mobile-search-form {
+ display: block;
+}
+
+.device-phone .diffusion-search-form-view {
+ width: 100%;
+ margin-bottom: 20px;
+}
+
+.device-phone .diffusion-search-form-view .diffusion-search-input {
+ width: 100%;
+}
+
+
/* - Phone Style ------------------------------------------------------------*/
.device-phone.diffusion-history-view .phui-two-column-view

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 9:51 PM (24 m, 19 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6787079
Default Alt Text
D18428.id44281.diff (6 KB)

Event Timeline