1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Move Maniphest attached files section into textbox.

Summary: Add a button to the Remarkup area that explains how to attach an image and remove the separate upload field.

Test Plan: Check that the dialog pops up correctly and that dropping images onto the Remarkup area works.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin, AnhNhan

Maniphest Tasks: T879

Differential Revision: https://secure.phabricator.com/D6049
This commit is contained in:
Bryan Cuccioli 2013-05-26 13:45:24 -07:00 committed by epriestley
parent ef797494ca
commit 59bb8ca9dd
7 changed files with 31 additions and 15 deletions

View file

@ -1009,6 +1009,7 @@ phutil_register_library_map(array(
'PhabricatorFileTestDataGenerator' => 'applications/files/lipsum/PhabricatorFileTestDataGenerator.php',
'PhabricatorFileTransformController' => 'applications/files/controller/PhabricatorFileTransformController.php',
'PhabricatorFileUploadController' => 'applications/files/controller/PhabricatorFileUploadController.php',
'PhabricatorFileUploadDialogController' => 'applications/files/controller/PhabricatorFileUploadDialogController.php',
'PhabricatorFileUploadException' => 'applications/files/exception/PhabricatorFileUploadException.php',
'PhabricatorFilesConfigOptions' => 'applications/files/config/PhabricatorFilesConfigOptions.php',
'PhabricatorFilesManagementEnginesWorkflow' => 'applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php',
@ -2805,6 +2806,7 @@ phutil_register_library_map(array(
'PhabricatorFileTestDataGenerator' => 'PhabricatorTestDataGenerator',
'PhabricatorFileTransformController' => 'PhabricatorFileController',
'PhabricatorFileUploadController' => 'PhabricatorFileController',
'PhabricatorFileUploadDialogController' => 'PhabricatorFileController',
'PhabricatorFileUploadException' => 'Exception',
'PhabricatorFilesConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorFilesManagementEnginesWorkflow' => 'PhabricatorFilesManagementWorkflow',

View file

@ -49,6 +49,7 @@ final class PhabricatorApplicationFiles extends PhabricatorApplication {
'proxy/' => 'PhabricatorFileProxyController',
'xform/(?P<transform>[^/]+)/(?P<phid>[^/]+)/(?P<key>[^/]+)/'
=> 'PhabricatorFileTransformController',
'uploaddialog/' => 'PhabricatorFileUploadDialogController',
),
);
}

View file

@ -0,0 +1,20 @@
<?php
final class PhabricatorFileUploadDialogController
extends PhabricatorFileController {
public function processRequest() {
$request = $this->getRequest();
$user = $request->getUser();
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Upload Image'))
->appendChild(pht(
'To add files, drag and drop them into the comment text area.'))
->addCancelButton('/', pht('Close'));
return id(new AphrontDialogResponse())->setDialog($dialog);
}
}

View file

@ -257,11 +257,6 @@ final class ManiphestTaskDetailController extends ManiphestController {
->setValue($draft_text)
->setID('transaction-comments')
->setUser($user))
->appendChild(
id(new AphrontFormDragAndDropUploadControl())
->setLabel(pht('Attached Files'))
->setName('files')
->setActivatedClass('aphront-panel-view-drag-and-drop'))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue($is_serious ? pht('Submit') : pht('Avast!')));

View file

@ -485,15 +485,6 @@ final class ManiphestTaskEditController extends ManiphestController {
$form
->appendChild($description_control);
if (!$task->getID()) {
$form
->appendChild(
id(new AphrontFormDragAndDropUploadControl())
->setLabel(pht('Attached Files'))
->setName('files')
->setActivatedClass('aphront-panel-view-drag-and-drop'));
}
$form
->appendChild(
id(new AphrontFormSubmitControl())

View file

@ -54,8 +54,12 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl {
),
'table' => array(
'tip' => pht('Table'),
)
),
'image' => array(
'tip' => pht('Upload File'),
),
);
if (!$this->disableMacro and function_exists('imagettftext')) {
$actions[] = array(
'spacer' => true,

View file

@ -174,6 +174,9 @@ JX.behavior('phabricator-remarkup-assist', function(config) {
})
.start();
break;
case 'image':
new JX.Workflow('/file/uploaddialog/').start();
break;
case 'chaos':
if (edit_mode == 'chaos') {
set_edit_mode(root, 'normal');