mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-05 12:21:02 +01:00
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
This commit is contained in:
parent
4425903480
commit
47a81aa9c4
1 changed files with 23 additions and 22 deletions
|
@ -105,8 +105,8 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$owner_phid = reset($owner_tokenizer);
|
$owner_phid = reset($owner_tokenizer);
|
||||||
|
|
||||||
if (!strlen($new_title)) {
|
if (!strlen($new_title)) {
|
||||||
$e_title = 'Required';
|
$e_title = pht('Required');
|
||||||
$errors[] = 'Title is required.';
|
$errors[] = pht('Title is required.');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($aux_fields as $aux_field) {
|
foreach ($aux_fields as $aux_field) {
|
||||||
|
@ -311,7 +311,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$error_view = new AphrontErrorView();
|
$error_view = new AphrontErrorView();
|
||||||
$error_view->setErrors($errors);
|
$error_view->setErrors($errors);
|
||||||
$error_view->setTitle('Form Errors');
|
$error_view->setTitle(pht('Form Errors'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
$priority_map = ManiphestTaskPriority::getTaskPriorityMap();
|
||||||
|
@ -344,15 +344,15 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($task->getID()) {
|
if ($task->getID()) {
|
||||||
$button_name = 'Save Task';
|
$button_name = pht('Save Task');
|
||||||
$header_name = 'Edit Task';
|
$header_name = pht('Edit Task');
|
||||||
} else if ($parent_task) {
|
} else if ($parent_task) {
|
||||||
$cancel_uri = '/T'.$parent_task->getID();
|
$cancel_uri = '/T'.$parent_task->getID();
|
||||||
$button_name = 'Create Task';
|
$button_name = pht('Create Task');
|
||||||
$header_name = 'Create New Subtask';
|
$header_name = pht('Create New Subtask');
|
||||||
} else {
|
} else {
|
||||||
$button_name = 'Create Task';
|
$button_name = pht('Create Task');
|
||||||
$header_name = 'Create New Task';
|
$header_name = pht('Create New Task');
|
||||||
}
|
}
|
||||||
|
|
||||||
require_celerity_resource('maniphest-task-edit-css');
|
require_celerity_resource('maniphest-task-edit-css');
|
||||||
|
@ -369,7 +369,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormStaticControl())
|
id(new AphrontFormStaticControl())
|
||||||
->setLabel('Parent Task')
|
->setLabel(pht('Parent Task'))
|
||||||
->setValue($handles[$parent_task->getPHID()]->getFullName()))
|
->setValue($handles[$parent_task->getPHID()]->getFullName()))
|
||||||
->addHiddenInput('parent', $parent_task->getID());
|
->addHiddenInput('parent', $parent_task->getID());
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextAreaControl())
|
id(new AphrontFormTextAreaControl())
|
||||||
->setLabel('Title')
|
->setLabel(pht('Title'))
|
||||||
->setName('title')
|
->setName('title')
|
||||||
->setError($e_title)
|
->setError($e_title)
|
||||||
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
|
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
|
||||||
|
@ -390,7 +390,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setLabel('Status')
|
->setLabel(pht('Status'))
|
||||||
->setName('status')
|
->setName('status')
|
||||||
->setValue($task->getStatus())
|
->setValue($task->getStatus())
|
||||||
->setOptions(ManiphestTaskStatus::getTaskStatusMap()));
|
->setOptions(ManiphestTaskStatus::getTaskStatusMap()));
|
||||||
|
@ -399,7 +399,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setLabel('Assigned To')
|
->setLabel(pht('Assigned To'))
|
||||||
->setName('assigned_to')
|
->setName('assigned_to')
|
||||||
->setValue($assigned_value)
|
->setValue($assigned_value)
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
|
@ -407,20 +407,20 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
->setLimit(1))
|
->setLimit(1))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setLabel('CC')
|
->setLabel(pht('CC'))
|
||||||
->setName('cc')
|
->setName('cc')
|
||||||
->setValue($cc_value)
|
->setValue($cc_value)
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setDatasource('/typeahead/common/mailable/'))
|
->setDatasource('/typeahead/common/mailable/'))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setLabel('Priority')
|
->setLabel(pht('Priority'))
|
||||||
->setName('priority')
|
->setName('priority')
|
||||||
->setOptions($priority_map)
|
->setOptions($priority_map)
|
||||||
->setValue($task->getPriority()))
|
->setValue($task->getPriority()))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTokenizerControl())
|
id(new AphrontFormTokenizerControl())
|
||||||
->setLabel('Projects')
|
->setLabel(pht('Projects'))
|
||||||
->setName('projects')
|
->setName('projects')
|
||||||
->setValue($projects_value)
|
->setValue($projects_value)
|
||||||
->setID($project_tokenizer_id)
|
->setID($project_tokenizer_id)
|
||||||
|
@ -432,7 +432,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
'mustcapture' => true,
|
'mustcapture' => true,
|
||||||
'sigil' => 'project-create',
|
'sigil' => 'project-create',
|
||||||
),
|
),
|
||||||
'Create New Project'))
|
pht('Create New Project')))
|
||||||
->setDatasource('/typeahead/common/projects/'));
|
->setDatasource('/typeahead/common/projects/'));
|
||||||
|
|
||||||
if ($aux_fields) {
|
if ($aux_fields) {
|
||||||
|
@ -463,7 +463,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
|
|
||||||
$form->appendChild(
|
$form->appendChild(
|
||||||
id(new AphrontFormMarkupControl())
|
id(new AphrontFormMarkupControl())
|
||||||
->setLabel('Files')
|
->setLabel(pht('Files'))
|
||||||
->setValue($file_display));
|
->setValue($file_display));
|
||||||
|
|
||||||
foreach ($files as $ii => $file) {
|
foreach ($files as $ii => $file) {
|
||||||
|
@ -478,13 +478,13 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$email_create = PhabricatorEnv::getEnvConfig(
|
$email_create = PhabricatorEnv::getEnvConfig(
|
||||||
'metamta.maniphest.public-create-email');
|
'metamta.maniphest.public-create-email');
|
||||||
if (!$task->getID() && $email_create) {
|
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: ').
|
||||||
'<tt>'.phutil_escape_html($email_create).'</tt>';
|
'<tt>'.phutil_escape_html($email_create).'</tt>';
|
||||||
$description_control->setCaption($email_hint);
|
$description_control->setCaption($email_hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
$description_control
|
$description_control
|
||||||
->setLabel('Description')
|
->setLabel(pht('Description'))
|
||||||
->setName('description')
|
->setName('description')
|
||||||
->setID('description-textarea')
|
->setID('description-textarea')
|
||||||
->setValue($task->getDescription())
|
->setValue($task->getDescription())
|
||||||
|
@ -497,7 +497,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormDragAndDropUploadControl())
|
id(new AphrontFormDragAndDropUploadControl())
|
||||||
->setLabel('Attached Files')
|
->setLabel(pht('Attached Files'))
|
||||||
->setName('files')
|
->setName('files')
|
||||||
->setActivatedClass('aphront-panel-view-drag-and-drop'));
|
->setActivatedClass('aphront-panel-view-drag-and-drop'));
|
||||||
}
|
}
|
||||||
|
@ -540,7 +540,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
$page_objects = array();
|
$page_objects = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$error_view,
|
$error_view,
|
||||||
$panel,
|
$panel,
|
||||||
|
@ -549,6 +549,7 @@ final class ManiphestTaskEditController extends ManiphestController {
|
||||||
array(
|
array(
|
||||||
'title' => $header_name,
|
'title' => $header_name,
|
||||||
'pageObjects' => $page_objects,
|
'pageObjects' => $page_objects,
|
||||||
|
'device' => true
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue