1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Display full picture in image macro editing

Summary:
Users are complaining that they don't see how the image macro looks until they use it.
Click leads to edit form.
Display it there.

Test Plan:
Edited macro.
Attempted to create macro with duplicate name.

Reviewers: epriestley

Reviewed By: epriestley

CC: chad, aran, Korvin

Differential Revision: https://secure.phabricator.com/D3636
This commit is contained in:
vrana 2012-10-04 18:43:49 -07:00
parent dfe5ae08aa
commit c4aaa7291b

View file

@ -38,6 +38,7 @@ final class PhabricatorMacroEditController
$errors = array();
$e_name = true;
$file = null;
$request = $this->getRequest();
$user = $request->getUser();
@ -75,6 +76,18 @@ final class PhabricatorMacroEditController
$e_name = 'Duplicate';
}
}
} else if ($this->id) {
$file = id(new PhabricatorFile())
->loadOneWhere('phid = %s', $macro->getFilePHID());
}
$caption = null;
if ($file) {
$caption = phutil_render_tag(
'img',
array(
'src' => $file->getViewURI(),
));
}
if ($errors) {
@ -102,6 +115,7 @@ final class PhabricatorMacroEditController
id(new AphrontFormFileControl())
->setLabel('File')
->setName('file')
->setCaption($caption)
->setError(true))
->appendChild(
id(new AphrontFormSubmitControl())