1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Update Herald edit/transcripts to modern UI

Summary: Walks through various object, rule, create forms and transcripts in Herald. Slightly nicer looking.

Test Plan: Make rules, see rules, edit rules, see transcripts.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D15559
This commit is contained in:
Chad Little 2016-04-01 14:14:25 +00:00 committed by chad
parent a22d37f447
commit c40f6e63ca
6 changed files with 59 additions and 31 deletions

View file

@ -7,7 +7,7 @@
*/ */
return array( return array(
'names' => array( 'names' => array(
'core.pkg.css' => '26886078', 'core.pkg.css' => '2d0339fc',
'core.pkg.js' => 'e5484f37', 'core.pkg.js' => 'e5484f37',
'darkconsole.pkg.js' => 'e7393ebb', 'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => '7ba78475', 'differential.pkg.css' => '7ba78475',
@ -133,7 +133,7 @@ return array(
'rsrc/css/phui/phui-document.css' => '9c71d2bf', 'rsrc/css/phui/phui-document.css' => '9c71d2bf',
'rsrc/css/phui/phui-feed-story.css' => '04aec08f', 'rsrc/css/phui/phui-feed-story.css' => '04aec08f',
'rsrc/css/phui/phui-fontkit.css' => '9cda225e', 'rsrc/css/phui/phui-fontkit.css' => '9cda225e',
'rsrc/css/phui/phui-form-view.css' => '4a1a0f5e', 'rsrc/css/phui/phui-form-view.css' => '6a51768e',
'rsrc/css/phui/phui-form.css' => 'aac1d51d', 'rsrc/css/phui/phui-form.css' => 'aac1d51d',
'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f', 'rsrc/css/phui/phui-head-thing.css' => 'fd311e5f',
'rsrc/css/phui/phui-header-view.css' => '230254d3', 'rsrc/css/phui/phui-header-view.css' => '230254d3',
@ -821,7 +821,7 @@ return array(
'phui-font-icon-base-css' => '6449bce8', 'phui-font-icon-base-css' => '6449bce8',
'phui-fontkit-css' => '9cda225e', 'phui-fontkit-css' => '9cda225e',
'phui-form-css' => 'aac1d51d', 'phui-form-css' => 'aac1d51d',
'phui-form-view-css' => '4a1a0f5e', 'phui-form-view-css' => '6a51768e',
'phui-head-thing-view-css' => 'fd311e5f', 'phui-head-thing-view-css' => 'fd311e5f',
'phui-header-view-css' => '230254d3', 'phui-header-view-css' => '230254d3',
'phui-hovercard' => '1bd28176', 'phui-hovercard' => '1bd28176',

View file

@ -114,6 +114,7 @@ final class HeraldNewController extends HeraldController {
$cancel_text = null; $cancel_text = null;
$cancel_uri = $this->getApplicationURI(); $cancel_uri = $this->getApplicationURI();
$title = pht('Create Herald Rule');
break; break;
case 1: case 1:
$rule_types = $this->renderRuleTypeControl( $rule_types = $this->renderRuleTypeControl(
@ -123,14 +124,6 @@ final class HeraldNewController extends HeraldController {
$form $form
->addHiddenInput('content_type', $content_type) ->addHiddenInput('content_type', $content_type)
->addHiddenInput('step', 2) ->addHiddenInput('step', 2)
->appendChild(
id(new AphrontFormStaticControl())
->setLabel(pht('Rule for'))
->setValue(
phutil_tag(
'strong',
array(),
idx($content_type_map, $content_type))))
->appendChild($rule_types); ->appendChild($rule_types);
$cancel_text = pht('Back'); $cancel_text = pht('Back');
@ -141,6 +134,8 @@ final class HeraldNewController extends HeraldController {
'step' => 0, 'step' => 0,
)); ));
$cancel_uri = $this->getApplicationURI($cancel_uri); $cancel_uri = $this->getApplicationURI($cancel_uri);
$title = pht('Create Herald Rule: %s',
idx($content_type_map, $content_type));
break; break;
case 2: case 2:
$adapter = HeraldAdapter::getAdapterForContentType($content_type); $adapter = HeraldAdapter::getAdapterForContentType($content_type);
@ -187,10 +182,11 @@ final class HeraldNewController extends HeraldController {
'step' => 1, 'step' => 1,
)); ));
$cancel_uri = $this->getApplicationURI($cancel_uri); $cancel_uri = $this->getApplicationURI($cancel_uri);
$title = pht('Create Herald Rule: %s',
idx($content_type_map, $content_type));
break; break;
} }
$form $form
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
@ -199,21 +195,28 @@ final class HeraldNewController extends HeraldController {
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setFormErrors($errors) ->setFormErrors($errors)
->setHeaderText(pht('Create Herald Rule')) ->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setForm($form); ->setForm($form);
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs() ->buildApplicationCrumbs()
->addTextCrumb(pht('Create Rule')); ->addTextCrumb(pht('Create Rule'))
->setBorder(true);
$title = pht('Create Herald Rule'); $header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-plus-square');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($form_box);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$form_box, $view,
)); ));
} }

View file

@ -235,26 +235,34 @@ final class HeraldRuleController extends HeraldController {
$this->setupEditorBehavior($rule, $handles, $adapter); $this->setupEditorBehavior($rule, $handles, $adapter);
$title = $rule->getID() $title = $rule->getID()
? pht('Edit Herald Rule') ? pht('Edit Herald Rule: %s', $rule->getName())
: pht('Create Herald Rule'); : pht('Create Herald Rule: %s', idx($content_type_map, $content_type));
$icon = $rule->getID() ? 'fa-pencil' : 'fa-plus-square';
$form_box = id(new PHUIObjectBoxView()) $form_box = id(new PHUIObjectBoxView())
->setHeaderText($title)
->setFormErrors($errors) ->setFormErrors($errors)
->setForm($form); ->setForm($form);
$crumbs = $this $crumbs = $this
->buildApplicationCrumbs() ->buildApplicationCrumbs()
->addTextCrumb($title); ->addTextCrumb($title)
->setBorder(true);
$title = pht('Edit Rule'); $header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-plus-square');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($form_box);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$form_box, $view,
)); ));
} }

View file

@ -98,21 +98,29 @@ final class HeraldTestConsoleController extends HeraldController {
->setValue(pht('Test Rules'))); ->setValue(pht('Test Rules')));
$box = id(new PHUIObjectBoxView()) $box = id(new PHUIObjectBoxView())
->setHeaderText(pht('Herald Test Console'))
->setFormErrors($errors) ->setFormErrors($errors)
->setForm($form); ->setForm($form);
$crumbs = id($this->buildApplicationCrumbs()) $crumbs = id($this->buildApplicationCrumbs())
->addTextCrumb(pht('Test Console')); ->addTextCrumb(pht('Test Console'))
->setBorder(true);
$title = pht('Test Console'); $title = pht('Test Console');
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-desktop');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($box);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$box, $view,
)); ));
} }

View file

@ -79,16 +79,25 @@ final class HeraldTranscriptController extends HeraldController {
->addTextCrumb( ->addTextCrumb(
pht('Transcripts'), pht('Transcripts'),
$this->getApplicationURI('/transcript/')) $this->getApplicationURI('/transcript/'))
->addTextCrumb($xscript->getID()); ->addTextCrumb($xscript->getID())
->setBorder(true);
$title = pht('Transcript'); $title = pht('Transcript: %s', $xscript->getID());
$header = id(new PHUIHeaderView())
->setHeader($title)
->setHeaderIcon('fa-file');
$view = id(new PHUITwoColumnView())
->setHeader($header)
->setFooter($content);
return $this->newPage() return $this->newPage()
->setTitle($title) ->setTitle($title)
->setCrumbs($crumbs) ->setCrumbs($crumbs)
->appendChild( ->appendChild(
array( array(
$content, $view,
)); ));
} }
@ -232,7 +241,8 @@ final class HeraldTranscriptController extends HeraldController {
$action_map = mgroup($action_map, 'getRuleID'); $action_map = mgroup($action_map, 'getRuleID');
$rule_list = id(new PHUIObjectItemListView()) $rule_list = id(new PHUIObjectItemListView())
->setNoDataString(pht('No Herald rules applied to this object.')); ->setNoDataString(pht('No Herald rules applied to this object.'))
->setFlush(true);
$rule_xscripts = $xscript->getRuleTranscripts(); $rule_xscripts = $xscript->getRuleTranscripts();
$rule_xscripts = msort($rule_xscripts, 'getRuleID'); $rule_xscripts = msort($rule_xscripts, 'getRuleID');

View file

@ -263,11 +263,10 @@ table.aphront-form-control-checkbox-layout th {
} }
.phui-form-inset { .phui-form-inset {
margin: 4px 0 8px; margin: 12px 0;
padding: 8px; padding: 8px;
background: #f7f9fd; background: #f7f9fd;
border: 1px solid {$lightblueborder}; border: 1px solid {$lightblueborder};
border-bottom: 1px solid {$blueborder};
border-radius: 3px; border-radius: 3px;
} }