@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a masked image to Pholio Inline Comment Dialog

Summary: n/a

Test Plan:
Tested both ajax and regular pages, test various comments, images.

{F168592}

{F168593}

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D9630

+53 -12
+2 -2
resources/celerity/map.php
··· 80 80 'rsrc/css/application/people/people-profile.css' => 'ba7b2762', 81 81 'rsrc/css/application/phame/phame.css' => '19ecc703', 82 82 'rsrc/css/application/pholio/pholio-edit.css' => '3ad9d1ee', 83 - 'rsrc/css/application/pholio/pholio-inline-comments.css' => '95004a57', 83 + 'rsrc/css/application/pholio/pholio-inline-comments.css' => '286e6be7', 84 84 'rsrc/css/application/pholio/pholio.css' => 'd0502625', 85 85 'rsrc/css/application/phortune/phortune-credit-card-form.css' => 'b25b4beb', 86 86 'rsrc/css/application/phrequent/phrequent.css' => 'ffc185ad', ··· 754 754 'phame-css' => '19ecc703', 755 755 'pholio-css' => 'd0502625', 756 756 'pholio-edit-css' => '3ad9d1ee', 757 - 'pholio-inline-comments-css' => '95004a57', 757 + 'pholio-inline-comments-css' => '286e6be7', 758 758 'phortune-credit-card-form' => '2290aeef', 759 759 'phortune-credit-card-form-css' => 'b25b4beb', 760 760 'phrequent-css' => 'ffc185ad',
+43 -10
src/applications/pholio/controller/PholioInlineController.php
··· 14 14 15 15 if ($this->id) { 16 16 $inline = id(new PholioTransactionComment())->load($this->id); 17 + 17 18 if (!$inline) { 18 19 return new Aphront404Response(); 19 20 } ··· 58 59 $mock_uri = '/'; 59 60 60 61 if ($mode == 'view') { 62 + require_celerity_resource('pholio-inline-comments-css'); 63 + $image = id(new PholioImageQuery()) 64 + ->setViewer($viewer) 65 + ->withIDs(array($inline->getImageID())) 66 + ->executeOne(); 61 67 62 68 $handles = $this->loadViewerHandles(array($inline->getAuthorPHID())); 63 69 $author_handle = $handles[$inline->getAuthorPHID()]; 64 70 65 - return $this->newDialog() 66 - ->setTitle(pht('Inline Comment')) 67 - ->appendParagraph( 68 - phutil_tag( 69 - 'em', 70 - array(), 71 - pht('%s comments:', $author_handle->getName()))) 72 - ->appendParagraph( 73 - PhabricatorMarkupEngine::renderOneObject( 71 + $file = $image->getFile(); 72 + if (!$file->isViewableImage()) { 73 + throw new Exception('File is not viewable.'); 74 + } 75 + 76 + $image_uri = $file->getBestURI(); 77 + 78 + $thumb = id(new PHUIImageMaskView()) 79 + ->addClass('mrl') 80 + ->setImage($image_uri) 81 + ->setDisplayHeight(200) 82 + ->setDisplayWidth(498) 83 + ->withMask(true) 84 + ->centerViewOnPoint( 85 + $inline->getX(), $inline->getY(), 86 + $inline->getHeight(), $inline->getWidth()); 87 + 88 + $comment_head = phutil_tag( 89 + 'div', 90 + array( 91 + 'class' => 'pholio-inline-comment-head', 92 + ), 93 + $author_handle->renderLink()); 94 + 95 + $comment_body = phutil_tag( 96 + 'div', 97 + array( 98 + 'class' => 'pholio-inline-comment-body', 99 + ), 100 + PhabricatorMarkupEngine::renderOneObject( 74 101 id(new PhabricatorMarkupOneOff()) 75 102 ->setContent($inline->getContent()), 76 103 'default', 77 - $viewer)) 104 + $viewer)); 105 + 106 + return $this->newDialog() 107 + ->setTitle(pht('Inline Comment')) 108 + ->appendChild($thumb) 109 + ->appendChild($comment_head) 110 + ->appendChild($comment_body) 78 111 ->addCancelButton($mock_uri, pht('Close')); 79 112 } 80 113
+8
webroot/rsrc/css/application/pholio/pholio-inline-comments.css
··· 2 2 * @provides pholio-inline-comments-css 3 3 */ 4 4 5 + .pholio-inline-comment-head { 6 + padding: 8px 0; 7 + color: {$greytext}; 8 + } 9 + 10 + .pholio-inline-comment-head a { 11 + font-weight: bold; 12 + } 5 13