mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-08 02:18:33 +02:00
Touch up Chatlog Design / Mobile
Summary: Updated Chatlog to work on mobile, minor style updates. Test Plan: Tested mobile, Chrome. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D5675
This commit is contained in:
parent
dd4d8067f1
commit
4bbebc06cf
4 changed files with 89 additions and 65 deletions
|
@ -2878,7 +2878,7 @@ celerity_register_resource_map(array(
|
||||||
),
|
),
|
||||||
'phabricator-chatlog-css' =>
|
'phabricator-chatlog-css' =>
|
||||||
array(
|
array(
|
||||||
'uri' => '/res/f6631adc/rsrc/css/application/chatlog/chatlog.css',
|
'uri' => '/res/b5600765/rsrc/css/application/chatlog/chatlog.css',
|
||||||
'type' => 'css',
|
'type' => 'css',
|
||||||
'requires' =>
|
'requires' =>
|
||||||
array(
|
array(
|
||||||
|
|
|
@ -11,43 +11,16 @@ final class PhabricatorChatLogChannelListController
|
||||||
->setViewer($user)
|
->setViewer($user)
|
||||||
->execute();
|
->execute();
|
||||||
|
|
||||||
$rows = array();
|
$list = new PhabricatorObjectItemListView();
|
||||||
foreach ($channels as $channel) {
|
foreach ($channels as $channel) {
|
||||||
$rows[] = array(
|
$item = id(new PhabricatorObjectItemView())
|
||||||
phutil_tag(
|
->setHeader($channel->getChannelName())
|
||||||
'a',
|
->setHref('/chatlog/channel/'.$channel->getID().'/')
|
||||||
array(
|
->addAttribute($channel->getServiceName())
|
||||||
'href' =>
|
->addAttribute($channel->getServiceType());
|
||||||
'/chatlog/channel/'.$channel->getID().'/',
|
$list->addItem($item);
|
||||||
),
|
|
||||||
$channel->getChannelName()),
|
|
||||||
$channel->getServiceName(),
|
|
||||||
$channel->getServiceType());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$table = new AphrontTableView($rows);
|
|
||||||
$table->setHeaders(
|
|
||||||
array(
|
|
||||||
pht('Channel'),
|
|
||||||
pht('Service Name'),
|
|
||||||
pht('Service Type'),
|
|
||||||
));
|
|
||||||
$table->setColumnClasses(
|
|
||||||
array(
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
));
|
|
||||||
|
|
||||||
$title = pht('Channel List');
|
|
||||||
|
|
||||||
$header = id(new PhabricatorHeaderView())
|
|
||||||
->setHeader($title);
|
|
||||||
|
|
||||||
$panel = id(new AphrontPanelView())
|
|
||||||
->appendChild($table)
|
|
||||||
->setNoBackground(true);
|
|
||||||
|
|
||||||
$crumbs = $this
|
$crumbs = $this
|
||||||
->buildApplicationCrumbs()
|
->buildApplicationCrumbs()
|
||||||
->addCrumb(
|
->addCrumb(
|
||||||
|
@ -55,14 +28,15 @@ final class PhabricatorChatLogChannelListController
|
||||||
->setName(pht('Channel List'))
|
->setName(pht('Channel List'))
|
||||||
->setHref($this->getApplicationURI()));
|
->setHref($this->getApplicationURI()));
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$crumbs,
|
||||||
$header,
|
$list,
|
||||||
$panel,
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => pht('Channel List'),
|
'title' => pht('Channel List'),
|
||||||
|
'device' => true,
|
||||||
|
'dust' => true,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,27 +107,36 @@ final class PhabricatorChatLogChannelLogController
|
||||||
$author = phutil_utf8_shorten($author, 18);
|
$author = phutil_utf8_shorten($author, 18);
|
||||||
$author = phutil_tag('td', array('class' => 'author'), $author);
|
$author = phutil_tag('td', array('class' => 'author'), $author);
|
||||||
|
|
||||||
$message = mpull($block['logs'], 'getMessage');
|
|
||||||
$message = implode("\n", $message);
|
|
||||||
$message = phutil_tag('td', array('class' => 'message'), $message);
|
|
||||||
|
|
||||||
$href = $uri->alter('at', $block['id']);
|
$href = $uri->alter('at', $block['id']);
|
||||||
$timestamp = $block['epoch'];
|
$timestamp = $block['epoch'];
|
||||||
$timestamp = phabricator_datetime($timestamp, $user);
|
$timestamp = phabricator_datetime($timestamp, $user);
|
||||||
$timestamp = phutil_tag('a', array('href' => $href), $timestamp);
|
|
||||||
$timestamp = phutil_tag(
|
$timestamp = phutil_tag(
|
||||||
'td',
|
'a',
|
||||||
array(
|
array(
|
||||||
'class' => 'timestamp',
|
'href' => $href,
|
||||||
|
'class' => 'timestamp'
|
||||||
),
|
),
|
||||||
$timestamp);
|
$timestamp);
|
||||||
|
|
||||||
|
$message = mpull($block['logs'], 'getMessage');
|
||||||
|
$message = implode("\n", $message);
|
||||||
|
$message = phutil_tag(
|
||||||
|
'td',
|
||||||
|
array(
|
||||||
|
'class' => 'message'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
$timestamp,
|
||||||
|
$message));
|
||||||
|
|
||||||
$out[] = phutil_tag(
|
$out[] = phutil_tag(
|
||||||
'tr',
|
'tr',
|
||||||
array(
|
array(
|
||||||
'class' => $block['class'],
|
'class' => $block['class'],
|
||||||
),
|
),
|
||||||
array($author, $message, $timestamp));
|
array(
|
||||||
|
$author,
|
||||||
|
$message));
|
||||||
}
|
}
|
||||||
|
|
||||||
$crumbs = $this
|
$crumbs = $this
|
||||||
|
@ -141,6 +150,7 @@ final class PhabricatorChatLogChannelLogController
|
||||||
->setUser($user)
|
->setUser($user)
|
||||||
->setMethod('GET')
|
->setMethod('GET')
|
||||||
->setAction($uri)
|
->setAction($uri)
|
||||||
|
->setNoShading(true)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel(pht('Date'))
|
->setLabel(pht('Date'))
|
||||||
|
@ -150,18 +160,41 @@ final class PhabricatorChatLogChannelLogController
|
||||||
id(new AphrontFormSubmitControl())
|
id(new AphrontFormSubmitControl())
|
||||||
->setValue(pht('Jump')));
|
->setValue(pht('Jump')));
|
||||||
|
|
||||||
|
$filter = new AphrontListFilterView();
|
||||||
|
$filter->appendChild($form);
|
||||||
|
|
||||||
return $this->buildStandardPageResponse(
|
$table = phutil_tag(
|
||||||
|
'table',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-chat-log'
|
||||||
|
),
|
||||||
|
$out);
|
||||||
|
|
||||||
|
$log = phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-chat-log-panel'
|
||||||
|
),
|
||||||
|
$table);
|
||||||
|
|
||||||
|
$content = phutil_tag(
|
||||||
|
'div',
|
||||||
|
array(
|
||||||
|
'class' => 'phabricator-chat-log-wrap'
|
||||||
|
),
|
||||||
|
$log);
|
||||||
|
|
||||||
|
return $this->buildApplicationPage(
|
||||||
array(
|
array(
|
||||||
$crumbs,
|
$crumbs,
|
||||||
hsprintf(
|
$filter,
|
||||||
'<div class="phabricator-chat-log-panel">%s<br />%s%s</div>',
|
$content,
|
||||||
$form->render(),
|
$pager,
|
||||||
phutil_tag('table', array('class' => 'phabricator-chat-log'), $out),
|
|
||||||
$pager->render()),
|
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => pht('Channel Log'),
|
'title' => pht('Channel Log'),
|
||||||
|
'device' => true,
|
||||||
|
'dust' => true,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,30 @@
|
||||||
* @provides phabricator-chatlog-css
|
* @provides phabricator-chatlog-css
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
.phabricator-chat-log-wrap {
|
||||||
|
padding: 0 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.device-phone .phabricator-chat-log-wrap {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.phabricator-chat-log-panel {
|
.phabricator-chat-log-panel {
|
||||||
margin: 1em auto;
|
margin: 20px auto;
|
||||||
width: 80em;
|
border-left: 1px solid #e7e7e7;
|
||||||
|
border-right: 1px solid #e7e7e7;
|
||||||
|
border-bottom: 1px solid #c0c5d1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log {
|
.phabricator-chat-log {
|
||||||
font-size: 12px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border: 1px solid #bbbbbb;
|
border: 1px solid #e7e7e7;
|
||||||
|
box-shadow: 0 1px 1px rgba(0,0,0,.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log td {
|
.phabricator-chat-log td {
|
||||||
padding: 4px 8px;
|
padding: 8px;
|
||||||
|
line-height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log tr {
|
.phabricator-chat-log tr {
|
||||||
|
@ -22,15 +33,16 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log tr td.author {
|
.phabricator-chat-log tr td.author {
|
||||||
background: #dfdfdf;
|
background: #e7e7ee;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log tr.alternate {
|
.phabricator-chat-log tr.alternate {
|
||||||
background: #e9e9e9;
|
border-top: 1px solid #e7e7e7;
|
||||||
|
border-bottom: 1px solid #e7e7e7;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log tr.alternate td.author {
|
.phabricator-chat-log tr.alternate td.author {
|
||||||
background: #d9d9d9;
|
background: #dfdfe6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log tr.highlight td {
|
.phabricator-chat-log tr.highlight td {
|
||||||
|
@ -47,19 +59,24 @@
|
||||||
width: 12em;
|
width: 12em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log td.timestamp a {
|
.phabricator-chat-log td.message .timestamp {
|
||||||
color: #555555;
|
color: #a1a5a9;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.phabricator-chat-log td.author {
|
.phabricator-chat-log td.author {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
width: 12em;
|
width: 140px;
|
||||||
color: #555555;
|
color: #555555;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.device-phone .phabricator-chat-log td.author {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
.phabricator-chat-log td.message {
|
.phabricator-chat-log td.message {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue