Conversation link as default, permalink for /notice

This commit is contained in:
Mikael Nordfeldth 2014-11-05 19:34:39 +01:00
parent fa4311fa17
commit 5e4f93cc7d
7 changed files with 19 additions and 41 deletions

View File

@ -594,7 +594,7 @@ abstract class ActivityHandlerPlugin extends Plugin
$nli->showNoticeLink(); $nli->showNoticeLink();
$nli->showNoticeSource(); $nli->showNoticeSource();
$nli->showNoticeLocation(); $nli->showNoticeLocation();
$nli->showContext(); $nli->showPermalink();
$nli->showRepeat(); $nli->showRepeat();
$nli->showNoticeOptions(); $nli->showNoticeOptions();

View File

@ -139,9 +139,7 @@ class NoticeListItem extends Widget
$this->showNoticeLink(); $this->showNoticeLink();
$this->showNoticeSource(); $this->showNoticeSource();
$this->showNoticeLocation(); $this->showNoticeLocation();
if ($this->notice->hasConversation()) { $this->showPermalink();
$this->showContext();
}
$this->showRepeat(); $this->showRepeat();
Event::handle('EndShowNoticeInfo', array($this)); Event::handle('EndShowNoticeInfo', array($this));
} }
@ -311,7 +309,7 @@ class NoticeListItem extends Widget
{ {
$this->out->elementStart('a', array('rel' => 'bookmark', $this->out->elementStart('a', array('rel' => 'bookmark',
'class' => 'u-url timestamp', 'class' => 'u-url timestamp',
'href' => $this->notice->getLocalUrl())); 'href' => Conversation::getUrlFromNotice($this->notice)));
$this->out->element('time', array('class' => 'dt-published', $this->out->element('time', array('class' => 'dt-published',
'datetime' => common_date_iso8601($this->notice->created), 'datetime' => common_date_iso8601($this->notice->created),
// TRANS: Timestamp title (tooltip text) for NoticeListItem // TRANS: Timestamp title (tooltip text) for NoticeListItem
@ -464,20 +462,19 @@ class NoticeListItem extends Widget
} }
/** /**
* show link to notice this notice is a reply to * show link to single-notice view for this notice item
* *
* If this notice is a reply, show a link to the notice it is replying to. The * A permalink that goes to this specific object and nothing else
* heavy lifting for figuring out replies happens at save time.
* *
* @return void * @return void
*/ */
function showContext() function showPermalink()
{ {
$this->out->element('a', $this->out->element('a',
array('href' => $this->notice->getConversationUrl(), array('href' => $this->notice->getLocalUrl(),
'class' => 'conversation'), 'class' => 'permalink'),
// TRANS: Addition in notice list item if notice is part of a conversation. // TRANS: Addition in notice list item for single-notice view.
_('in context')); _('permalink'));
} }
/** /**

View File

@ -185,11 +185,6 @@ class ThreadedNoticeListItem extends NoticeListItem
return 3; return 3;
} }
function showContext()
{
// Silence!
}
/** /**
* finish the notice * finish the notice
* *
@ -299,11 +294,6 @@ class ThreadedNoticeListSubItem extends NoticeListItem
// //
} }
function showContext()
{
//
}
function getReplyProfiles() function getReplyProfiles()
{ {
$all = parent::getReplyProfiles(); $all = parent::getReplyProfiles();

View File

@ -69,18 +69,6 @@ class ConversationTreeItem extends NoticeListItem
return; return;
} }
/**
* show link to notice conversation page
*
* Since we're only used on the conversation page, we skip this
*
* @return void
*/
function showContext()
{
return;
}
/** /**
* show people this notice is in reply to * show people this notice is in reply to
* *

View File

@ -146,11 +146,6 @@ class NoticeTreeItem extends NoticeListItem
return; return;
} }
function showContext()
{
return;
}
//Just changing the link... //Just changing the link...
function showReplyLink() function showReplyLink()
{ {

View File

@ -339,7 +339,7 @@ class QnAPlugin extends MicroAppPlugin
$nli->showNoticeLink(); $nli->showNoticeLink();
$nli->showNoticeSource(); $nli->showNoticeSource();
$nli->showNoticeLocation(); $nli->showNoticeLocation();
$nli->showContext(); $nli->showPermalink();
$nli->showRepeat(); $nli->showRepeat();
$nli->showNoticeOptions(); $nli->showNoticeOptions();

View File

@ -983,6 +983,14 @@ content: ":";
display: none; display: none;
} }
.notice .permalink:after {
content: ']';
}
.notice .permalink:before {
content: '[';
}
/* old school conversation style */ /* old school conversation style */
#conversation .notices .notices { #conversation .notices .notices {