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

Show profile pictures in subscribers dialog

Summary: Ref T4400. Also stops rendering "and 1 other" in subscriber lists, since it looks a bit silly in practice (we can just put the other subscriber there instead). Don't do the "and x others" until X is at least 2.

Test Plan: Viewed/clicked subscriber lists and transactions.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T4400

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

+23 -15
+6 -2
src/applications/subscriptions/view/SubscriptionListDialogBuilder.php
··· 56 56 ->setClass('subscriber-list-dialog') 57 57 ->setTitle($this->getTitle()) 58 58 ->appendChild($this->buildBody($this->getViewer(), $handles)) 59 - ->addCancelButton($object_handle->getURI(), pht('Dismiss')); 59 + ->addCancelButton($object_handle->getURI(), pht('Close')); 60 60 } 61 61 62 62 private function buildBody(PhabricatorUser $viewer, array $handles) { ··· 64 64 $list = id(new PHUIObjectItemListView()) 65 65 ->setUser($viewer); 66 66 foreach ($handles as $handle) { 67 - // TODO - include $handle image - T4400 68 67 $item = id(new PHUIObjectItemView()) 69 68 ->setHeader($handle->getFullName()) 70 69 ->setHref($handle->getURI()) 71 70 ->setDisabled($handle->isDisabled()); 71 + 72 + if ($handle->getImageURI()) { 73 + $item->setImageURI($handle->getImageURI()); 74 + } 75 + 72 76 $list->addItem($item); 73 77 } 74 78
+17 -13
src/applications/subscriptions/view/SubscriptionListStringBuilder.php
··· 48 48 private function buildString($list_uri) { 49 49 $handles = $this->getHandles(); 50 50 51 - $html = array(); 51 + // Always show this many subscribers. 52 52 $show_count = 3; 53 53 $subscribers_count = count($handles); 54 - if ($subscribers_count <= $show_count) { 54 + 55 + // It looks a bit silly to render "a, b, c, and 1 other", since we could 56 + // have just put that other subscriber there in place of the "1 other" 57 + // link. Instead, render "a, b, c, d" in this case, and then when we get one 58 + // more render "a, b, c, and 2 others". 59 + if ($subscribers_count <= ($show_count + 1)) { 55 60 return phutil_implode_html(', ', mpull($handles, 'renderLink')); 56 61 } 57 62 58 - $args = array('%s, %s, %s, and %s'); 59 - $shown = 0; 60 - foreach ($handles as $handle) { 61 - $shown++; 62 - if ($shown > $show_count) { 63 - break; 64 - } 65 - $args[] = $handle->renderLink(); 66 - } 63 + $show = array_slice($handles, 0, $show_count); 64 + $show = array_values($show); 65 + 67 66 $not_shown_count = $subscribers_count - $show_count; 68 67 $not_shown_txt = pht('%d other(s)', $not_shown_count); 69 - $args[] = javelin_tag( 68 + $not_shown_link = javelin_tag( 70 69 'a', 71 70 array( 72 71 'href' => $list_uri, ··· 74 73 ), 75 74 $not_shown_txt); 76 75 77 - return call_user_func_array('pht', $args); 76 + return pht( 77 + '%s, %s, %s and %s', 78 + $show[0]->renderLink(), 79 + $show[1]->renderLink(), 80 + $show[2]->renderLink(), 81 + $not_shown_link); 78 82 } 79 83 80 84 }