From f49f1eaa5c772d696c71e6096e16255a386eb35a Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 2 Apr 2012 11:16:05 -0700 Subject: [PATCH] Improve display of long project names in task list UI Summary: - Shorten long project names. - Prevent wrapping. - Fix a double-escaping issue. Test Plan: See screenshots below. Reviewers: btrahan, 20after4 Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D2073 --- src/__celerity_resource_map__.php | 2 +- .../view/taskprojects/ManiphestTaskProjectsView.php | 5 +++-- src/applications/maniphest/view/taskprojects/__init__.php | 1 + webroot/rsrc/css/application/projects/project-tag.css | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php index e873381942..9d60db7181 100644 --- a/src/__celerity_resource_map__.php +++ b/src/__celerity_resource_map__.php @@ -1722,7 +1722,7 @@ celerity_register_resource_map(array( ), 'phabricator-project-tag-css' => array( - 'uri' => '/res/c0a3c26b/rsrc/css/application/projects/project-tag.css', + 'uri' => '/res/6b0a5223/rsrc/css/application/projects/project-tag.css', 'type' => 'css', 'requires' => array( diff --git a/src/applications/maniphest/view/taskprojects/ManiphestTaskProjectsView.php b/src/applications/maniphest/view/taskprojects/ManiphestTaskProjectsView.php index bbb5624544..2dfd97a808 100644 --- a/src/applications/maniphest/view/taskprojects/ManiphestTaskProjectsView.php +++ b/src/applications/maniphest/view/taskprojects/ManiphestTaskProjectsView.php @@ -42,7 +42,8 @@ final class ManiphestTaskProjectsView extends ManiphestView { 'href' => $handle->getURI(), 'class' => 'phabricator-project-tag', ), - phutil_escape_html($handle->getName())); + phutil_escape_html( + phutil_utf8_shorten($handle->getName(), 24))); } if (count($this->handles) > 2) { @@ -60,7 +61,7 @@ final class ManiphestTaskProjectsView extends ManiphestView { 'class' => 'phabricator-project-tag', 'sigil' => 'has-tooltip', 'meta' => array( - 'tip' => phutil_escape_html(implode(', ', $all)), + 'tip' => implode(', ', $all), 'size' => 200, ), ), diff --git a/src/applications/maniphest/view/taskprojects/__init__.php b/src/applications/maniphest/view/taskprojects/__init__.php index 4f67f3baf6..3317a2acee 100644 --- a/src/applications/maniphest/view/taskprojects/__init__.php +++ b/src/applications/maniphest/view/taskprojects/__init__.php @@ -12,6 +12,7 @@ phutil_require_module('phabricator', 'infrastructure/javelin/api'); phutil_require_module('phabricator', 'infrastructure/javelin/markup'); phutil_require_module('phutil', 'markup'); +phutil_require_module('phutil', 'utils'); phutil_require_source('ManiphestTaskProjectsView.php'); diff --git a/webroot/rsrc/css/application/projects/project-tag.css b/webroot/rsrc/css/application/projects/project-tag.css index 1696cb8c67..2e8839acd3 100644 --- a/webroot/rsrc/css/application/projects/project-tag.css +++ b/webroot/rsrc/css/application/projects/project-tag.css @@ -18,6 +18,8 @@ -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; + + white-space: nowrap; } .phabricator-project-tag:hover {