1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Make "Create Document" in Phriction use workflow

Summary:
My claims that this worked on D4183 were incorrect:

  - Make it work.
  - Then use it.
  - Also make cancel URI not cancel to the same page.

Test Plan: Clicked "Create Document", got a workflow on-page dialog instead of a page transition.

Reviewers: codeblock

Reviewed By: codeblock

CC: aran

Differential Revision: https://secure.phabricator.com/D4403
This commit is contained in:
epriestley 2013-01-11 11:58:31 -08:00
parent 368657a570
commit b73622b866
4 changed files with 8 additions and 2 deletions

View file

@ -53,6 +53,7 @@ abstract class PhrictionController extends PhabricatorController {
id(new PhabricatorMenuItemView())
->setName(pht('Create Document'))
->setHref('/phriction/new/')
->setWorkflow(true)
->setIcon('create'));
return $crumbs;

View file

@ -30,7 +30,7 @@ final class PhrictionNewController extends PhrictionController {
pht('Create a new document at')))
->appendChild($view)
->addSubmitButton(pht('Create'))
->addCancelButton($request->getRequestURI());
->addCancelButton('/w/');
return id(new AphrontDialogResponse())->setDialog($dialog);
}

View file

@ -37,11 +37,12 @@ final class PhabricatorCrumbsView extends AphrontView {
),
'');
}
$actions[] = phutil_render_tag(
$actions[] = javelin_render_tag(
'a',
array(
'href' => $action->getHref(),
'class' => 'phabricator-crumbs-action',
'sigil' => $action->getWorkflow() ? 'workflow' : null,
),
$icon.phutil_escape_html($action->getName()));
}

View file

@ -90,6 +90,10 @@ final class PhabricatorMenuItemView extends AphrontView {
return $this;
}
public function getWorkflow() {
return $this->workflow;
}
public function setSortOrder($order) {
$this->sortOrder = $order;
return $this;