@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.

Bug fix for diffusion browse views for images and binary files

Summary: D3499 introduced some new hotness but broke these less common cases. add slightly updated ui for this. Note we need a 'download' icon for this UI to not be horrendous.

Test Plan: viewed a binary file and an image in diffusion browse view

Reviewers: epriestley

Reviewed By: epriestley

CC: nh, aran, Korvin

Maniphest Tasks: T1997

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

+27 -22
+27 -22
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 744 744 } 745 745 746 746 private function buildImageCorpus($file_uri) { 747 - $panel = new AphrontPanelView(); 748 - $panel->setHeader('Image'); 749 - $panel->addButton($this->renderEditButton()); 750 - $panel->appendChild( 747 + $properties = new PhabricatorPropertyListView(); 748 + 749 + $properties->addProperty( 750 + pht('Image'), 751 751 phutil_render_tag( 752 752 'img', 753 753 array( 754 754 'src' => $file_uri, 755 755 ))); 756 - return $panel; 756 + 757 + $actions = id(new PhabricatorActionListView()) 758 + ->setUser($this->getRequest()->getUser()) 759 + ->addAction($this->createEditAction()); 760 + 761 + return array($actions, $properties); 757 762 } 758 763 759 764 private function buildBinaryCorpus($file_uri, $data) { 760 - $panel = new AphrontPanelView(); 761 - $panel->setHeader('Binary File'); 762 - $panel->addButton($this->renderEditButton()); 763 - $panel->appendChild( 764 - '<p>'. 765 - 'This is a binary file. '. 766 - 'It is '.number_format(strlen($data)).' bytes in length.'. 767 - '</p>'); 768 - $panel->addButton( 769 - phutil_render_tag( 770 - 'a', 771 - array( 772 - 'href' => $file_uri, 773 - 'class' => 'button green', 774 - ), 775 - 'Download Binary File...')); 776 - return $panel; 765 + $properties = new PhabricatorPropertyListView(); 766 + 767 + $properties->addTextContent( 768 + pht('This is a binary file. It is %d bytes in length.', 769 + number_format(strlen($data))) 770 + ); 771 + 772 + $actions = id(new PhabricatorActionListView()) 773 + ->setUser($this->getRequest()->getUser()) 774 + ->addAction($this->createEditAction()) 775 + ->addAction(id(new PhabricatorActionView()) 776 + ->setName(pht('Download Binary File...')) 777 + ->setIcon('download') 778 + ->setHref($file_uri)); 779 + 780 + return array($actions, $properties); 781 + 777 782 } 778 783 779 784 private function buildBeforeResponse($before) {