Home - limit "status" queries to 100 and show 99+ if we hit that
Summary: Fixes T6595. This diff has two issues as is... 1) the differential data fetching is pretty cheesey, but it looks like we can't just issue three separate databases to get the right data? 2) the translations break, since I am turning this into a string (and not an int) so the whole pluralization bit fails. I think 1 is okay as is and 2 needs to be fixed though I am not sure how to best do that... Test Plan: loaded home page and it looked nice...! Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6595 Differential Revision: https://secure.phabricator.com/D10979
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
*/
|
||||
abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
||||
|
||||
const MAX_STATUS_ITEMS = 100;
|
||||
|
||||
const GROUP_CORE = 'core';
|
||||
const GROUP_UTILITIES = 'util';
|
||||
const GROUP_ADMIN = 'admin';
|
||||
@@ -231,6 +233,22 @@ abstract class PhabricatorApplication implements PhabricatorPolicyInterface {
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @task ui
|
||||
*/
|
||||
public static function formatStatusCount(
|
||||
$count,
|
||||
$limit_string = '%s',
|
||||
$base_string = '%d') {
|
||||
if ($count == self::MAX_STATUS_ITEMS) {
|
||||
$count_str = pht($limit_string, ($count - 1).'+');
|
||||
} else {
|
||||
$count_str = pht($base_string, $count);
|
||||
}
|
||||
return $count_str;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* You can provide an optional piece of flavor text for the application. This
|
||||
|
||||
Reference in New Issue
Block a user