diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8c3e98a78e..831821ab60 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -7,7 +7,7 @@ */ return array( 'names' => array( - 'core.pkg.css' => 'f03b9892', + 'core.pkg.css' => '85a1b79a', 'core.pkg.js' => '1d376fa9', 'darkconsole.pkg.js' => 'e7393ebb', 'differential.pkg.css' => '3fb7f532', @@ -32,7 +32,7 @@ return array( 'rsrc/css/aphront/typeahead.css' => 'd4f16145', 'rsrc/css/application/almanac/almanac.css' => 'dbb9b3af', 'rsrc/css/application/auth/auth.css' => '0877ed6e', - 'rsrc/css/application/base/main-menu-view.css' => 'e862571a', + 'rsrc/css/application/base/main-menu-view.css' => 'f03e17be', 'rsrc/css/application/base/notification-menu.css' => 'b3ab500d', 'rsrc/css/application/base/phabricator-application-launch-view.css' => '95351601', 'rsrc/css/application/base/phui-theme.css' => '027ba77e', @@ -784,7 +784,7 @@ return array( 'phabricator-flag-css' => '5337623f', 'phabricator-keyboard-shortcut' => '1ae869f2', 'phabricator-keyboard-shortcut-manager' => '4a021c10', - 'phabricator-main-menu-view' => 'e862571a', + 'phabricator-main-menu-view' => 'f03e17be', 'phabricator-nav-view-css' => 'b29426e9', 'phabricator-notification' => 'ccf1cbf8', 'phabricator-notification-css' => '3f6c89c9', @@ -2094,9 +2094,6 @@ return array( 'e6e25838' => array( 'javelin-install', ), - 'e862571a' => array( - 'phui-theme-css', - ), 'e9581f08' => array( 'javelin-behavior', 'javelin-stratcom', @@ -2132,6 +2129,9 @@ return array( 'javelin-workflow', 'javelin-json', ), + 'f03e17be' => array( + 'phui-theme-css', + ), 'f411b6ae' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/src/applications/conpherence/view/ConpherenceDurableColumnView.php b/src/applications/conpherence/view/ConpherenceDurableColumnView.php index d265b37ff7..8475876cc8 100644 --- a/src/applications/conpherence/view/ConpherenceDurableColumnView.php +++ b/src/applications/conpherence/view/ConpherenceDurableColumnView.php @@ -141,12 +141,16 @@ final class ConpherenceDurableColumnView extends AphrontTagView { 'class' => implode(' ', $classes), ), $this->buildHeader()); - $icon_bar = phutil_tag( - 'div', - array( - 'class' => 'conpherence-durable-column-icon-bar', - ), - $this->buildIconBar()); + + $icon_bar = null; + if ($this->conpherences) { + $icon_bar = phutil_tag( + 'div', + array( + 'class' => 'conpherence-durable-column-icon-bar', + ), + $this->buildIconBar()); + } $transactions = $this->buildTransactions(); @@ -283,66 +287,60 @@ final class ConpherenceDurableColumnView extends AphrontTagView { private function buildHeader() { $conpherence = $this->getSelectedConpherence(); - if (!$conpherence) { + $bubble_id = celerity_generate_unique_node_id(); + $dropdown_id = celerity_generate_unique_node_id(); - $header = null; - $settings_button = null; - $settings_menu = null; + $settings_list = new PHUIListView(); + $header_actions = $this->getHeaderActionsConfig($conpherence); + foreach ($header_actions as $action) { + $settings_list->addMenuItem( + id(new PHUIListItemView()) + ->setHref($action['href']) + ->setName($action['name']) + ->setIcon($action['icon']) + ->setDisabled($action['disabled']) + ->addSigil('conpherence-durable-column-header-action') + ->setMetadata(array( + 'action' => $action['key'], + ))); + } - } else { + $settings_menu = phutil_tag( + 'div', + array( + 'id' => $dropdown_id, + 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav '. + 'conpherence-settings-dropdown', + 'sigil' => 'phabricator-notification-menu', + 'style' => 'display: none', + ), + $settings_list); - $bubble_id = celerity_generate_unique_node_id(); - $dropdown_id = celerity_generate_unique_node_id(); + Javelin::initBehavior( + 'aphlict-dropdown', + array( + 'bubbleID' => $bubble_id, + 'dropdownID' => $dropdown_id, + 'local' => true, + 'containerDivID' => 'conpherence-durable-column', + )); - $settings_list = new PHUIListView(); - $header_actions = $this->getHeaderActionsConfig($conpherence); - foreach ($header_actions as $action) { - $settings_list->addMenuItem( - id(new PHUIListItemView()) - ->setHref($action['href']) - ->setName($action['name']) - ->setIcon($action['icon']) - ->setDisabled($action['disabled']) - ->addSigil('conpherence-durable-column-header-action') - ->setMetadata(array( - 'action' => $action['key'], - ))); - } - - $settings_menu = phutil_tag( - 'div', - array( - 'id' => $dropdown_id, - 'class' => 'phabricator-main-menu-dropdown phui-list-sidenav '. - 'conpherence-settings-dropdown', - 'sigil' => 'phabricator-notification-menu', - 'style' => 'display: none', - ), - $settings_list); - - Javelin::initBehavior( - 'aphlict-dropdown', - array( - 'bubbleID' => $bubble_id, - 'dropdownID' => $dropdown_id, - 'local' => true, - 'containerDivID' => 'conpherence-durable-column', - )); - - $item = id(new PHUIListItemView()) - ->setName(pht('Room Actions')) - ->setIcon('fa-bars') - ->addClass('core-menu-item') - ->addSigil('conpherence-settings-menu') - ->setID($bubble_id) - ->setHref('#') - ->setAural(pht('Room Actions')) - ->setOrder(300); - $settings_button = id(new PHUIListView()) - ->addMenuItem($item) - ->addClass('phabricator-dark-menu') - ->addClass('phabricator-application-menu'); + $item = id(new PHUIListItemView()) + ->setName(pht('Room Actions')) + ->setIcon('fa-bars') + ->addClass('core-menu-item') + ->addSigil('conpherence-settings-menu') + ->setID($bubble_id) + ->setHref('#') + ->setAural(pht('Room Actions')) + ->setOrder(300); + $settings_button = id(new PHUIListView()) + ->addMenuItem($item) + ->addClass('phabricator-dark-menu') + ->addClass('phabricator-application-menu'); + $header = null; + if ($conpherence) { $data = $conpherence->getDisplayData($this->getUser()); $header = phutil_tag( 'span', @@ -351,7 +349,7 @@ final class ConpherenceDurableColumnView extends AphrontTagView { $this->getPolicyIcon($conpherence, $this->getPolicyObjects()), $data['title'], )); - } + } return phutil_tag( @@ -372,42 +370,46 @@ final class ConpherenceDurableColumnView extends AphrontTagView { )); } - private function getHeaderActionsConfig(ConpherenceThread $conpherence) { - $can_edit = PhabricatorPolicyFilter::hasCapability( - $this->getUser(), - $conpherence, - PhabricatorPolicyCapability::CAN_EDIT); + private function getHeaderActionsConfig($conpherence) { - return array( - array( + $actions = array(); + if ($conpherence) { + $can_edit = PhabricatorPolicyFilter::hasCapability( + $this->getUser(), + $conpherence, + PhabricatorPolicyCapability::CAN_EDIT); + $actions[] = array( 'name' => pht('Add Participants'), 'disabled' => !$can_edit, 'href' => '/conpherence/update/'.$conpherence->getID().'/', 'icon' => 'fa-plus', 'key' => ConpherenceUpdateActions::ADD_PERSON, - ), - array( + ); + $actions[] = array( 'name' => pht('Edit Room'), 'disabled' => !$can_edit, 'href' => '/conpherence/update/'.$conpherence->getID().'/?nopic', 'icon' => 'fa-pencil', 'key' => ConpherenceUpdateActions::METADATA, - ), - array( + ); + $actions[] = array( 'name' => pht('View in Conpherence'), 'disabled' => false, 'href' => '/'.$conpherence->getMonogram(), 'icon' => 'fa-comments', 'key' => 'go_conpherence', - ), - array( - 'name' => pht('Hide Column'), - 'disabled' => false, - 'href' => '#', - 'icon' => 'fa-times', - 'key' => 'hide_column', - ), + ); + } + + $actions[] = array( + 'name' => pht('Hide Column'), + 'disabled' => false, + 'href' => '#', + 'icon' => 'fa-times', + 'key' => 'hide_column', ); + + return $actions; } private function buildTransactions() { diff --git a/webroot/rsrc/css/application/base/main-menu-view.css b/webroot/rsrc/css/application/base/main-menu-view.css index b5a11d7ba5..0e26dc47a4 100644 --- a/webroot/rsrc/css/application/base/main-menu-view.css +++ b/webroot/rsrc/css/application/base/main-menu-view.css @@ -598,6 +598,7 @@ button.phabricator-main-menu-search-dropdown .caret:before { .phabricator-main-menu-dropdown.phui-list-sidenav .phui-list-item-has-icon .phui-list-item-href { padding: 4px 40px 4px 12px; + white-space: nowrap; } .phabricator-main-menu-dropdown.phui-list-sidenav .phui-list-item-type-label