From 0cdce03b52a0f4bc15c3db188ccdd50b0ab67b82 Mon Sep 17 00:00:00 2001 From: Afaque Hussain Date: Fri, 22 Feb 2013 10:08:25 -0800 Subject: [PATCH] UI Improvements to Chatlog Application Summary: Made improvements to the Chatlog application UI. Added Header & crumbs. Added service name and service type to the channel list table. Test Plan: By checking out the chatlog application. Reviewers: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5079 --- ...habricatorChatLogChannelListController.php | 34 ++++++++++++++++--- ...PhabricatorChatLogChannelLogController.php | 20 +++++++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php index 5416b1baee..13469f5b5e 100644 --- a/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php +++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php @@ -20,21 +20,47 @@ final class PhabricatorChatLogChannelListController 'href' => '/chatlog/channel/'.$channel->getID().'/', ), - $channel->getChannelName())); + $channel->getChannelName()), + $channel->getServiceName(), + $channel->getServiceType()); } $table = new AphrontTableView($rows); $table->setHeaders( array( 'Channel', + 'Service Name', + 'Service Type', )); $table->setColumnClasses( array( - 'pri wide', + '', + '', + '', + )); + + $title = pht('Channel List.'); + + $header = id(new PhabricatorHeaderView()) + ->setHeader($title); + + $panel = id(new AphrontPanelView()) + ->setNoBackground(true); + + $crumbs = $this + ->buildApplicationCrumbs() + ->addCrumb( + id(new PhabricatorCrumbView()) + ->setName(pht('Channel List')) + ->setHref($this->getApplicationURI())); + + $panel->appendChild( + array( + $crumbs, + $header, + $table )); - $panel = new AphrontPanelView(); - $panel->appendChild($table); return $this->buildStandardPageResponse( $panel, diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php index c60c499cd9..1e1cb1a3e2 100644 --- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php +++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php @@ -4,9 +4,11 @@ final class PhabricatorChatLogChannelLogController extends PhabricatorChatLogController { private $channelID; + private $channelName; public function willProcessRequest(array $data) { $this->channelID = $data['channelID']; + $this->channelName = $data['channelName']; } public function processRequest() { @@ -24,6 +26,16 @@ final class PhabricatorChatLogChannelLogController ->setViewer($user) ->withChannelIDs(array($this->channelID)); + $channels = id(new PhabricatorChatLogChannelQuery()) + ->setViewer($user) + ->execute(); + + foreach ($channels as $channel) { + if ($channel->getID() == $this->channelID) { + $this->channelName = $channel->getChannelName(); + break; + } + } list($after, $before, $map) = $this->getPagingParameters($request, $query); @@ -122,10 +134,18 @@ final class PhabricatorChatLogChannelLogController array($author, $message, $timestamp)); } + $crumbs = $this + ->buildApplicationCrumbs() + ->addCrumb( + id(new PhabricatorCrumbView()) + ->setName($this->channelName) + ->setHref($uri)); + $form = id(new AphrontFormView()) ->setUser($user) ->setMethod('GET') ->setAction($uri) + ->appendChild($crumbs) ->appendChild( id(new AphrontFormTextControl()) ->setLabel('Date')