mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Don't show tag when no topic is set
Summary: Check the strlen of topic before adding a tag to the header in Conpherence. Test Plan: Remove a topic, no longer see indigo bubble. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D17715
This commit is contained in:
parent
ffed156981
commit
c98be54bf4
1 changed files with 9 additions and 6 deletions
|
@ -60,19 +60,22 @@ abstract class ConpherenceController extends PhabricatorController {
|
|||
|
||||
if ($conpherence->getID()) {
|
||||
$data = $conpherence->getDisplayData($this->getViewer());
|
||||
$topic = id(new PHUITagView())
|
||||
->setName($data['topic'])
|
||||
->setShade(PHUITagView::COLOR_VIOLET)
|
||||
->setType(PHUITagView::TYPE_SHADE)
|
||||
->addClass('conpherence-header-topic');
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setViewer($viewer)
|
||||
->setHeader($data['title'])
|
||||
->addTag($topic)
|
||||
->setPolicyObject($conpherence)
|
||||
->setImage($data['image']);
|
||||
|
||||
if (strlen($data['topic'])) {
|
||||
$topic = id(new PHUITagView())
|
||||
->setName($data['topic'])
|
||||
->setShade(PHUITagView::COLOR_VIOLET)
|
||||
->setType(PHUITagView::TYPE_SHADE)
|
||||
->addClass('conpherence-header-topic');
|
||||
$header->addTag($topic);
|
||||
}
|
||||
|
||||
$can_edit = PhabricatorPolicyFilter::hasCapability(
|
||||
$viewer,
|
||||
$conpherence,
|
||||
|
|
Loading…
Reference in a new issue