Allows a button type for menus, used in Conpherence
Summary: This adds a new menu item, TYPEBUTTON, for use in Conpherence and maybe others over time. Note I need to add icon support, but I'll make them later tonight. I also changed the front facing names to 'Conversations' which is way more natural. Basically, Pholio has Mocks, Differential has Diffs, Conpherence has Conversations. Test Plan: Tested Conpherence on mobile and desktop. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2430 Differential Revision: https://secure.phabricator.com/D4691
This commit is contained in:
		@@ -2935,7 +2935,7 @@ celerity_register_resource_map(array(
 | 
			
		||||
  ),
 | 
			
		||||
  'phabricator-side-menu-view-css' =>
 | 
			
		||||
  array(
 | 
			
		||||
    'uri' => '/res/2013e94f/rsrc/css/layout/phabricator-side-menu-view.css',
 | 
			
		||||
    'uri' => '/res/28a1e092/rsrc/css/layout/phabricator-side-menu-view.css',
 | 
			
		||||
    'type' => 'css',
 | 
			
		||||
    'requires' =>
 | 
			
		||||
    array(
 | 
			
		||||
@@ -3380,7 +3380,7 @@ celerity_register_resource_map(array(
 | 
			
		||||
), array(
 | 
			
		||||
  'packages' =>
 | 
			
		||||
  array(
 | 
			
		||||
    'feecd595' =>
 | 
			
		||||
    '0cb71c48' =>
 | 
			
		||||
    array(
 | 
			
		||||
      'name' => 'core.pkg.css',
 | 
			
		||||
      'symbols' =>
 | 
			
		||||
@@ -3424,7 +3424,7 @@ celerity_register_resource_map(array(
 | 
			
		||||
        36 => 'phabricator-object-item-list-view-css',
 | 
			
		||||
        37 => 'global-drag-and-drop-css',
 | 
			
		||||
      ),
 | 
			
		||||
      'uri' => '/res/pkg/feecd595/core.pkg.css',
 | 
			
		||||
      'uri' => '/res/pkg/0cb71c48/core.pkg.css',
 | 
			
		||||
      'type' => 'css',
 | 
			
		||||
    ),
 | 
			
		||||
    '8a3f0fbd' =>
 | 
			
		||||
@@ -3614,19 +3614,19 @@ celerity_register_resource_map(array(
 | 
			
		||||
  'reverse' =>
 | 
			
		||||
  array(
 | 
			
		||||
    'aphront-attached-file-view-css' => 'e30a3fa8',
 | 
			
		||||
    'aphront-crumbs-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-dialog-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-error-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-form-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-crumbs-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-dialog-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-error-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-form-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-headsup-action-list-view-css' => 'ec01d039',
 | 
			
		||||
    'aphront-headsup-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-list-filter-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-pager-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-panel-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-table-view-css' => 'feecd595',
 | 
			
		||||
    'aphront-tokenizer-control-css' => 'feecd595',
 | 
			
		||||
    'aphront-tooltip-css' => 'feecd595',
 | 
			
		||||
    'aphront-typeahead-control-css' => 'feecd595',
 | 
			
		||||
    'aphront-headsup-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-list-filter-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-pager-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-panel-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-table-view-css' => '0cb71c48',
 | 
			
		||||
    'aphront-tokenizer-control-css' => '0cb71c48',
 | 
			
		||||
    'aphront-tooltip-css' => '0cb71c48',
 | 
			
		||||
    'aphront-typeahead-control-css' => '0cb71c48',
 | 
			
		||||
    'differential-changeset-view-css' => 'ec01d039',
 | 
			
		||||
    'differential-core-view-css' => 'ec01d039',
 | 
			
		||||
    'differential-inline-comment-editor' => '9dae5f20',
 | 
			
		||||
@@ -3640,7 +3640,7 @@ celerity_register_resource_map(array(
 | 
			
		||||
    'differential-table-of-contents-css' => 'ec01d039',
 | 
			
		||||
    'diffusion-commit-view-css' => 'c8ce2d88',
 | 
			
		||||
    'diffusion-icons-css' => 'c8ce2d88',
 | 
			
		||||
    'global-drag-and-drop-css' => 'feecd595',
 | 
			
		||||
    'global-drag-and-drop-css' => '0cb71c48',
 | 
			
		||||
    'inline-comment-summary-css' => 'ec01d039',
 | 
			
		||||
    'javelin-aphlict' => '8a3f0fbd',
 | 
			
		||||
    'javelin-behavior' => 'fbeded59',
 | 
			
		||||
@@ -3710,48 +3710,48 @@ celerity_register_resource_map(array(
 | 
			
		||||
    'javelin-util' => 'fbeded59',
 | 
			
		||||
    'javelin-vector' => 'fbeded59',
 | 
			
		||||
    'javelin-workflow' => 'fbeded59',
 | 
			
		||||
    'lightbox-attachment-css' => 'feecd595',
 | 
			
		||||
    'lightbox-attachment-css' => '0cb71c48',
 | 
			
		||||
    'maniphest-task-summary-css' => 'e30a3fa8',
 | 
			
		||||
    'maniphest-transaction-detail-css' => 'e30a3fa8',
 | 
			
		||||
    'phabricator-busy' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-content-source-view-css' => 'ec01d039',
 | 
			
		||||
    'phabricator-core-buttons-css' => 'feecd595',
 | 
			
		||||
    'phabricator-core-css' => 'feecd595',
 | 
			
		||||
    'phabricator-crumbs-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-directory-css' => 'feecd595',
 | 
			
		||||
    'phabricator-core-buttons-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-core-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-crumbs-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-directory-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-drag-and-drop-file-upload' => '9dae5f20',
 | 
			
		||||
    'phabricator-dropdown-menu' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-file-upload' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-filetree-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-flag-css' => 'feecd595',
 | 
			
		||||
    'phabricator-form-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-header-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-jump-nav' => 'feecd595',
 | 
			
		||||
    'phabricator-filetree-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-flag-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-form-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-header-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-jump-nav' => '0cb71c48',
 | 
			
		||||
    'phabricator-keyboard-shortcut' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-keyboard-shortcut-manager' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-main-menu-view' => 'feecd595',
 | 
			
		||||
    'phabricator-main-menu-view' => '0cb71c48',
 | 
			
		||||
    'phabricator-menu-item' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-nav-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-nav-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-notification' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-notification-css' => 'feecd595',
 | 
			
		||||
    'phabricator-notification-menu-css' => 'feecd595',
 | 
			
		||||
    'phabricator-object-item-list-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-notification-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-notification-menu-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-object-item-list-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-object-selector-css' => 'ec01d039',
 | 
			
		||||
    'phabricator-paste-file-upload' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-prefab' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-project-tag-css' => 'e30a3fa8',
 | 
			
		||||
    'phabricator-remarkup-css' => 'feecd595',
 | 
			
		||||
    'phabricator-remarkup-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-shaped-request' => '9dae5f20',
 | 
			
		||||
    'phabricator-side-menu-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-standard-page-view' => 'feecd595',
 | 
			
		||||
    'phabricator-side-menu-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-standard-page-view' => '0cb71c48',
 | 
			
		||||
    'phabricator-textareautils' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-tooltip' => '8a3f0fbd',
 | 
			
		||||
    'phabricator-transaction-view-css' => 'feecd595',
 | 
			
		||||
    'phabricator-zindex-css' => 'feecd595',
 | 
			
		||||
    'sprite-apps-large-css' => 'feecd595',
 | 
			
		||||
    'sprite-gradient-css' => 'feecd595',
 | 
			
		||||
    'sprite-icon-css' => 'feecd595',
 | 
			
		||||
    'sprite-menu-css' => 'feecd595',
 | 
			
		||||
    'syntax-highlighting-css' => 'feecd595',
 | 
			
		||||
    'phabricator-transaction-view-css' => '0cb71c48',
 | 
			
		||||
    'phabricator-zindex-css' => '0cb71c48',
 | 
			
		||||
    'sprite-apps-large-css' => '0cb71c48',
 | 
			
		||||
    'sprite-gradient-css' => '0cb71c48',
 | 
			
		||||
    'sprite-icon-css' => '0cb71c48',
 | 
			
		||||
    'sprite-menu-css' => '0cb71c48',
 | 
			
		||||
    'syntax-highlighting-css' => '0cb71c48',
 | 
			
		||||
  ),
 | 
			
		||||
));
 | 
			
		||||
 
 | 
			
		||||
@@ -107,9 +107,9 @@ abstract class ConpherenceController extends PhabricatorController {
 | 
			
		||||
    $nav->addClass('conpherence-menu');
 | 
			
		||||
    $nav->setMenuID('conpherence-menu');
 | 
			
		||||
 | 
			
		||||
    $nav->addFilter(
 | 
			
		||||
    $nav->addButton(
 | 
			
		||||
      'new',
 | 
			
		||||
      pht('New Conpherence'),
 | 
			
		||||
      pht('New Conversation'),
 | 
			
		||||
      $this->getApplicationURI('new/')
 | 
			
		||||
    );
 | 
			
		||||
    $nav->addLabel(pht('Unread'));
 | 
			
		||||
@@ -171,7 +171,7 @@ abstract class ConpherenceController extends PhabricatorController {
 | 
			
		||||
      array(
 | 
			
		||||
        'class' => 'no-conpherences-menu-item'
 | 
			
		||||
      ),
 | 
			
		||||
      pht('No more conpherences.')
 | 
			
		||||
      pht('No more conversations.')
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@@ -185,7 +185,7 @@ abstract class ConpherenceController extends PhabricatorController {
 | 
			
		||||
    $crumbs
 | 
			
		||||
      ->addAction(
 | 
			
		||||
        id(new PhabricatorMenuItemView())
 | 
			
		||||
          ->setName(pht('New Conpherence'))
 | 
			
		||||
          ->setName(pht('New Conversation'))
 | 
			
		||||
          ->setHref($this->getApplicationURI('new/'))
 | 
			
		||||
          ->setIcon('create')
 | 
			
		||||
      )
 | 
			
		||||
 
 | 
			
		||||
@@ -12,7 +12,7 @@ final class ConpherenceNewController extends ConpherenceController {
 | 
			
		||||
    $conpherence = id(new ConpherenceThread())
 | 
			
		||||
      ->attachParticipants(array())
 | 
			
		||||
      ->attachFilePHIDs(array());
 | 
			
		||||
    $title = pht('New Conpherence');
 | 
			
		||||
    $title = pht('New Conversation');
 | 
			
		||||
    $participants = array();
 | 
			
		||||
    $message = '';
 | 
			
		||||
    $files = array();
 | 
			
		||||
 
 | 
			
		||||
@@ -83,13 +83,25 @@ final class AphrontSideNavFilterView extends AphrontView {
 | 
			
		||||
    return $this->menu;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public function addFilter(
 | 
			
		||||
  public function addFilter($key, $name, $uri = null) {
 | 
			
		||||
    return $this->addThing(
 | 
			
		||||
      $key, $name, $uri, PhabricatorMenuItemView::TYPE_LINK);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public function addButton($key, $name, $uri = null) {
 | 
			
		||||
    return $this->addThing(
 | 
			
		||||
      $key, $name, $uri, PhabricatorMenuItemView::TYPE_BUTTON);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  private function addThing(
 | 
			
		||||
    $key,
 | 
			
		||||
    $name,
 | 
			
		||||
    $uri = null) {
 | 
			
		||||
    $uri = null,
 | 
			
		||||
    $type) {
 | 
			
		||||
 | 
			
		||||
    $item = id(new PhabricatorMenuItemView())
 | 
			
		||||
      ->setName($name);
 | 
			
		||||
      ->setName($name)
 | 
			
		||||
      ->setType($type);
 | 
			
		||||
 | 
			
		||||
    if (strlen($key)) {
 | 
			
		||||
      $item->setKey($key);
 | 
			
		||||
 
 | 
			
		||||
@@ -5,6 +5,7 @@ final class PhabricatorMenuItemView extends AphrontTagView {
 | 
			
		||||
  const TYPE_LINK     = 'type-link';
 | 
			
		||||
  const TYPE_SPACER   = 'type-spacer';
 | 
			
		||||
  const TYPE_LABEL    = 'type-label';
 | 
			
		||||
  const TYPE_BUTTON   = 'type-button';
 | 
			
		||||
 | 
			
		||||
  private $name;
 | 
			
		||||
  private $href;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,17 @@ final class PhabricatorMenuView extends AphrontTagView {
 | 
			
		||||
    return $item;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public function newButton($name, $href) {
 | 
			
		||||
    $item = id(new PhabricatorMenuItemView())
 | 
			
		||||
      ->setType(PhabricatorMenuItemView::TYPE_BUTTON)
 | 
			
		||||
      ->setName($name)
 | 
			
		||||
      ->setHref($href);
 | 
			
		||||
 | 
			
		||||
    $this->addMenuItem($item);
 | 
			
		||||
 | 
			
		||||
    return $item;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  public function addMenuItem(PhabricatorMenuItemView $item) {
 | 
			
		||||
    $key = $item->getKey();
 | 
			
		||||
    $this->items[] = $item;
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,25 @@
 | 
			
		||||
  background-color: #000;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.phabricator-dark-menu .phabricator-menu-item-type-button,
 | 
			
		||||
.phabricator-side-menu .phabricator-menu-item-type-button {
 | 
			
		||||
  width: 50%;
 | 
			
		||||
  padding: 5px 8px;
 | 
			
		||||
  display: block;
 | 
			
		||||
  border-radius: 4px;
 | 
			
		||||
  border: 2px solid #000;
 | 
			
		||||
  margin: 10px auto;
 | 
			
		||||
  color: #fff;
 | 
			
		||||
  font-size: 14px;
 | 
			
		||||
  text-shadow: 0px 1px 1px #000000;
 | 
			
		||||
  font-weight: bold;
 | 
			
		||||
  text-align: center;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.phabricator-side-menu .phabricator-menu-item-type-button:hover {
 | 
			
		||||
  background-image: url(/rsrc/image/texture/dark-menu-hover.png);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.device-desktop .phabricator-side-menu a.phabricator-menu-item-type-link:hover {
 | 
			
		||||
  text-decoration: none;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user