mirror of
https://we.phorge.it/source/phorge.git
synced 2025-03-28 04:00:17 +01:00
Fix two issues with Remarkup in Pholio
Summary: Fixes T10865. - Mock descriptions did not markup. - Image descriptions did not get a proper container `<div />`. Test Plan: - Created a mock with remarkup in the mock description and in an image description. - Viewed mock detail. - Saw list styles render properly in both mock description and image description. Reviewers: chad Reviewed By: chad Maniphest Tasks: T10865 Differential Revision: https://secure.phabricator.com/D15793
This commit is contained in:
parent
623ed1f434
commit
1c0980a26a
2 changed files with 14 additions and 3 deletions
|
@ -173,14 +173,15 @@ final class PholioMockViewController extends PholioController {
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildDescriptionView(PholioMock $mock) {
|
private function buildDescriptionView(PholioMock $mock) {
|
||||||
|
|
||||||
$viewer = $this->getViewer();
|
$viewer = $this->getViewer();
|
||||||
|
|
||||||
$properties = id(new PHUIPropertyListView())
|
$properties = id(new PHUIPropertyListView())
|
||||||
->setUser($viewer);
|
->setUser($viewer);
|
||||||
$description = $mock->getDescription();
|
$description = $mock->getDescription();
|
||||||
|
|
||||||
if (strlen($description)) {
|
if (strlen($description)) {
|
||||||
$properties->addImageContent($description);
|
$properties->addTextContent(
|
||||||
|
new PHUIRemarkupView($viewer, $description));
|
||||||
return id(new PHUIObjectBoxView())
|
return id(new PHUIObjectBoxView())
|
||||||
->setHeaderText(pht('Mock Description'))
|
->setHeaderText(pht('Mock Description'))
|
||||||
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
|
||||||
|
|
|
@ -92,6 +92,16 @@ final class PholioMockImagesView extends AphrontView {
|
||||||
$current_set++;
|
$current_set++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$description = $engine->getOutput($image, 'default');
|
||||||
|
if (strlen($description)) {
|
||||||
|
$description = phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-remarkup',
|
||||||
|
),
|
||||||
|
$description);
|
||||||
|
}
|
||||||
|
|
||||||
$history_uri = '/pholio/image/history/'.$image->getID().'/';
|
$history_uri = '/pholio/image/history/'.$image->getID().'/';
|
||||||
$images[] = array(
|
$images[] = array(
|
||||||
'id' => $image->getID(),
|
'id' => $image->getID(),
|
||||||
|
@ -105,7 +115,7 @@ final class PholioMockImagesView extends AphrontView {
|
||||||
'width' => $x,
|
'width' => $x,
|
||||||
'height' => $y,
|
'height' => $y,
|
||||||
'title' => $image->getName(),
|
'title' => $image->getName(),
|
||||||
'descriptionMarkup' => $engine->getOutput($image, 'default'),
|
'descriptionMarkup' => $description,
|
||||||
'isObsolete' => (bool)$image->getIsObsolete(),
|
'isObsolete' => (bool)$image->getIsObsolete(),
|
||||||
'isImage' => $file->isViewableImage(),
|
'isImage' => $file->isViewableImage(),
|
||||||
'isViewable' => $file->isViewableInBrowser(),
|
'isViewable' => $file->isViewableInBrowser(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue