mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 16:52:41 +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:
parent
dfe5ae08aa
commit
c4aaa7291b
1 changed files with 14 additions and 0 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue