mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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:
parent
116537eb19
commit
5dc48c2b4a
9 changed files with 83 additions and 72 deletions
|
@ -29,8 +29,9 @@ final class DifferentialBlameRevisionFieldSpecification
|
|||
|
||||
public function renderEditControl() {
|
||||
return id(new AphrontFormTextControl())
|
||||
->setLabel('Blame Revision')
|
||||
->setCaption('Revision which broke the stuff which this change fixes.')
|
||||
->setLabel(pht('Blame Revision'))
|
||||
->setCaption(
|
||||
pht('Revision which broke the stuff which this change fixes.'))
|
||||
->setName($this->getStorageKey())
|
||||
->setValue($this->value);
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ final class DifferentialBlameRevisionFieldSpecification
|
|||
}
|
||||
|
||||
public function renderLabelForRevisionView() {
|
||||
return 'Blame Revision:';
|
||||
return pht('Blame Revision:');
|
||||
}
|
||||
|
||||
public function renderValueForRevisionView() {
|
||||
|
|
|
@ -7,7 +7,7 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication {
|
|||
}
|
||||
|
||||
public function getShortDescription() {
|
||||
return 'View Mail Logs';
|
||||
return pht('View Mail Logs');
|
||||
}
|
||||
|
||||
public function getIconName() {
|
||||
|
|
|
@ -10,14 +10,14 @@ abstract class PhabricatorMetaMTAController extends PhabricatorController {
|
|||
$nav = new AphrontSideNavFilterView();
|
||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
|
||||
|
||||
$nav->addLabel('Mail Logs');
|
||||
$nav->addFilter('sent', 'Sent Mail', $this->getApplicationURI());
|
||||
$nav->addFilter('received', 'Received Mail');
|
||||
$nav->addLabel(pht('Mail Logs'));
|
||||
$nav->addFilter('sent', pht('Sent Mail'), $this->getApplicationURI());
|
||||
$nav->addFilter('received', pht('Received Mail'));
|
||||
|
||||
if ($this->getRequest()->getUser()->getIsAdmin()) {
|
||||
$nav->addLabel('Diagnostics');
|
||||
$nav->addFilter('send', 'Send Test');
|
||||
$nav->addFilter('receive', 'Receive Test');
|
||||
$nav->addLabel(pht('Diagnostics'));
|
||||
$nav->addFilter('send', pht('Send Test'));
|
||||
$nav->addFilter('receive', pht('Receive Test'));
|
||||
}
|
||||
|
||||
return $nav;
|
||||
|
|
|
@ -74,19 +74,19 @@ final class PhabricatorMetaMTAListController
|
|||
'class' => 'button small grey',
|
||||
'href' => $this->getApplicationURI('/view/'.$mail->getID().'/'),
|
||||
),
|
||||
'View'),
|
||||
pht('View')),
|
||||
);
|
||||
}
|
||||
|
||||
$table = new AphrontTableView($rows);
|
||||
$table->setHeaders(
|
||||
array(
|
||||
'Status',
|
||||
'Retry',
|
||||
'Next',
|
||||
'Created',
|
||||
'Updated',
|
||||
'Subject',
|
||||
pht('Status'),
|
||||
pht('Retry'),
|
||||
pht('Next'),
|
||||
pht('Created'),
|
||||
pht('Updated'),
|
||||
pht('Subject'),
|
||||
'',
|
||||
));
|
||||
$table->setColumnClasses(
|
||||
|
@ -103,8 +103,9 @@ final class PhabricatorMetaMTAListController
|
|||
// Render the whole page.
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->appendChild($table);
|
||||
$panel->setHeader('MetaMTA Messages');
|
||||
$panel->setHeader(pht('MetaMTA Messages'));
|
||||
$panel->appendChild($pager);
|
||||
$panel->setNoBackground();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('sent');
|
||||
|
@ -113,7 +114,8 @@ final class PhabricatorMetaMTAListController
|
|||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'Sent Mail',
|
||||
'title' => pht('Sent Mail'),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ final class PhabricatorMetaMTAReceiveController
|
|||
$receiver = PhabricatorMetaMTAReceivedMail::loadReceiverObject(
|
||||
$request->getStr('obj'));
|
||||
if (!$receiver) {
|
||||
throw new Exception("No such task or revision!");
|
||||
throw new Exception(pht("No such task or revision!"));
|
||||
}
|
||||
|
||||
$hash = PhabricatorMetaMTAReceivedMail::computeMailHash(
|
||||
|
@ -50,25 +50,26 @@ final class PhabricatorMetaMTAReceiveController
|
|||
$form->setAction($this->getApplicationURI('/receive/'));
|
||||
$form
|
||||
->appendChild(
|
||||
'<p class="aphront-form-instructions">This form will simulate '.
|
||||
'sending mail to an object.</p>')
|
||||
'<p class="aphront-form-instructions">'.
|
||||
pht('This form will simulate sending mail to an object.').
|
||||
'</p>')
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('To')
|
||||
->setLabel(pht('To'))
|
||||
->setName('obj')
|
||||
->setCaption('e.g. <tt>D1234</tt> or <tt>T1234</tt>'))
|
||||
->setCaption(pht('e.g. <tt>D1234</tt> or <tt>T1234</tt>')))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextAreaControl())
|
||||
->setLabel('Body')
|
||||
->setLabel(pht('Body'))
|
||||
->setName('body'))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Receive Mail'));
|
||||
->setValue(pht('Receive Mail')));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Receive Email');
|
||||
$panel->setHeader(pht('Receive Email'));
|
||||
$panel->appendChild($form);
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||
$panel->setNoBackground();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('receive');
|
||||
|
@ -77,7 +78,8 @@ final class PhabricatorMetaMTAReceiveController
|
|||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'Receive Test',
|
||||
'title' => pht('Receive Test'),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -45,12 +45,12 @@ final class PhabricatorMetaMTAReceivedListController
|
|||
$table = new AphrontTableView($rows);
|
||||
$table->setHeaders(
|
||||
array(
|
||||
'ID',
|
||||
'Date',
|
||||
'Time',
|
||||
'Author',
|
||||
'Object',
|
||||
'Message',
|
||||
pht('ID'),
|
||||
pht('Date'),
|
||||
pht('Time'),
|
||||
pht('Author'),
|
||||
pht('Object'),
|
||||
pht('Message'),
|
||||
));
|
||||
$table->setColumnClasses(
|
||||
array(
|
||||
|
@ -63,9 +63,10 @@ final class PhabricatorMetaMTAReceivedListController
|
|||
));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Received Mail');
|
||||
$panel->setHeader(pht('Received Mail'));
|
||||
$panel->appendChild($table);
|
||||
$panel->appendChild($pager);
|
||||
$panel->setNoBackground();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('received');
|
||||
|
@ -74,7 +75,8 @@ final class PhabricatorMetaMTAReceivedListController
|
|||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'Received Mail',
|
||||
'title' => pht('Received Mail'),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,8 +42,8 @@ final class PhabricatorMetaMTASendController
|
|||
}
|
||||
|
||||
$failure_caption =
|
||||
"Enter a number to simulate that many consecutive send failures before ".
|
||||
"really attempting to deliver via the underlying MTA.";
|
||||
pht("Enter a number to simulate that many consecutive send failures ".
|
||||
"brefore really attempting to deliver via the underlying MTA.");
|
||||
|
||||
$doclink_href = PhabricatorEnv::getDoclink(
|
||||
'article/Configuring_Outbound_Email.html');
|
||||
|
@ -54,11 +54,12 @@ final class PhabricatorMetaMTASendController
|
|||
'href' => $doclink_href,
|
||||
'target' => '_blank',
|
||||
),
|
||||
'Configuring Outbound Email');
|
||||
pht('Configuring Outbound Email'));
|
||||
$instructions =
|
||||
'<p class="aphront-form-instructions">This form will send a normal '.
|
||||
'email using the settings you have configured for Phabricator. For more '.
|
||||
'information, see '.$doclink.'.</p>';
|
||||
'<p class="aphront-form-instructions">'.
|
||||
pht('This form will send a normal email using the settings you have '.
|
||||
'configured for Phabricator. For more information, see %s.', $doclink).
|
||||
'</p>';
|
||||
|
||||
$adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter');
|
||||
$warning = null;
|
||||
|
@ -67,11 +68,11 @@ final class PhabricatorMetaMTASendController
|
|||
$warning->setTitle('Email is Disabled');
|
||||
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
|
||||
$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 '.
|
||||
'outbound email. This completely disables outbound email! All '.
|
||||
'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(
|
||||
|
@ -91,49 +92,49 @@ final class PhabricatorMetaMTASendController
|
|||
->appendChild($instructions)
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Adapter')
|
||||
->setLabel(pht('Adapter'))
|
||||
->setValue($adapter))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel('To')
|
||||
->setLabel(pht('To'))
|
||||
->setName('to')
|
||||
->setDatasource('/typeahead/common/mailable/'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTokenizerControl())
|
||||
->setLabel('CC')
|
||||
->setLabel(pht('CC'))
|
||||
->setName('cc')
|
||||
->setDatasource('/typeahead/common/mailable/'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Subject')
|
||||
->setLabel(pht('Subject'))
|
||||
->setName('subject'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextAreaControl())
|
||||
->setLabel('Body')
|
||||
->setLabel(pht('Body'))
|
||||
->setName('body'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Mail Tags')
|
||||
->setLabel(pht('Mail Tags'))
|
||||
->setName('mailtags')
|
||||
->setCaption(
|
||||
'Example: <tt>differential-cc, differential-comment</tt>'))
|
||||
pht('Example:').' <tt>differential-cc, differential-comment</tt>'))
|
||||
->appendChild(
|
||||
id(new AphrontFormDragAndDropUploadControl())
|
||||
->setLabel('Attach Files')
|
||||
->setLabel(pht('Attach Files'))
|
||||
->setName('files')
|
||||
->setActivatedClass('aphront-panel-view-drag-and-drop'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Simulate Failures')
|
||||
->setLabel(pht('Simulate Failures'))
|
||||
->setName('failures')
|
||||
->setCaption($failure_caption))
|
||||
->appendChild(
|
||||
id(new AphrontFormCheckboxControl())
|
||||
->setLabel('HTML')
|
||||
->setLabel(pht('HTML'))
|
||||
->addCheckbox('html', '1', 'Send as HTML email.'))
|
||||
->appendChild(
|
||||
id(new AphrontFormCheckboxControl())
|
||||
->setLabel('Bulk')
|
||||
->setLabel(pht('Bulk'))
|
||||
->addCheckbox('bulk', '1', 'Send with bulk email headers.'))
|
||||
->appendChild(
|
||||
id(new AphrontFormCheckboxControl())
|
||||
|
@ -141,18 +142,18 @@ final class PhabricatorMetaMTASendController
|
|||
->addCheckbox(
|
||||
'immediately',
|
||||
'1',
|
||||
'Send immediately. (Do not enqueue for daemons.)',
|
||||
pht('Send immediately. (Do not enqueue for daemons.)'),
|
||||
PhabricatorEnv::getEnvConfig('metamta.send-immediately'))
|
||||
->setCaption('Daemons can be started with '.$phdlink.'.')
|
||||
->setCaption(pht('Daemons can be started with %s.', $phdlink))
|
||||
)
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->setValue('Send Mail'));
|
||||
->setValue(pht('Send Mail')));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Send Email');
|
||||
$panel->setHeader(pht('Send Email'));
|
||||
$panel->appendChild($form);
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
|
||||
$panel->setNoBackground();
|
||||
|
||||
$nav = $this->buildSideNavView();
|
||||
$nav->selectFilter('send');
|
||||
|
@ -165,7 +166,8 @@ final class PhabricatorMetaMTASendController
|
|||
return $this->buildApplicationPage(
|
||||
$nav,
|
||||
array(
|
||||
'title' => 'Send Test',
|
||||
'title' => pht('Send Test'),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ final class PhabricatorMetaMTASendGridReceiveController
|
|||
$received->processReceivedMail();
|
||||
|
||||
$response = new AphrontWebpageResponse();
|
||||
$response->setContent("Got it! Thanks, SendGrid!\n");
|
||||
$response->setContent(pht("Got it! Thanks, SendGrid!\n"));
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,41 +26,43 @@ final class PhabricatorMetaMTAViewController
|
|||
$form
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Subject')
|
||||
->setLabel(pht('Subject'))
|
||||
->setValue($mail->getSubject()))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Created')
|
||||
->setLabel(pht('Created'))
|
||||
->setValue(phabricator_datetime($mail->getDateCreated(), $user)))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Status')
|
||||
->setLabel(pht('Status'))
|
||||
->setValue($status))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Retry Count')
|
||||
->setLabel(pht('Retry Count'))
|
||||
->setValue($mail->getRetryCount()))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Message')
|
||||
->setLabel(pht('Message'))
|
||||
->setValue($mail->getMessage()))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('Related PHID')
|
||||
->setLabel(pht('Related PHID'))
|
||||
->setValue($mail->getRelatedPHID()))
|
||||
->appendChild(
|
||||
id(new AphrontFormSubmitControl())
|
||||
->addCancelButton($this->getApplicationURI(), 'Done'));
|
||||
->addCancelButton($this->getApplicationURI(), pht('Done')));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('View Email');
|
||||
$panel->setHeader(pht('View Email'));
|
||||
$panel->appendChild($form);
|
||||
$panel->setWidth(AphrontPanelView::WIDTH_WIDE);
|
||||
$panel->setNoBackground();
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
$panel,
|
||||
array(
|
||||
'title' => 'View Mail',
|
||||
'title' => pht('View Mail'),
|
||||
'device' => true,
|
||||
));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue