1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 19:31:02 +01:00

pht, panels and mobile for metamta

Summary: Added phts, tested forms on mobile.

Test Plan: Review each page in Chrome and iOS.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4702
This commit is contained in:
Chad Little 2013-01-28 10:48:01 -08:00
parent 116537eb19
commit 5dc48c2b4a
9 changed files with 83 additions and 72 deletions

View file

@ -29,8 +29,9 @@ final class DifferentialBlameRevisionFieldSpecification
public function renderEditControl() { public function renderEditControl() {
return id(new AphrontFormTextControl()) return id(new AphrontFormTextControl())
->setLabel('Blame Revision') ->setLabel(pht('Blame Revision'))
->setCaption('Revision which broke the stuff which this change fixes.') ->setCaption(
pht('Revision which broke the stuff which this change fixes.'))
->setName($this->getStorageKey()) ->setName($this->getStorageKey())
->setValue($this->value); ->setValue($this->value);
} }
@ -40,7 +41,7 @@ final class DifferentialBlameRevisionFieldSpecification
} }
public function renderLabelForRevisionView() { public function renderLabelForRevisionView() {
return 'Blame Revision:'; return pht('Blame Revision:');
} }
public function renderValueForRevisionView() { public function renderValueForRevisionView() {

View file

@ -7,7 +7,7 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication {
} }
public function getShortDescription() { public function getShortDescription() {
return 'View Mail Logs'; return pht('View Mail Logs');
} }
public function getIconName() { public function getIconName() {

View file

@ -10,14 +10,14 @@ abstract class PhabricatorMetaMTAController extends PhabricatorController {
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Mail Logs'); $nav->addLabel(pht('Mail Logs'));
$nav->addFilter('sent', 'Sent Mail', $this->getApplicationURI()); $nav->addFilter('sent', pht('Sent Mail'), $this->getApplicationURI());
$nav->addFilter('received', 'Received Mail'); $nav->addFilter('received', pht('Received Mail'));
if ($this->getRequest()->getUser()->getIsAdmin()) { if ($this->getRequest()->getUser()->getIsAdmin()) {
$nav->addLabel('Diagnostics'); $nav->addLabel(pht('Diagnostics'));
$nav->addFilter('send', 'Send Test'); $nav->addFilter('send', pht('Send Test'));
$nav->addFilter('receive', 'Receive Test'); $nav->addFilter('receive', pht('Receive Test'));
} }
return $nav; return $nav;

View file

@ -74,19 +74,19 @@ final class PhabricatorMetaMTAListController
'class' => 'button small grey', 'class' => 'button small grey',
'href' => $this->getApplicationURI('/view/'.$mail->getID().'/'), 'href' => $this->getApplicationURI('/view/'.$mail->getID().'/'),
), ),
'View'), pht('View')),
); );
} }
$table = new AphrontTableView($rows); $table = new AphrontTableView($rows);
$table->setHeaders( $table->setHeaders(
array( array(
'Status', pht('Status'),
'Retry', pht('Retry'),
'Next', pht('Next'),
'Created', pht('Created'),
'Updated', pht('Updated'),
'Subject', pht('Subject'),
'', '',
)); ));
$table->setColumnClasses( $table->setColumnClasses(
@ -103,8 +103,9 @@ final class PhabricatorMetaMTAListController
// Render the whole page. // Render the whole page.
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->appendChild($table); $panel->appendChild($table);
$panel->setHeader('MetaMTA Messages'); $panel->setHeader(pht('MetaMTA Messages'));
$panel->appendChild($pager); $panel->appendChild($pager);
$panel->setNoBackground();
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter('sent'); $nav->selectFilter('sent');
@ -113,7 +114,8 @@ final class PhabricatorMetaMTAListController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Sent Mail', 'title' => pht('Sent Mail'),
'device' => true,
)); ));
} }
} }

View file

@ -12,7 +12,7 @@ final class PhabricatorMetaMTAReceiveController
$receiver = PhabricatorMetaMTAReceivedMail::loadReceiverObject( $receiver = PhabricatorMetaMTAReceivedMail::loadReceiverObject(
$request->getStr('obj')); $request->getStr('obj'));
if (!$receiver) { if (!$receiver) {
throw new Exception("No such task or revision!"); throw new Exception(pht("No such task or revision!"));
} }
$hash = PhabricatorMetaMTAReceivedMail::computeMailHash( $hash = PhabricatorMetaMTAReceivedMail::computeMailHash(
@ -50,25 +50,26 @@ final class PhabricatorMetaMTAReceiveController
$form->setAction($this->getApplicationURI('/receive/')); $form->setAction($this->getApplicationURI('/receive/'));
$form $form
->appendChild( ->appendChild(
'<p class="aphront-form-instructions">This form will simulate '. '<p class="aphront-form-instructions">'.
'sending mail to an object.</p>') pht('This form will simulate sending mail to an object.').
'</p>')
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('To') ->setLabel(pht('To'))
->setName('obj') ->setName('obj')
->setCaption('e.g. <tt>D1234</tt> or <tt>T1234</tt>')) ->setCaption(pht('e.g. <tt>D1234</tt> or <tt>T1234</tt>')))
->appendChild( ->appendChild(
id(new AphrontFormTextAreaControl()) id(new AphrontFormTextAreaControl())
->setLabel('Body') ->setLabel(pht('Body'))
->setName('body')) ->setName('body'))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Receive Mail')); ->setValue(pht('Receive Mail')));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Receive Email'); $panel->setHeader(pht('Receive Email'));
$panel->appendChild($form); $panel->appendChild($form);
$panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->setNoBackground();
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter('receive'); $nav->selectFilter('receive');
@ -77,7 +78,8 @@ final class PhabricatorMetaMTAReceiveController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Receive Test', 'title' => pht('Receive Test'),
'device' => true,
)); ));
} }

View file

@ -45,12 +45,12 @@ final class PhabricatorMetaMTAReceivedListController
$table = new AphrontTableView($rows); $table = new AphrontTableView($rows);
$table->setHeaders( $table->setHeaders(
array( array(
'ID', pht('ID'),
'Date', pht('Date'),
'Time', pht('Time'),
'Author', pht('Author'),
'Object', pht('Object'),
'Message', pht('Message'),
)); ));
$table->setColumnClasses( $table->setColumnClasses(
array( array(
@ -63,9 +63,10 @@ final class PhabricatorMetaMTAReceivedListController
)); ));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Received Mail'); $panel->setHeader(pht('Received Mail'));
$panel->appendChild($table); $panel->appendChild($table);
$panel->appendChild($pager); $panel->appendChild($pager);
$panel->setNoBackground();
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter('received'); $nav->selectFilter('received');
@ -74,7 +75,8 @@ final class PhabricatorMetaMTAReceivedListController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Received Mail', 'title' => pht('Received Mail'),
'device' => true,
)); ));
} }
} }

View file

@ -42,8 +42,8 @@ final class PhabricatorMetaMTASendController
} }
$failure_caption = $failure_caption =
"Enter a number to simulate that many consecutive send failures before ". pht("Enter a number to simulate that many consecutive send failures ".
"really attempting to deliver via the underlying MTA."; "brefore really attempting to deliver via the underlying MTA.");
$doclink_href = PhabricatorEnv::getDoclink( $doclink_href = PhabricatorEnv::getDoclink(
'article/Configuring_Outbound_Email.html'); 'article/Configuring_Outbound_Email.html');
@ -54,11 +54,12 @@ final class PhabricatorMetaMTASendController
'href' => $doclink_href, 'href' => $doclink_href,
'target' => '_blank', 'target' => '_blank',
), ),
'Configuring Outbound Email'); pht('Configuring Outbound Email'));
$instructions = $instructions =
'<p class="aphront-form-instructions">This form will send a normal '. '<p class="aphront-form-instructions">'.
'email using the settings you have configured for Phabricator. For more '. pht('This form will send a normal email using the settings you have '.
'information, see '.$doclink.'.</p>'; 'configured for Phabricator. For more information, see %s.', $doclink).
'</p>';
$adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter'); $adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter');
$warning = null; $warning = null;
@ -67,11 +68,11 @@ final class PhabricatorMetaMTASendController
$warning->setTitle('Email is Disabled'); $warning->setTitle('Email is Disabled');
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->appendChild( $warning->appendChild(
'<p>This installation of Phabricator is currently set to use '. '<p>'.pht('This installation of Phabricator is currently set to use '.
'<tt>PhabricatorMailImplementationTestAdapter</tt> to deliver '. '<tt>PhabricatorMailImplementationTestAdapter</tt> to deliver '.
'outbound email. This completely disables outbound email! All '. 'outbound email. This completely disables outbound email! All '.
'outbound email will be thrown in a deep, dark hole until you '. 'outbound email will be thrown in a deep, dark hole until you '.
'configure a real adapter.</p>'); 'configure a real adapter.').'</p>');
} }
$phdlink_href = PhabricatorEnv::getDoclink( $phdlink_href = PhabricatorEnv::getDoclink(
@ -91,49 +92,49 @@ final class PhabricatorMetaMTASendController
->appendChild($instructions) ->appendChild($instructions)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Adapter') ->setLabel(pht('Adapter'))
->setValue($adapter)) ->setValue($adapter))
->appendChild( ->appendChild(
id(new AphrontFormTokenizerControl()) id(new AphrontFormTokenizerControl())
->setLabel('To') ->setLabel(pht('To'))
->setName('to') ->setName('to')
->setDatasource('/typeahead/common/mailable/')) ->setDatasource('/typeahead/common/mailable/'))
->appendChild( ->appendChild(
id(new AphrontFormTokenizerControl()) id(new AphrontFormTokenizerControl())
->setLabel('CC') ->setLabel(pht('CC'))
->setName('cc') ->setName('cc')
->setDatasource('/typeahead/common/mailable/')) ->setDatasource('/typeahead/common/mailable/'))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Subject') ->setLabel(pht('Subject'))
->setName('subject')) ->setName('subject'))
->appendChild( ->appendChild(
id(new AphrontFormTextAreaControl()) id(new AphrontFormTextAreaControl())
->setLabel('Body') ->setLabel(pht('Body'))
->setName('body')) ->setName('body'))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Mail Tags') ->setLabel(pht('Mail Tags'))
->setName('mailtags') ->setName('mailtags')
->setCaption( ->setCaption(
'Example: <tt>differential-cc, differential-comment</tt>')) pht('Example:').' <tt>differential-cc, differential-comment</tt>'))
->appendChild( ->appendChild(
id(new AphrontFormDragAndDropUploadControl()) id(new AphrontFormDragAndDropUploadControl())
->setLabel('Attach Files') ->setLabel(pht('Attach Files'))
->setName('files') ->setName('files')
->setActivatedClass('aphront-panel-view-drag-and-drop')) ->setActivatedClass('aphront-panel-view-drag-and-drop'))
->appendChild( ->appendChild(
id(new AphrontFormTextControl()) id(new AphrontFormTextControl())
->setLabel('Simulate Failures') ->setLabel(pht('Simulate Failures'))
->setName('failures') ->setName('failures')
->setCaption($failure_caption)) ->setCaption($failure_caption))
->appendChild( ->appendChild(
id(new AphrontFormCheckboxControl()) id(new AphrontFormCheckboxControl())
->setLabel('HTML') ->setLabel(pht('HTML'))
->addCheckbox('html', '1', 'Send as HTML email.')) ->addCheckbox('html', '1', 'Send as HTML email.'))
->appendChild( ->appendChild(
id(new AphrontFormCheckboxControl()) id(new AphrontFormCheckboxControl())
->setLabel('Bulk') ->setLabel(pht('Bulk'))
->addCheckbox('bulk', '1', 'Send with bulk email headers.')) ->addCheckbox('bulk', '1', 'Send with bulk email headers.'))
->appendChild( ->appendChild(
id(new AphrontFormCheckboxControl()) id(new AphrontFormCheckboxControl())
@ -141,18 +142,18 @@ final class PhabricatorMetaMTASendController
->addCheckbox( ->addCheckbox(
'immediately', 'immediately',
'1', '1',
'Send immediately. (Do not enqueue for daemons.)', pht('Send immediately. (Do not enqueue for daemons.)'),
PhabricatorEnv::getEnvConfig('metamta.send-immediately')) PhabricatorEnv::getEnvConfig('metamta.send-immediately'))
->setCaption('Daemons can be started with '.$phdlink.'.') ->setCaption(pht('Daemons can be started with %s.', $phdlink))
) )
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->setValue('Send Mail')); ->setValue(pht('Send Mail')));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Send Email'); $panel->setHeader(pht('Send Email'));
$panel->appendChild($form); $panel->appendChild($form);
$panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->setNoBackground();
$nav = $this->buildSideNavView(); $nav = $this->buildSideNavView();
$nav->selectFilter('send'); $nav->selectFilter('send');
@ -165,7 +166,8 @@ final class PhabricatorMetaMTASendController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Send Test', 'title' => pht('Send Test'),
'device' => true,
)); ));
} }

View file

@ -61,7 +61,7 @@ final class PhabricatorMetaMTASendGridReceiveController
$received->processReceivedMail(); $received->processReceivedMail();
$response = new AphrontWebpageResponse(); $response = new AphrontWebpageResponse();
$response->setContent("Got it! Thanks, SendGrid!\n"); $response->setContent(pht("Got it! Thanks, SendGrid!\n"));
return $response; return $response;
} }

View file

@ -26,41 +26,43 @@ final class PhabricatorMetaMTAViewController
$form $form
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Subject') ->setLabel(pht('Subject'))
->setValue($mail->getSubject())) ->setValue($mail->getSubject()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Created') ->setLabel(pht('Created'))
->setValue(phabricator_datetime($mail->getDateCreated(), $user))) ->setValue(phabricator_datetime($mail->getDateCreated(), $user)))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Status') ->setLabel(pht('Status'))
->setValue($status)) ->setValue($status))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Retry Count') ->setLabel(pht('Retry Count'))
->setValue($mail->getRetryCount())) ->setValue($mail->getRetryCount()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Message') ->setLabel(pht('Message'))
->setValue($mail->getMessage())) ->setValue($mail->getMessage()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Related PHID') ->setLabel(pht('Related PHID'))
->setValue($mail->getRelatedPHID())) ->setValue($mail->getRelatedPHID()))
->appendChild( ->appendChild(
id(new AphrontFormSubmitControl()) id(new AphrontFormSubmitControl())
->addCancelButton($this->getApplicationURI(), 'Done')); ->addCancelButton($this->getApplicationURI(), pht('Done')));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('View Email'); $panel->setHeader(pht('View Email'));
$panel->appendChild($form); $panel->appendChild($form);
$panel->setWidth(AphrontPanelView::WIDTH_WIDE); $panel->setWidth(AphrontPanelView::WIDTH_WIDE);
$panel->setNoBackground();
return $this->buildApplicationPage( return $this->buildApplicationPage(
$panel, $panel,
array( array(
'title' => 'View Mail', 'title' => pht('View Mail'),
'device' => true,
)); ));
} }