Changeset View
Changeset View
Standalone View
Standalone View
src/applications/meta/view/PhabricatorApplicationLaunchView.php
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | if ($application) { | ||||
| $count = idx($counts, $attention, 0); | $count = idx($counts, $attention, 0); | ||||
| $count1 = $count2 = ''; | $count1 = $count2 = ''; | ||||
| if ($count > 0) { | if ($count > 0) { | ||||
| $count1 = phutil_tag( | $count1 = phutil_tag( | ||||
| 'span', | 'span', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-application-attention-count', | 'class' => 'phabricator-application-attention-count', | ||||
| ), | ), | ||||
| PhabricatorApplication::formatStatusCount($count)); | $this->formatStatusItemCount($count)); | ||||
| } | } | ||||
| if (!empty($counts[$warning])) { | if (!empty($counts[$warning])) { | ||||
| $count2 = phutil_tag( | $count2 = phutil_tag( | ||||
| 'span', | 'span', | ||||
| array( | array( | ||||
| 'class' => 'phabricator-application-warning-count', | 'class' => 'phabricator-application-warning-count', | ||||
| ), | ), | ||||
| PhabricatorApplication::formatStatusCount($counts[$warning])); | $this->formatStatusItemCount($counts[$warning])); | ||||
| } | } | ||||
| if (nonempty($count1) && nonempty($count2)) { | if (nonempty($count1) && nonempty($count2)) { | ||||
| $numbers = array($count1, ' / ', $count2); | $numbers = array($count1, ' / ', $count2); | ||||
| } else { | } else { | ||||
| $numbers = array($count1, $count2); | $numbers = array($count1, $count2); | ||||
| } | } | ||||
| Javelin::initBehavior('phabricator-tooltips'); | Javelin::initBehavior('phabricator-tooltips'); | ||||
| $content[] = javelin_tag( | $content[] = javelin_tag( | ||||
| Show All 32 Lines | protected function getTagContent() { | ||||
| } | } | ||||
| return array( | return array( | ||||
| $icon, | $icon, | ||||
| $content, | $content, | ||||
| ); | ); | ||||
| } | } | ||||
| private function formatStatusItemCount($count) { | |||||
| $limit = PhabricatorApplication::MAX_STATUS_ITEMS; | |||||
| if ($count >= $limit) { | |||||
| return pht('%s+', new PhutilNumber($limit - 1)); | |||||
| } else { | |||||
| return pht('%s', new PhutilNumber($count)); | |||||
| } | |||||
| } | |||||
| } | } | ||||