From 47a81aa9c4cfdbf826f78325923c2f3c8e248d53 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Tue, 22 Jan 2013 14:03:10 -0800 Subject: [PATCH] Make Create Task mobile friendly, pht'd Summary: Allows Create Task to render using mobile targeting. pht added where found. Test Plan: Tested in iOS simulator and in Chrome. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4584 --- .../ManiphestTaskEditController.php | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index fbf96475cf..b2b8fc8f0c 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -105,8 +105,8 @@ final class ManiphestTaskEditController extends ManiphestController { $owner_phid = reset($owner_tokenizer); if (!strlen($new_title)) { - $e_title = 'Required'; - $errors[] = 'Title is required.'; + $e_title = pht('Required'); + $errors[] = pht('Title is required.'); } foreach ($aux_fields as $aux_field) { @@ -311,7 +311,7 @@ final class ManiphestTaskEditController extends ManiphestController { if ($errors) { $error_view = new AphrontErrorView(); $error_view->setErrors($errors); - $error_view->setTitle('Form Errors'); + $error_view->setTitle(pht('Form Errors')); } $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); @@ -344,15 +344,15 @@ final class ManiphestTaskEditController extends ManiphestController { } if ($task->getID()) { - $button_name = 'Save Task'; - $header_name = 'Edit Task'; + $button_name = pht('Save Task'); + $header_name = pht('Edit Task'); } else if ($parent_task) { $cancel_uri = '/T'.$parent_task->getID(); - $button_name = 'Create Task'; - $header_name = 'Create New Subtask'; + $button_name = pht('Create Task'); + $header_name = pht('Create New Subtask'); } else { - $button_name = 'Create Task'; - $header_name = 'Create New Task'; + $button_name = pht('Create Task'); + $header_name = pht('Create New Task'); } require_celerity_resource('maniphest-task-edit-css'); @@ -369,7 +369,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild( id(new AphrontFormStaticControl()) - ->setLabel('Parent Task') + ->setLabel(pht('Parent Task')) ->setValue($handles[$parent_task->getPHID()]->getFullName())) ->addHiddenInput('parent', $parent_task->getID()); } @@ -377,7 +377,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild( id(new AphrontFormTextAreaControl()) - ->setLabel('Title') + ->setLabel(pht('Title')) ->setName('title') ->setError($e_title) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) @@ -390,7 +390,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild( id(new AphrontFormSelectControl()) - ->setLabel('Status') + ->setLabel(pht('Status')) ->setName('status') ->setValue($task->getStatus()) ->setOptions(ManiphestTaskStatus::getTaskStatusMap())); @@ -399,7 +399,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild( id(new AphrontFormTokenizerControl()) - ->setLabel('Assigned To') + ->setLabel(pht('Assigned To')) ->setName('assigned_to') ->setValue($assigned_value) ->setUser($user) @@ -407,20 +407,20 @@ final class ManiphestTaskEditController extends ManiphestController { ->setLimit(1)) ->appendChild( id(new AphrontFormTokenizerControl()) - ->setLabel('CC') + ->setLabel(pht('CC')) ->setName('cc') ->setValue($cc_value) ->setUser($user) ->setDatasource('/typeahead/common/mailable/')) ->appendChild( id(new AphrontFormSelectControl()) - ->setLabel('Priority') + ->setLabel(pht('Priority')) ->setName('priority') ->setOptions($priority_map) ->setValue($task->getPriority())) ->appendChild( id(new AphrontFormTokenizerControl()) - ->setLabel('Projects') + ->setLabel(pht('Projects')) ->setName('projects') ->setValue($projects_value) ->setID($project_tokenizer_id) @@ -432,7 +432,7 @@ final class ManiphestTaskEditController extends ManiphestController { 'mustcapture' => true, 'sigil' => 'project-create', ), - 'Create New Project')) + pht('Create New Project'))) ->setDatasource('/typeahead/common/projects/')); if ($aux_fields) { @@ -463,7 +463,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form->appendChild( id(new AphrontFormMarkupControl()) - ->setLabel('Files') + ->setLabel(pht('Files')) ->setValue($file_display)); foreach ($files as $ii => $file) { @@ -478,13 +478,13 @@ final class ManiphestTaskEditController extends ManiphestController { $email_create = PhabricatorEnv::getEnvConfig( 'metamta.maniphest.public-create-email'); if (!$task->getID() && $email_create) { - $email_hint = 'You can also create tasks by sending an email to: '. + $email_hint = pht('You can also create tasks by sending an email to: '). ''.phutil_escape_html($email_create).''; $description_control->setCaption($email_hint); } $description_control - ->setLabel('Description') + ->setLabel(pht('Description')) ->setName('description') ->setID('description-textarea') ->setValue($task->getDescription()) @@ -497,7 +497,7 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild( id(new AphrontFormDragAndDropUploadControl()) - ->setLabel('Attached Files') + ->setLabel(pht('Attached Files')) ->setName('files') ->setActivatedClass('aphront-panel-view-drag-and-drop')); } @@ -540,7 +540,7 @@ final class ManiphestTaskEditController extends ManiphestController { $page_objects = array(); } - return $this->buildStandardPageResponse( + return $this->buildApplicationPage( array( $error_view, $panel, @@ -549,6 +549,7 @@ final class ManiphestTaskEditController extends ManiphestController { array( 'title' => $header_name, 'pageObjects' => $page_objects, + 'device' => true )); } }