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

Make content more prominent in Files and move some details to the curtain

Summary: Ref T13528. Now that we're hinting users into Files, put the content first and move the detail panel under it. Move the most-useful details (author, size, dimensions) into the curtain.

Test Plan: {F7409925}

Maniphest Tasks: T13528

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

+48 -51
+48 -51
src/applications/files/controller/PhabricatorFileViewController.php
··· 81 81 ->setCurtain($curtain) 82 82 ->setMainColumn( 83 83 array( 84 - $object_box, 85 84 $file_content, 85 + $object_box, 86 86 $timeline, 87 87 )); 88 88 ··· 171 171 ->setIcon('fa-crop') 172 172 ->setHref($this->getApplicationURI("/transforms/{$id}/"))); 173 173 174 + $phids = array(); 175 + 176 + $viewer_phid = $viewer->getPHID(); 177 + $author_phid = $file->getAuthorPHID(); 178 + if ($author_phid) { 179 + $phids[] = $author_phid; 180 + } 181 + 182 + $handles = $viewer->loadHandles($phids); 183 + 184 + if ($author_phid) { 185 + $author_refs = id(new PHUICurtainObjectRefListView()) 186 + ->setViewer($viewer); 187 + 188 + $author_ref = $author_refs->newObjectRefView() 189 + ->setHandle($handles[$author_phid]) 190 + ->setEpoch($file->getDateCreated()) 191 + ->setHighlighted($author_phid === $viewer_phid); 192 + 193 + $curtain->newPanel() 194 + ->setHeaderText(pht('Authored By')) 195 + ->appendChild($author_refs); 196 + } 197 + 198 + $curtain->newPanel() 199 + ->setHeaderText(pht('Size')) 200 + ->appendChild(phutil_format_bytes($file->getByteSize())); 201 + 202 + $width = $file->getImageWidth(); 203 + $height = $file->getImageHeight(); 204 + 205 + if ($width || $height) { 206 + $curtain->newPanel() 207 + ->setHeaderText(pht('Dimensions')) 208 + ->appendChild( 209 + pht( 210 + "%spx \xC3\x97 %spx", 211 + new PhutilNumber($width), 212 + new PhutilNumber($height))); 213 + } 214 + 174 215 return $curtain; 175 216 } 176 217 ··· 183 224 $tab_group = id(new PHUITabGroupView()); 184 225 $box->addTabGroup($tab_group); 185 226 186 - $properties = id(new PHUIPropertyListView()); 227 + $finfo = new PHUIPropertyListView(); 187 228 188 229 $tab_group->addTab( 189 230 id(new PHUITabView()) 190 231 ->setName(pht('Details')) 191 232 ->setKey('details') 192 - ->appendChild($properties)); 193 - 194 - if ($file->getAuthorPHID()) { 195 - $properties->addProperty( 196 - pht('Author'), 197 - $viewer->renderHandle($file->getAuthorPHID())); 198 - } 199 - 200 - $properties->addProperty( 201 - pht('Created'), 202 - phabricator_datetime($file->getDateCreated(), $viewer)); 203 - 204 - $finfo = id(new PHUIPropertyListView()); 205 - 206 - $tab_group->addTab( 207 - id(new PHUITabView()) 208 - ->setName(pht('File Info')) 209 - ->setKey('info') 210 233 ->appendChild($finfo)); 211 234 212 235 $finfo->addProperty( 213 - pht('Size'), 214 - phutil_format_bytes($file->getByteSize())); 215 - 216 - $finfo->addProperty( 217 236 pht('Mime Type'), 218 237 $file->getMimeType()); 219 238 ··· 229 248 phutil_format_relative_time_detailed($delta))); 230 249 } 231 250 232 - $width = $file->getImageWidth(); 233 - if ($width) { 234 - $finfo->addProperty( 235 - pht('Width'), 236 - pht('%s px', new PhutilNumber($width))); 237 - } 238 - 239 - $height = $file->getImageHeight(); 240 - if ($height) { 241 - $finfo->addProperty( 242 - pht('Height'), 243 - pht('%s px', new PhutilNumber($height))); 244 - } 245 - 246 251 $is_image = $file->isViewableImage(); 247 252 if ($is_image) { 248 253 $image_string = pht('Yes'); ··· 283 288 $finfo->addProperty(pht('Attributes'), $types); 284 289 } 285 290 286 - $storage_properties = new PHUIPropertyListView(); 287 - 288 - $tab_group->addTab( 289 - id(new PHUITabView()) 290 - ->setName(pht('Storage')) 291 - ->setKey('storage') 292 - ->appendChild($storage_properties)); 293 - 294 - $storage_properties->addProperty( 295 - pht('Engine'), 291 + $finfo->addProperty( 292 + pht('Storage Engine'), 296 293 $file->getStorageEngine()); 297 294 298 295 $engine = $this->loadStorageEngine($file); ··· 307 304 $format_name = pht('Unknown ("%s")', $format_key); 308 305 } 309 306 } 310 - $storage_properties->addProperty(pht('Format'), $format_name); 307 + $finfo->addProperty(pht('Storage Format'), $format_name); 311 308 312 - $storage_properties->addProperty( 313 - pht('Handle'), 309 + $finfo->addProperty( 310 + pht('Storage Handle'), 314 311 $file->getStorageHandle()); 315 312 316 313