1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 20:40:56 +01:00

kill differential tabs in favor of a create diff button

Summary:
kill the tabs and make it a create button instead.  pertinent notes:
* added a "Filter diffs" button to the form.  optional, but i thought it
necessary with the new green button
* linked to Arcanist user guide on the create diff page.  somewhat unrelated but
i think create diff will get more traffic now so linking to help seemed like a
reasonable add on here.

Test Plan:
viewed differential homepage
* clicked left hand filter elements.  noted "Create Diff" button on filters
within user revisions and no button on filters within all revisions.
* entered another user into Select User UI and viewed their diffs via button and
pressing enter

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, btrahan, epriestley

Differential Revision: 1157
This commit is contained in:
Bob Trahan 2011-12-01 16:05:54 -08:00
parent dc0d3f3fef
commit 519a443eba
5 changed files with 32 additions and 19 deletions

View file

@ -29,27 +29,11 @@ abstract class DifferentialController extends PhabricatorController {
$viewer_is_anonymous = !$this->getRequest()->getUser()->isLoggedIn(); $viewer_is_anonymous = !$this->getRequest()->getUser()->isLoggedIn();
$page = $this->buildStandardPageView(); $page = $this->buildStandardPageView();
$page->setApplicationName('Differential'); $page->setApplicationName('Differential');
$page->setBaseURI('/differential/'); $page->setBaseURI('/differential/');
$page->setTitle(idx($data, 'title')); $page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x9A\x99"); $page->setGlyph("\xE2\x9A\x99");
$page->appendChild($view); $page->appendChild($view);
$tabs = array(
'revisions' => array(
'name' => 'Revisions',
'href' => '/differential/',
)
);
if (!$viewer_is_anonymous) {
$tabs = array_merge($tabs, array(
'create' => array(
'name' => 'Create Diff',
'href' => '/differential/diff/create/',
)
));
}
$page->setTabs($tabs, idx($data, 'tab'));
$page->setIsLoggedOut($viewer_is_anonymous); $page->setIsLoggedOut($viewer_is_anonymous);
$response = new AphrontWebpageResponse(); $response = new AphrontWebpageResponse();

View file

@ -45,13 +45,22 @@ class DifferentialDiffCreateController extends DifferentialController {
} }
$form = new AphrontFormView(); $form = new AphrontFormView();
$arcanist_href = PhabricatorEnv::getDoclink(
'article/Arcanist_User_Guide.html');
$arcanist_link = phutil_render_tag(
'a',
array(
'href' => $arcanist_href,
'target' => '_blank',
),
'Arcanist');
$form $form
->setAction('/differential/diff/create/') ->setAction('/differential/diff/create/')
->setEncType('multipart/form-data') ->setEncType('multipart/form-data')
->setUser($request->getUser()) ->setUser($request->getUser())
->appendChild( ->appendChild(
'<p class="aphront-form-instructions">The best way to create a '. '<p class="aphront-form-instructions">The best way to create a '.
'Differential diff is by using <strong>Arcanist</strong>, but you '. "Differential diff is by using $arcanist_link, but you ".
'can also just paste a diff (e.g., from <tt>svn diff</tt> or '. 'can also just paste a diff (e.g., from <tt>svn diff</tt> or '.
'<tt>git diff</tt>) into this box or upload it as a file if you '. '<tt>git diff</tt>) into this box or upload it as a file if you '.
'really want.</p>') 'really want.</p>')

View file

@ -13,12 +13,14 @@ phutil_require_module('phabricator', 'applications/differential/constants/lintst
phutil_require_module('phabricator', 'applications/differential/controller/base'); phutil_require_module('phabricator', 'applications/differential/controller/base');
phutil_require_module('phabricator', 'applications/differential/storage/diff'); phutil_require_module('phabricator', 'applications/differential/storage/diff');
phutil_require_module('phabricator', 'applications/files/storage/file'); phutil_require_module('phabricator', 'applications/files/storage/file');
phutil_require_module('phabricator', 'infrastructure/env');
phutil_require_module('phabricator', 'view/form/base'); phutil_require_module('phabricator', 'view/form/base');
phutil_require_module('phabricator', 'view/form/control/file'); phutil_require_module('phabricator', 'view/form/control/file');
phutil_require_module('phabricator', 'view/form/control/submit'); phutil_require_module('phabricator', 'view/form/control/submit');
phutil_require_module('phabricator', 'view/form/control/textarea'); phutil_require_module('phabricator', 'view/form/control/textarea');
phutil_require_module('phabricator', 'view/layout/panel'); phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');

View file

@ -233,10 +233,26 @@ class DifferentialRevisionListController extends DifferentialController {
array( array(
$view_phid => $handles[$view_phid]->getFullName(), $view_phid => $handles[$view_phid]->getFullName(),
)) ))
->setLimit(1)); ->setLimit(1))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Filter Revisions'));
$filter_view = new AphrontListFilterView(); $filter_view = new AphrontListFilterView();
$filter_view->appendChild($filter_form); $filter_view->appendChild($filter_form);
$viewer_is_anonymous = !$this->getRequest()->getUser()->isLoggedIn();
if (!$viewer_is_anonymous) {
$create_uri = new PhutilURI('/differential/diff/create/');
$filter_view->addButton(
phutil_render_tag(
'a',
array(
'href' => (string)$create_uri,
'class' => 'green button',
),
'Create Revision'));
}
$side_nav->appendChild($filter_view); $side_nav->appendChild($filter_view);
} }

View file

@ -14,12 +14,14 @@ phutil_require_module('phabricator', 'applications/differential/view/revisionlis
phutil_require_module('phabricator', 'applications/phid/handle/data'); phutil_require_module('phabricator', 'applications/phid/handle/data');
phutil_require_module('phabricator', 'storage/queryfx'); phutil_require_module('phabricator', 'storage/queryfx');
phutil_require_module('phabricator', 'view/form/base'); phutil_require_module('phabricator', 'view/form/base');
phutil_require_module('phabricator', 'view/form/control/submit');
phutil_require_module('phabricator', 'view/form/control/tokenizer'); phutil_require_module('phabricator', 'view/form/control/tokenizer');
phutil_require_module('phabricator', 'view/layout/listfilter'); phutil_require_module('phabricator', 'view/layout/listfilter');
phutil_require_module('phabricator', 'view/layout/panel'); phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phabricator', 'view/layout/sidenav'); phutil_require_module('phabricator', 'view/layout/sidenav');
phutil_require_module('phutil', 'markup'); phutil_require_module('phutil', 'markup');
phutil_require_module('phutil', 'parser/uri');
phutil_require_module('phutil', 'utils'); phutil_require_module('phutil', 'utils');