Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14761207
D8573.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D8573.id.diff
View Options
diff --git a/src/applications/subscriptions/view/SubscriptionListDialogBuilder.php b/src/applications/subscriptions/view/SubscriptionListDialogBuilder.php
--- a/src/applications/subscriptions/view/SubscriptionListDialogBuilder.php
+++ b/src/applications/subscriptions/view/SubscriptionListDialogBuilder.php
@@ -56,7 +56,7 @@
->setClass('subscriber-list-dialog')
->setTitle($this->getTitle())
->appendChild($this->buildBody($this->getViewer(), $handles))
- ->addCancelButton($object_handle->getURI(), pht('Dismiss'));
+ ->addCancelButton($object_handle->getURI(), pht('Close'));
}
private function buildBody(PhabricatorUser $viewer, array $handles) {
@@ -64,11 +64,15 @@
$list = id(new PHUIObjectItemListView())
->setUser($viewer);
foreach ($handles as $handle) {
- // TODO - include $handle image - T4400
$item = id(new PHUIObjectItemView())
->setHeader($handle->getFullName())
->setHref($handle->getURI())
->setDisabled($handle->isDisabled());
+
+ if ($handle->getImageURI()) {
+ $item->setImageURI($handle->getImageURI());
+ }
+
$list->addItem($item);
}
diff --git a/src/applications/subscriptions/view/SubscriptionListStringBuilder.php b/src/applications/subscriptions/view/SubscriptionListStringBuilder.php
--- a/src/applications/subscriptions/view/SubscriptionListStringBuilder.php
+++ b/src/applications/subscriptions/view/SubscriptionListStringBuilder.php
@@ -48,25 +48,24 @@
private function buildString($list_uri) {
$handles = $this->getHandles();
- $html = array();
+ // Always show this many subscribers.
$show_count = 3;
$subscribers_count = count($handles);
- if ($subscribers_count <= $show_count) {
+
+ // It looks a bit silly to render "a, b, c, and 1 other", since we could
+ // have just put that other subscriber there in place of the "1 other"
+ // link. Instead, render "a, b, c, d" in this case, and then when we get one
+ // more render "a, b, c, and 2 others".
+ if ($subscribers_count <= ($show_count + 1)) {
return phutil_implode_html(', ', mpull($handles, 'renderLink'));
}
- $args = array('%s, %s, %s, and %s');
- $shown = 0;
- foreach ($handles as $handle) {
- $shown++;
- if ($shown > $show_count) {
- break;
- }
- $args[] = $handle->renderLink();
- }
+ $show = array_slice($handles, 0, $show_count);
+ $show = array_values($show);
+
$not_shown_count = $subscribers_count - $show_count;
$not_shown_txt = pht('%d other(s)', $not_shown_count);
- $args[] = javelin_tag(
+ $not_shown_link = javelin_tag(
'a',
array(
'href' => $list_uri,
@@ -74,7 +73,12 @@
),
$not_shown_txt);
- return call_user_func_array('pht', $args);
+ return pht(
+ '%s, %s, %s and %s',
+ $show[0]->renderLink(),
+ $show[1]->renderLink(),
+ $show[2]->renderLink(),
+ $not_shown_link);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 23, 11:50 PM (16 h, 51 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7038280
Default Alt Text
D8573.id.diff (2 KB)
Attached To
Mode
D8573: Show profile pictures in subscribers dialog
Attached
Detach File
Event Timeline
Log In to Comment