mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-02 02:40:58 +01:00
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.Also made it less ugly :P Test Plan: By checking out the chatlog application. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5081
This commit is contained in:
parent
9b17870611
commit
c864a73ad2
3 changed files with 27 additions and 20 deletions
|
@ -4,12 +4,18 @@ final class PhabricatorChatLogChannelQuery
|
|||
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||||
|
||||
private $channels;
|
||||
private $channelIDs;
|
||||
|
||||
public function withChannelNames(array $channels) {
|
||||
$this->channels = $channels;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function withIDs(array $channel_ids) {
|
||||
$this->channelIDs = $channel_ids;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function loadPage() {
|
||||
$table = new PhabricatorChatLogChannel();
|
||||
$conn_r = $table->establishConnection('r');
|
||||
|
@ -32,6 +38,14 @@ final class PhabricatorChatLogChannelQuery
|
|||
|
||||
$where[] = $this->buildPagingClause($conn_r);
|
||||
|
||||
if ($this->channelIDs) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
'id IN (%Ld)',
|
||||
$this->channelIDs);
|
||||
|
||||
}
|
||||
|
||||
if ($this->channels) {
|
||||
$where[] = qsprintf(
|
||||
$conn_r,
|
||||
|
|
|
@ -39,12 +39,13 @@ final class PhabricatorChatLogChannelListController
|
|||
'',
|
||||
));
|
||||
|
||||
$title = pht('Channel List.');
|
||||
$title = pht('Channel List');
|
||||
|
||||
$header = id(new PhabricatorHeaderView())
|
||||
->setHeader($title);
|
||||
|
||||
$panel = id(new AphrontPanelView())
|
||||
->appendChild($table)
|
||||
->setNoBackground(true);
|
||||
|
||||
$crumbs = $this
|
||||
|
@ -54,16 +55,12 @@ final class PhabricatorChatLogChannelListController
|
|||
->setName(pht('Channel List'))
|
||||
->setHref($this->getApplicationURI()));
|
||||
|
||||
$panel->appendChild(
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$crumbs,
|
||||
$header,
|
||||
$table
|
||||
));
|
||||
|
||||
|
||||
return $this->buildStandardPageResponse(
|
||||
$panel,
|
||||
),
|
||||
array(
|
||||
'title' => 'Channel List',
|
||||
));
|
||||
|
|
|
@ -4,11 +4,9 @@ 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() {
|
||||
|
@ -26,15 +24,13 @@ final class PhabricatorChatLogChannelLogController
|
|||
->setViewer($user)
|
||||
->withChannelIDs(array($this->channelID));
|
||||
|
||||
$channels = id(new PhabricatorChatLogChannelQuery())
|
||||
$channel = id(new PhabricatorChatLogChannelQuery())
|
||||
->setViewer($user)
|
||||
->execute();
|
||||
->withIDs(array($this->channelID))
|
||||
->executeOne();
|
||||
|
||||
foreach ($channels as $channel) {
|
||||
if ($channel->getID() == $this->channelID) {
|
||||
$this->channelName = $channel->getChannelName();
|
||||
break;
|
||||
}
|
||||
if (!$channel) {
|
||||
return new Aphront404Response();
|
||||
}
|
||||
|
||||
list($after, $before, $map) = $this->getPagingParameters($request, $query);
|
||||
|
@ -138,14 +134,13 @@ final class PhabricatorChatLogChannelLogController
|
|||
->buildApplicationCrumbs()
|
||||
->addCrumb(
|
||||
id(new PhabricatorCrumbView())
|
||||
->setName($this->channelName)
|
||||
->setName($channel->getChannelName())
|
||||
->setHref($uri));
|
||||
|
||||
$form = id(new AphrontFormView())
|
||||
->setUser($user)
|
||||
->setMethod('GET')
|
||||
->setAction($uri)
|
||||
->appendChild($crumbs)
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Date')
|
||||
|
@ -158,6 +153,7 @@ final class PhabricatorChatLogChannelLogController
|
|||
|
||||
return $this->buildStandardPageResponse(
|
||||
array(
|
||||
$crumbs,
|
||||
hsprintf(
|
||||
'<div class="phabricator-chat-log-panel">%s<br />%s%s</div>',
|
||||
$form->render(),
|
||||
|
|
Loading…
Reference in a new issue