mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-31 08:58:20 +01:00
Conpherence - make updating title + picture a dialogue that uses drag and drop upload control
Summary: decent title. Stylistically its probably a bit rough. Also, I think @chad describes an even hotter workflow in T2418. Note this removes the "default image" thing which I don't think makes sense conceptually since by default the image changes to who replied last... Test Plan: uploaded an image - worked. uploaded a txt file - got ugly errors that file was not supported. Reviewers: epriestley, chad Reviewed By: chad CC: aran, Korvin Maniphest Tasks: T2417 Differential Revision: https://secure.phabricator.com/D4668
This commit is contained in:
parent
64543a9476
commit
9437bc019d
7 changed files with 144 additions and 117 deletions
|
@ -616,7 +616,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'aphront-error-view-css' =>
|
'aphront-error-view-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/048ed376/rsrc/css/aphront/error-view.css',
|
'uri' => '/res/5f43a7c5/rsrc/css/aphront/error-view.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
@ -1030,13 +1030,14 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'javelin-behavior-aphront-drag-and-drop' =>
|
'javelin-behavior-aphront-drag-and-drop' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/84a67d72/rsrc/js/application/core/behavior-drag-and-drop.js',
|
'uri' => '/res/3d809b40/rsrc/js/application/core/behavior-drag-and-drop.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
0 => 'javelin-behavior',
|
0 => 'javelin-behavior',
|
||||||
1 => 'javelin-dom',
|
1 => 'javelin-dom',
|
||||||
2 => 'phabricator-drag-and-drop-file-upload',
|
2 => 'phabricator-file-upload',
|
||||||
|
3 => 'phabricator-drag-and-drop-file-upload',
|
||||||
),
|
),
|
||||||
'disk' => '/rsrc/js/application/core/behavior-drag-and-drop.js',
|
'disk' => '/rsrc/js/application/core/behavior-drag-and-drop.js',
|
||||||
),
|
),
|
||||||
|
@ -3345,7 +3346,7 @@ celerity_register_resource_map(array(
|
||||||
), array(
|
), array(
|
||||||
'packages' =>
|
'packages' =>
|
||||||
array(
|
array(
|
||||||
'6031cfb4' =>
|
'023adc14' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'core.pkg.css',
|
'name' => 'core.pkg.css',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -3389,7 +3390,7 @@ celerity_register_resource_map(array(
|
||||||
36 => 'phabricator-object-item-list-view-css',
|
36 => 'phabricator-object-item-list-view-css',
|
||||||
37 => 'global-drag-and-drop-css',
|
37 => 'global-drag-and-drop-css',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/6031cfb4/core.pkg.css',
|
'uri' => '/res/pkg/023adc14/core.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
'66dca903' =>
|
'66dca903' =>
|
||||||
|
@ -3469,7 +3470,7 @@ celerity_register_resource_map(array(
|
||||||
'uri' => '/res/pkg/ec01d039/differential.pkg.css',
|
'uri' => '/res/pkg/ec01d039/differential.pkg.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
),
|
),
|
||||||
'ac53d36a' =>
|
'310cd201' =>
|
||||||
array(
|
array(
|
||||||
'name' => 'differential.pkg.js',
|
'name' => 'differential.pkg.js',
|
||||||
'symbols' =>
|
'symbols' =>
|
||||||
|
@ -3494,7 +3495,7 @@ celerity_register_resource_map(array(
|
||||||
17 => 'javelin-behavior-differential-toggle-files',
|
17 => 'javelin-behavior-differential-toggle-files',
|
||||||
18 => 'javelin-behavior-differential-user-select',
|
18 => 'javelin-behavior-differential-user-select',
|
||||||
),
|
),
|
||||||
'uri' => '/res/pkg/ac53d36a/differential.pkg.js',
|
'uri' => '/res/pkg/310cd201/differential.pkg.js',
|
||||||
'type' => 'js',
|
'type' => 'js',
|
||||||
),
|
),
|
||||||
'c8ce2d88' =>
|
'c8ce2d88' =>
|
||||||
|
@ -3579,22 +3580,22 @@ celerity_register_resource_map(array(
|
||||||
'reverse' =>
|
'reverse' =>
|
||||||
array(
|
array(
|
||||||
'aphront-attached-file-view-css' => 'e30a3fa8',
|
'aphront-attached-file-view-css' => 'e30a3fa8',
|
||||||
'aphront-crumbs-view-css' => '6031cfb4',
|
'aphront-crumbs-view-css' => '023adc14',
|
||||||
'aphront-dialog-view-css' => '6031cfb4',
|
'aphront-dialog-view-css' => '023adc14',
|
||||||
'aphront-error-view-css' => '6031cfb4',
|
'aphront-error-view-css' => '023adc14',
|
||||||
'aphront-form-view-css' => '6031cfb4',
|
'aphront-form-view-css' => '023adc14',
|
||||||
'aphront-headsup-action-list-view-css' => 'ec01d039',
|
'aphront-headsup-action-list-view-css' => 'ec01d039',
|
||||||
'aphront-headsup-view-css' => '6031cfb4',
|
'aphront-headsup-view-css' => '023adc14',
|
||||||
'aphront-list-filter-view-css' => '6031cfb4',
|
'aphront-list-filter-view-css' => '023adc14',
|
||||||
'aphront-pager-view-css' => '6031cfb4',
|
'aphront-pager-view-css' => '023adc14',
|
||||||
'aphront-panel-view-css' => '6031cfb4',
|
'aphront-panel-view-css' => '023adc14',
|
||||||
'aphront-table-view-css' => '6031cfb4',
|
'aphront-table-view-css' => '023adc14',
|
||||||
'aphront-tokenizer-control-css' => '6031cfb4',
|
'aphront-tokenizer-control-css' => '023adc14',
|
||||||
'aphront-tooltip-css' => '6031cfb4',
|
'aphront-tooltip-css' => '023adc14',
|
||||||
'aphront-typeahead-control-css' => '6031cfb4',
|
'aphront-typeahead-control-css' => '023adc14',
|
||||||
'differential-changeset-view-css' => 'ec01d039',
|
'differential-changeset-view-css' => 'ec01d039',
|
||||||
'differential-core-view-css' => 'ec01d039',
|
'differential-core-view-css' => 'ec01d039',
|
||||||
'differential-inline-comment-editor' => 'ac53d36a',
|
'differential-inline-comment-editor' => '310cd201',
|
||||||
'differential-local-commits-view-css' => 'ec01d039',
|
'differential-local-commits-view-css' => 'ec01d039',
|
||||||
'differential-results-table-css' => 'ec01d039',
|
'differential-results-table-css' => 'ec01d039',
|
||||||
'differential-revision-add-comment-css' => 'ec01d039',
|
'differential-revision-add-comment-css' => 'ec01d039',
|
||||||
|
@ -3605,32 +3606,32 @@ celerity_register_resource_map(array(
|
||||||
'differential-table-of-contents-css' => 'ec01d039',
|
'differential-table-of-contents-css' => 'ec01d039',
|
||||||
'diffusion-commit-view-css' => 'c8ce2d88',
|
'diffusion-commit-view-css' => 'c8ce2d88',
|
||||||
'diffusion-icons-css' => 'c8ce2d88',
|
'diffusion-icons-css' => 'c8ce2d88',
|
||||||
'global-drag-and-drop-css' => '6031cfb4',
|
'global-drag-and-drop-css' => '023adc14',
|
||||||
'inline-comment-summary-css' => 'ec01d039',
|
'inline-comment-summary-css' => 'ec01d039',
|
||||||
'javelin-aphlict' => '66dca903',
|
'javelin-aphlict' => '66dca903',
|
||||||
'javelin-behavior' => 'fbeded59',
|
'javelin-behavior' => 'fbeded59',
|
||||||
'javelin-behavior-aphlict-dropdown' => '66dca903',
|
'javelin-behavior-aphlict-dropdown' => '66dca903',
|
||||||
'javelin-behavior-aphlict-listen' => '66dca903',
|
'javelin-behavior-aphlict-listen' => '66dca903',
|
||||||
'javelin-behavior-aphront-basic-tokenizer' => '66dca903',
|
'javelin-behavior-aphront-basic-tokenizer' => '66dca903',
|
||||||
'javelin-behavior-aphront-drag-and-drop' => 'ac53d36a',
|
'javelin-behavior-aphront-drag-and-drop' => '310cd201',
|
||||||
'javelin-behavior-aphront-drag-and-drop-textarea' => 'ac53d36a',
|
'javelin-behavior-aphront-drag-and-drop-textarea' => '310cd201',
|
||||||
'javelin-behavior-aphront-form-disable-on-submit' => '66dca903',
|
'javelin-behavior-aphront-form-disable-on-submit' => '66dca903',
|
||||||
'javelin-behavior-audit-preview' => 'f96657b8',
|
'javelin-behavior-audit-preview' => 'f96657b8',
|
||||||
'javelin-behavior-dark-console' => '8edbada5',
|
'javelin-behavior-dark-console' => '8edbada5',
|
||||||
'javelin-behavior-dark-console-ajax' => '8edbada5',
|
'javelin-behavior-dark-console-ajax' => '8edbada5',
|
||||||
'javelin-behavior-device' => '66dca903',
|
'javelin-behavior-device' => '66dca903',
|
||||||
'javelin-behavior-differential-accept-with-errors' => 'ac53d36a',
|
'javelin-behavior-differential-accept-with-errors' => '310cd201',
|
||||||
'javelin-behavior-differential-add-reviewers-and-ccs' => 'ac53d36a',
|
'javelin-behavior-differential-add-reviewers-and-ccs' => '310cd201',
|
||||||
'javelin-behavior-differential-comment-jump' => 'ac53d36a',
|
'javelin-behavior-differential-comment-jump' => '310cd201',
|
||||||
'javelin-behavior-differential-diff-radios' => 'ac53d36a',
|
'javelin-behavior-differential-diff-radios' => '310cd201',
|
||||||
'javelin-behavior-differential-dropdown-menus' => 'ac53d36a',
|
'javelin-behavior-differential-dropdown-menus' => '310cd201',
|
||||||
'javelin-behavior-differential-edit-inline-comments' => 'ac53d36a',
|
'javelin-behavior-differential-edit-inline-comments' => '310cd201',
|
||||||
'javelin-behavior-differential-feedback-preview' => 'ac53d36a',
|
'javelin-behavior-differential-feedback-preview' => '310cd201',
|
||||||
'javelin-behavior-differential-keyboard-navigation' => 'ac53d36a',
|
'javelin-behavior-differential-keyboard-navigation' => '310cd201',
|
||||||
'javelin-behavior-differential-populate' => 'ac53d36a',
|
'javelin-behavior-differential-populate' => '310cd201',
|
||||||
'javelin-behavior-differential-show-more' => 'ac53d36a',
|
'javelin-behavior-differential-show-more' => '310cd201',
|
||||||
'javelin-behavior-differential-toggle-files' => 'ac53d36a',
|
'javelin-behavior-differential-toggle-files' => '310cd201',
|
||||||
'javelin-behavior-differential-user-select' => 'ac53d36a',
|
'javelin-behavior-differential-user-select' => '310cd201',
|
||||||
'javelin-behavior-diffusion-commit-graph' => 'f96657b8',
|
'javelin-behavior-diffusion-commit-graph' => 'f96657b8',
|
||||||
'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8',
|
'javelin-behavior-diffusion-pull-lastmodified' => 'f96657b8',
|
||||||
'javelin-behavior-error-log' => '8edbada5',
|
'javelin-behavior-error-log' => '8edbada5',
|
||||||
|
@ -3647,14 +3648,14 @@ celerity_register_resource_map(array(
|
||||||
'javelin-behavior-phabricator-home-reveal-tiles' => '66dca903',
|
'javelin-behavior-phabricator-home-reveal-tiles' => '66dca903',
|
||||||
'javelin-behavior-phabricator-keyboard-shortcuts' => '66dca903',
|
'javelin-behavior-phabricator-keyboard-shortcuts' => '66dca903',
|
||||||
'javelin-behavior-phabricator-nav' => '66dca903',
|
'javelin-behavior-phabricator-nav' => '66dca903',
|
||||||
'javelin-behavior-phabricator-object-selector' => 'ac53d36a',
|
'javelin-behavior-phabricator-object-selector' => '310cd201',
|
||||||
'javelin-behavior-phabricator-oncopy' => '66dca903',
|
'javelin-behavior-phabricator-oncopy' => '66dca903',
|
||||||
'javelin-behavior-phabricator-remarkup-assist' => '66dca903',
|
'javelin-behavior-phabricator-remarkup-assist' => '66dca903',
|
||||||
'javelin-behavior-phabricator-search-typeahead' => '66dca903',
|
'javelin-behavior-phabricator-search-typeahead' => '66dca903',
|
||||||
'javelin-behavior-phabricator-tooltips' => '66dca903',
|
'javelin-behavior-phabricator-tooltips' => '66dca903',
|
||||||
'javelin-behavior-phabricator-watch-anchor' => '66dca903',
|
'javelin-behavior-phabricator-watch-anchor' => '66dca903',
|
||||||
'javelin-behavior-refresh-csrf' => '66dca903',
|
'javelin-behavior-refresh-csrf' => '66dca903',
|
||||||
'javelin-behavior-repository-crossreference' => 'ac53d36a',
|
'javelin-behavior-repository-crossreference' => '310cd201',
|
||||||
'javelin-behavior-toggle-class' => '66dca903',
|
'javelin-behavior-toggle-class' => '66dca903',
|
||||||
'javelin-behavior-workflow' => '66dca903',
|
'javelin-behavior-workflow' => '66dca903',
|
||||||
'javelin-dom' => 'fbeded59',
|
'javelin-dom' => 'fbeded59',
|
||||||
|
@ -3675,48 +3676,48 @@ celerity_register_resource_map(array(
|
||||||
'javelin-util' => 'fbeded59',
|
'javelin-util' => 'fbeded59',
|
||||||
'javelin-vector' => 'fbeded59',
|
'javelin-vector' => 'fbeded59',
|
||||||
'javelin-workflow' => 'fbeded59',
|
'javelin-workflow' => 'fbeded59',
|
||||||
'lightbox-attachment-css' => '6031cfb4',
|
'lightbox-attachment-css' => '023adc14',
|
||||||
'maniphest-task-summary-css' => 'e30a3fa8',
|
'maniphest-task-summary-css' => 'e30a3fa8',
|
||||||
'maniphest-transaction-detail-css' => 'e30a3fa8',
|
'maniphest-transaction-detail-css' => 'e30a3fa8',
|
||||||
'phabricator-busy' => '66dca903',
|
'phabricator-busy' => '66dca903',
|
||||||
'phabricator-content-source-view-css' => 'ec01d039',
|
'phabricator-content-source-view-css' => 'ec01d039',
|
||||||
'phabricator-core-buttons-css' => '6031cfb4',
|
'phabricator-core-buttons-css' => '023adc14',
|
||||||
'phabricator-core-css' => '6031cfb4',
|
'phabricator-core-css' => '023adc14',
|
||||||
'phabricator-crumbs-view-css' => '6031cfb4',
|
'phabricator-crumbs-view-css' => '023adc14',
|
||||||
'phabricator-directory-css' => '6031cfb4',
|
'phabricator-directory-css' => '023adc14',
|
||||||
'phabricator-drag-and-drop-file-upload' => 'ac53d36a',
|
'phabricator-drag-and-drop-file-upload' => '310cd201',
|
||||||
'phabricator-dropdown-menu' => '66dca903',
|
'phabricator-dropdown-menu' => '66dca903',
|
||||||
'phabricator-file-upload' => '66dca903',
|
'phabricator-file-upload' => '66dca903',
|
||||||
'phabricator-filetree-view-css' => '6031cfb4',
|
'phabricator-filetree-view-css' => '023adc14',
|
||||||
'phabricator-flag-css' => '6031cfb4',
|
'phabricator-flag-css' => '023adc14',
|
||||||
'phabricator-form-view-css' => '6031cfb4',
|
'phabricator-form-view-css' => '023adc14',
|
||||||
'phabricator-header-view-css' => '6031cfb4',
|
'phabricator-header-view-css' => '023adc14',
|
||||||
'phabricator-jump-nav' => '6031cfb4',
|
'phabricator-jump-nav' => '023adc14',
|
||||||
'phabricator-keyboard-shortcut' => '66dca903',
|
'phabricator-keyboard-shortcut' => '66dca903',
|
||||||
'phabricator-keyboard-shortcut-manager' => '66dca903',
|
'phabricator-keyboard-shortcut-manager' => '66dca903',
|
||||||
'phabricator-main-menu-view' => '6031cfb4',
|
'phabricator-main-menu-view' => '023adc14',
|
||||||
'phabricator-menu-item' => '66dca903',
|
'phabricator-menu-item' => '66dca903',
|
||||||
'phabricator-nav-view-css' => '6031cfb4',
|
'phabricator-nav-view-css' => '023adc14',
|
||||||
'phabricator-notification' => '66dca903',
|
'phabricator-notification' => '66dca903',
|
||||||
'phabricator-notification-css' => '6031cfb4',
|
'phabricator-notification-css' => '023adc14',
|
||||||
'phabricator-notification-menu-css' => '6031cfb4',
|
'phabricator-notification-menu-css' => '023adc14',
|
||||||
'phabricator-object-item-list-view-css' => '6031cfb4',
|
'phabricator-object-item-list-view-css' => '023adc14',
|
||||||
'phabricator-object-selector-css' => 'ec01d039',
|
'phabricator-object-selector-css' => 'ec01d039',
|
||||||
'phabricator-paste-file-upload' => '66dca903',
|
'phabricator-paste-file-upload' => '66dca903',
|
||||||
'phabricator-prefab' => '66dca903',
|
'phabricator-prefab' => '66dca903',
|
||||||
'phabricator-project-tag-css' => 'e30a3fa8',
|
'phabricator-project-tag-css' => 'e30a3fa8',
|
||||||
'phabricator-remarkup-css' => '6031cfb4',
|
'phabricator-remarkup-css' => '023adc14',
|
||||||
'phabricator-shaped-request' => 'ac53d36a',
|
'phabricator-shaped-request' => '310cd201',
|
||||||
'phabricator-side-menu-view-css' => '6031cfb4',
|
'phabricator-side-menu-view-css' => '023adc14',
|
||||||
'phabricator-standard-page-view' => '6031cfb4',
|
'phabricator-standard-page-view' => '023adc14',
|
||||||
'phabricator-textareautils' => '66dca903',
|
'phabricator-textareautils' => '66dca903',
|
||||||
'phabricator-tooltip' => '66dca903',
|
'phabricator-tooltip' => '66dca903',
|
||||||
'phabricator-transaction-view-css' => '6031cfb4',
|
'phabricator-transaction-view-css' => '023adc14',
|
||||||
'phabricator-zindex-css' => '6031cfb4',
|
'phabricator-zindex-css' => '023adc14',
|
||||||
'sprite-apps-large-css' => '6031cfb4',
|
'sprite-apps-large-css' => '023adc14',
|
||||||
'sprite-gradient-css' => '6031cfb4',
|
'sprite-gradient-css' => '023adc14',
|
||||||
'sprite-icon-css' => '6031cfb4',
|
'sprite-icon-css' => '023adc14',
|
||||||
'sprite-menu-css' => '6031cfb4',
|
'sprite-menu-css' => '023adc14',
|
||||||
'syntax-highlighting-css' => '6031cfb4',
|
'syntax-highlighting-css' => '023adc14',
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -65,9 +65,8 @@ abstract class ConpherenceController extends PhabricatorController {
|
||||||
}
|
}
|
||||||
|
|
||||||
$unread_status = ConpherenceParticipationStatus::BEHIND;
|
$unread_status = ConpherenceParticipationStatus::BEHIND;
|
||||||
$unread_participant_query = id(new ConpherenceParticipantQuery())
|
$unread = id(new ConpherenceParticipantQuery())
|
||||||
->withParticipantPHIDs(array($user->getPHID()));
|
->withParticipantPHIDs(array($user->getPHID()))
|
||||||
$unread = $unread_participant_query
|
|
||||||
->withParticipationStatus($unread_status)
|
->withParticipationStatus($unread_status)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ final class ConpherenceUpdateController extends
|
||||||
|
|
||||||
$updated = false;
|
$updated = false;
|
||||||
$error_view = null;
|
$error_view = null;
|
||||||
$e_image = null;
|
$e_file = array();
|
||||||
$errors = array();
|
$errors = array();
|
||||||
if ($request->isFormPost()) {
|
if ($request->isFormPost()) {
|
||||||
$content_source = PhabricatorContentSource::newForSource(
|
$content_source = PhabricatorContentSource::newForSource(
|
||||||
|
@ -100,37 +100,30 @@ final class ConpherenceUpdateController extends
|
||||||
break;
|
break;
|
||||||
case 'metadata':
|
case 'metadata':
|
||||||
$xactions = array();
|
$xactions = array();
|
||||||
$default_image = $request->getExists('default_image');
|
$images = $request->getArr('image');
|
||||||
if ($default_image) {
|
if ($images) {
|
||||||
$image_phid = null;
|
// just take the first one
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
$file_phid = reset($images);
|
||||||
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
$file = id(new PhabricatorFileQuery())
|
||||||
->setNewValue($image_phid);
|
->setViewer($user)
|
||||||
} else if (!empty($_FILES['image'])) {
|
->withPHIDs(array($file_phid))
|
||||||
$err = idx($_FILES['image'], 'error');
|
->executeOne();
|
||||||
if ($err != UPLOAD_ERR_NO_FILE) {
|
$okay = $file->isTransformableImage();
|
||||||
$file = PhabricatorFile::newFromPHPUpload(
|
if ($okay) {
|
||||||
$_FILES['image'],
|
$xformer = new PhabricatorImageTransformer();
|
||||||
array(
|
$xformed = $xformer->executeThumbTransform(
|
||||||
'authorPHID' => $user->getPHID(),
|
$file,
|
||||||
));
|
$x = 50,
|
||||||
$okay = $file->isTransformableImage();
|
$y = 50);
|
||||||
if ($okay) {
|
$image_phid = $xformed->getPHID();
|
||||||
$xformer = new PhabricatorImageTransformer();
|
$xactions[] = id(new ConpherenceTransaction())
|
||||||
$xformed = $xformer->executeThumbTransform(
|
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
||||||
$file,
|
->setNewValue($image_phid);
|
||||||
$x = 50,
|
} else {
|
||||||
$y = 50);
|
$e_file[] = $file;
|
||||||
$image_phid = $xformed->getPHID();
|
$errors[] =
|
||||||
$xactions[] = id(new ConpherenceTransaction())
|
pht('This server only supports these image formats: %s.',
|
||||||
->setTransactionType(ConpherenceTransactionType::TYPE_PICTURE)
|
|
||||||
->setNewValue($image_phid);
|
|
||||||
} else {
|
|
||||||
$e_image = pht('Not Supported');
|
|
||||||
$errors[] =
|
|
||||||
pht('This server only supports these image formats: %s.',
|
|
||||||
implode(', ', $supported_formats));
|
implode(', ', $supported_formats));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$title = $request->getStr('title');
|
$title = $request->getStr('title');
|
||||||
|
@ -169,6 +162,7 @@ final class ConpherenceUpdateController extends
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$error_view = id(new AphrontErrorView())
|
$error_view = id(new AphrontErrorView())
|
||||||
->setTitle(pht('Errors editing conpherence.'))
|
->setTitle(pht('Errors editing conpherence.'))
|
||||||
|
->setInsideDialogue(true)
|
||||||
->setErrors($errors);
|
->setErrors($errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,29 +184,26 @@ final class ConpherenceUpdateController extends
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormImageControl())
|
id(new AphrontFormDragAndDropUploadControl())
|
||||||
->setLabel(pht('Change Image'))
|
->setLabel(pht('Change Image'))
|
||||||
->setName('image')
|
->setName('image')
|
||||||
|
->setValue($e_file)
|
||||||
->setCaption('Supported formats: '.implode(', ', $supported_formats))
|
->setCaption('Supported formats: '.implode(', ', $supported_formats))
|
||||||
->setError($e_image)
|
);
|
||||||
);
|
|
||||||
|
|
||||||
// TODO -- fix javelin so we can upload files from a workflow
|
|
||||||
require_celerity_resource('conpherence-update-css');
|
require_celerity_resource('conpherence-update-css');
|
||||||
return $this->buildStandardPageResponse(
|
return id(new AphrontDialogResponse())
|
||||||
array(
|
->setDialog(
|
||||||
$error_view,
|
|
||||||
id(new AphrontDialogView())
|
id(new AphrontDialogView())
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setTitle(pht('Update Conpherence'))
|
->setTitle(pht('Update Conpherence'))
|
||||||
->setWidth(AphrontDialogView::WIDTH_FORM)
|
->setWidth(AphrontDialogView::WIDTH_FORM)
|
||||||
->setSubmitURI($this->getApplicationURI('update/'.$conpherence_id.'/'))
|
->setSubmitURI($this->getApplicationURI('update/'.$conpherence_id.'/'))
|
||||||
->addHiddenInput('action', 'metadata')
|
->addHiddenInput('action', 'metadata')
|
||||||
|
->appendChild($error_view)
|
||||||
->appendChild($form)
|
->appendChild($form)
|
||||||
->addSubmitButton()
|
->addSubmitButton()
|
||||||
->addCancelButton($this->getApplicationURI($conpherence->getID().'/')),
|
->addCancelButton($this->getApplicationURI($conpherence->getID().'/'))
|
||||||
),
|
);
|
||||||
array()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,12 @@ final class ConpherenceViewController extends
|
||||||
$edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
$edit_href = $this->getApplicationURI('update/'.$conpherence->getID().'/');
|
||||||
|
|
||||||
$header =
|
$header =
|
||||||
phutil_render_tag(
|
javelin_render_tag(
|
||||||
'a',
|
'a',
|
||||||
array(
|
array(
|
||||||
'class' => 'edit',
|
'class' => 'edit',
|
||||||
'href' => $edit_href,
|
'href' => $edit_href,
|
||||||
|
'sigil' => 'workflow',
|
||||||
),
|
),
|
||||||
''
|
''
|
||||||
).
|
).
|
||||||
|
|
|
@ -11,6 +11,15 @@ final class AphrontErrorView extends AphrontView {
|
||||||
private $errors;
|
private $errors;
|
||||||
private $severity;
|
private $severity;
|
||||||
private $id;
|
private $id;
|
||||||
|
private $insideDialogue;
|
||||||
|
|
||||||
|
public function setInsideDialogue($inside_dialogue) {
|
||||||
|
$this->insideDialogue = $inside_dialogue;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
public function getInsideDialogue() {
|
||||||
|
return $this->insideDialogue;
|
||||||
|
}
|
||||||
|
|
||||||
public function setTitle($title) {
|
public function setTitle($title) {
|
||||||
$this->title = $title;
|
$this->title = $title;
|
||||||
|
@ -32,6 +41,15 @@ final class AphrontErrorView extends AphrontView {
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getBaseClass() {
|
||||||
|
if ($this->getInsideDialogue()) {
|
||||||
|
$class = 'aphront-error-view-dialogue';
|
||||||
|
} else {
|
||||||
|
$class = 'aphront-error-view';
|
||||||
|
}
|
||||||
|
return $class;
|
||||||
|
}
|
||||||
|
|
||||||
final public function render() {
|
final public function render() {
|
||||||
|
|
||||||
require_celerity_resource('aphront-error-view-css');
|
require_celerity_resource('aphront-error-view-css');
|
||||||
|
@ -69,15 +87,16 @@ final class AphrontErrorView extends AphrontView {
|
||||||
|
|
||||||
$this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
|
$this->severity = nonempty($this->severity, self::SEVERITY_ERROR);
|
||||||
|
|
||||||
$more_classes = array();
|
$classes = array();
|
||||||
$more_classes[] = 'aphront-error-severity-'.$this->severity;
|
$classes[] = $this->getBaseClass();
|
||||||
$more_classes = implode(' ', $more_classes);
|
$classes[] = 'aphront-error-severity-'.$this->severity;
|
||||||
|
$classes = implode(' ', $classes);
|
||||||
|
|
||||||
return phutil_render_tag(
|
return phutil_render_tag(
|
||||||
'div',
|
'div',
|
||||||
array(
|
array(
|
||||||
'id' => $this->id,
|
'id' => $this->id,
|
||||||
'class' => 'aphront-error-view '.$more_classes,
|
'class' => $classes,
|
||||||
),
|
),
|
||||||
$title.
|
$title.
|
||||||
phutil_render_tag(
|
phutil_render_tag(
|
||||||
|
|
|
@ -2,12 +2,19 @@
|
||||||
* @provides aphront-error-view-css
|
* @provides aphront-error-view-css
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.aphront-error-view {
|
.aphront-error-view,
|
||||||
margin: 20px;
|
.aphront-error-view-dialogue {
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.aphront-error-view {
|
||||||
|
margin: 20px;
|
||||||
|
}
|
||||||
|
.aphront-error-view-dialogue {
|
||||||
|
margin: 0px 0px 16px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
.device-phone .aphront-error-view {
|
.device-phone .aphront-error-view {
|
||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
* @provides javelin-behavior-aphront-drag-and-drop
|
* @provides javelin-behavior-aphront-drag-and-drop
|
||||||
* @requires javelin-behavior
|
* @requires javelin-behavior
|
||||||
* javelin-dom
|
* javelin-dom
|
||||||
|
* phabricator-file-upload
|
||||||
* phabricator-drag-and-drop-file-upload
|
* phabricator-drag-and-drop-file-upload
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -16,7 +17,15 @@ JX.behavior('aphront-drag-and-drop', function(config) {
|
||||||
// Show the control, since we have browser support.
|
// Show the control, since we have browser support.
|
||||||
JX.$(config.control).style.display = '';
|
JX.$(config.control).style.display = '';
|
||||||
|
|
||||||
var files = config.value || {};
|
var files = {};
|
||||||
|
if (config.value) {
|
||||||
|
for (var k in config.value) {
|
||||||
|
var file = config.value[k];
|
||||||
|
files[k] = new JX.PhabricatorFileUpload()
|
||||||
|
.setPHID(file.phid)
|
||||||
|
.setMarkup(file.html);
|
||||||
|
}
|
||||||
|
}
|
||||||
var pending = 0;
|
var pending = 0;
|
||||||
|
|
||||||
var list = JX.$(config.list);
|
var list = JX.$(config.list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue