1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Conpherence - make timestamps in durable column link to full message in conpherence

Summary: Ref T7757. This diff made me realize that `PhabricatorTransactionView` is only used in Conpherence, as well as that `ConpherenceTransactionView` is more like a rendering class with a few static methods. Going to take a diff after this to clean all that up.

Test Plan: opened up durable column, clicked on timestamp, voila!

Reviewers: chad, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7757

Differential Revision: https://secure.phabricator.com/D12409
This commit is contained in:
Bob Trahan 2015-04-14 11:28:33 -07:00
parent f1a551cb20
commit d90496a719
4 changed files with 36 additions and 8 deletions

View file

@ -44,7 +44,7 @@ return array(
'rsrc/css/application/config/config-welcome.css' => '6abd79be',
'rsrc/css/application/config/setup-issue.css' => '22270af2',
'rsrc/css/application/config/unhandled-exception.css' => '37d4f9a2',
'rsrc/css/application/conpherence/durable-column.css' => '16051a19',
'rsrc/css/application/conpherence/durable-column.css' => '9d3af55b',
'rsrc/css/application/conpherence/menu.css' => 'f389e048',
'rsrc/css/application/conpherence/message-pane.css' => 'e978e4ae',
'rsrc/css/application/conpherence/notification.css' => '72178795',
@ -515,7 +515,7 @@ return array(
'changeset-view-manager' => '58562350',
'config-options-css' => '7fedf08b',
'config-welcome-css' => '6abd79be',
'conpherence-durable-column-view' => '16051a19',
'conpherence-durable-column-view' => '9d3af55b',
'conpherence-menu-css' => 'f389e048',
'conpherence-message-pane-css' => 'e978e4ae',
'conpherence-notification-css' => '72178795',

View file

@ -2,6 +2,7 @@
final class ConpherenceTransactionView extends AphrontView {
private $conpherenceThread;
private $conpherenceTransaction;
private $handles;
private $markupEngine;
@ -24,6 +25,15 @@ final class ConpherenceTransactionView extends AphrontView {
return $this->handles;
}
public function setConpherenceThread(ConpherenceThread $t) {
$this->conpherenceThread = $t;
return $this;
}
private function getConpherenceThread() {
return $this->conpherenceThread;
}
public function setConpherenceTransaction(ConpherenceTransaction $tx) {
$this->conpherenceTransaction = $tx;
return $this;
@ -62,6 +72,7 @@ final class ConpherenceTransactionView extends AphrontView {
public function render() {
$user = $this->getUser();
$transaction = $this->getConpherenceTransaction();
switch ($transaction->getTransactionType()) {
case ConpherenceTransactionType::TYPE_DATE_MARKER:
@ -84,6 +95,7 @@ final class ConpherenceTransactionView extends AphrontView {
break;
}
$conpherence = $this->getConpherenceThread();
$handles = $this->getHandles();
$transaction->setHandles($handles);
$author = $handles[$transaction->getAuthorPHID()];
@ -96,7 +108,9 @@ final class ConpherenceTransactionView extends AphrontView {
phabricator_time($transaction->getDateCreated(), $user));
} else {
$transaction_view
->setEpoch($transaction->getDateCreated())
->setEpoch(
$transaction->getDateCreated(),
'/'.$conpherence->getMonogram().'#'.$transaction->getID())
->setTimeOnly(true);
}
if ($this->getShowContentSource()) {
@ -185,6 +199,7 @@ final class ConpherenceTransactionView extends AphrontView {
$date_marker_transaction_view = id(new ConpherenceTransactionView())
->setUser($user)
->setConpherenceTransaction($date_marker_transaction)
->setConpherenceThread($conpherence)
->setHandles($handles)
->setShowImages($full_display)
->setShowContentSource($full_display)
@ -210,6 +225,7 @@ final class ConpherenceTransactionView extends AphrontView {
$rendered_transactions[] = id(new ConpherenceTransactionView())
->setUser($user)
->setConpherenceTransaction($transaction)
->setConpherenceThread($conpherence)
->setHandles($handles)
->setMarkupEngine($engine)
->setRenderAnchors($full_display)

View file

@ -5,6 +5,7 @@ final class PhabricatorTransactionView extends AphrontView {
private $imageURI;
private $actions = array();
private $epoch;
private $epochHref;
private $contentSource;
private $anchorName;
private $anchorText;
@ -22,8 +23,9 @@ final class PhabricatorTransactionView extends AphrontView {
return $this;
}
public function setEpoch($epoch) {
public function setEpoch($epoch, $epoch_href = null) {
$this->epoch = $epoch;
$this->epochHref = $epoch_href;
return $this;
}
@ -103,10 +105,20 @@ final class PhabricatorTransactionView extends AphrontView {
$info[] = pht('PREVIEW');
} else if ($this->epoch) {
if ($this->timeOnly) {
$info[] = phabricator_time($this->epoch, $this->user);
$epoch = phabricator_time($this->epoch, $this->user);
} else {
$info[] = phabricator_datetime($this->epoch, $this->user);
$epoch = phabricator_datetime($this->epoch, $this->user);
}
if ($this->epochHref) {
$epoch = phutil_tag(
'a',
array(
'href' => $this->epochHref,
'class' => 'epoch-link',
),
$epoch);
}
$info[] = $epoch;
}
if ($this->anchorName) {

View file

@ -199,13 +199,13 @@
.conpherence-durable-column-transactions .phabricator-transaction-detail
.phabricator-transaction-header .phabricator-transaction-info,
.phabricator-transaction-header .anchor-link {
.phabricator-transaction-header .epoch-link {
color: {$lightbluetext};
float: none;
font-size: 12px;
}
.phabricator-transaction-header .anchor-link {
.phabricator-transaction-header .epoch-link {
font-weight: normal;
}