From 5e4f93cc7da1150b2ee3846b4fff86230275a20e Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Wed, 5 Nov 2014 19:34:39 +0100 Subject: [PATCH] Conversation link as default, permalink for /notice --- lib/activityhandlerplugin.php | 2 +- lib/noticelistitem.php | 21 ++++++++----------- lib/threadednoticelist.php | 10 --------- .../lib/conversationtreeitem.php | 12 ----------- .../lib/noticetree.php | 5 ----- plugins/QnA/QnAPlugin.php | 2 +- theme/base/css/display.css | 8 +++++++ 7 files changed, 19 insertions(+), 41 deletions(-) diff --git a/lib/activityhandlerplugin.php b/lib/activityhandlerplugin.php index 59e3d45f17..6a148d9dd5 100644 --- a/lib/activityhandlerplugin.php +++ b/lib/activityhandlerplugin.php @@ -594,7 +594,7 @@ abstract class ActivityHandlerPlugin extends Plugin $nli->showNoticeLink(); $nli->showNoticeSource(); $nli->showNoticeLocation(); - $nli->showContext(); + $nli->showPermalink(); $nli->showRepeat(); $nli->showNoticeOptions(); diff --git a/lib/noticelistitem.php b/lib/noticelistitem.php index c1f4132c19..81fcb72caa 100644 --- a/lib/noticelistitem.php +++ b/lib/noticelistitem.php @@ -139,9 +139,7 @@ class NoticeListItem extends Widget $this->showNoticeLink(); $this->showNoticeSource(); $this->showNoticeLocation(); - if ($this->notice->hasConversation()) { - $this->showContext(); - } + $this->showPermalink(); $this->showRepeat(); Event::handle('EndShowNoticeInfo', array($this)); } @@ -311,7 +309,7 @@ class NoticeListItem extends Widget { $this->out->elementStart('a', array('rel' => 'bookmark', 'class' => 'u-url timestamp', - 'href' => $this->notice->getLocalUrl())); + 'href' => Conversation::getUrlFromNotice($this->notice))); $this->out->element('time', array('class' => 'dt-published', 'datetime' => common_date_iso8601($this->notice->created), // 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 - * heavy lifting for figuring out replies happens at save time. + * A permalink that goes to this specific object and nothing else * * @return void */ - function showContext() + function showPermalink() { $this->out->element('a', - array('href' => $this->notice->getConversationUrl(), - 'class' => 'conversation'), - // TRANS: Addition in notice list item if notice is part of a conversation. - _('in context')); + array('href' => $this->notice->getLocalUrl(), + 'class' => 'permalink'), + // TRANS: Addition in notice list item for single-notice view. + _('permalink')); } /** diff --git a/lib/threadednoticelist.php b/lib/threadednoticelist.php index 15d286dbf9..18d13505c8 100644 --- a/lib/threadednoticelist.php +++ b/lib/threadednoticelist.php @@ -185,11 +185,6 @@ class ThreadedNoticeListItem extends NoticeListItem return 3; } - function showContext() - { - // Silence! - } - /** * finish the notice * @@ -299,11 +294,6 @@ class ThreadedNoticeListSubItem extends NoticeListItem // } - function showContext() - { - // - } - function getReplyProfiles() { $all = parent::getReplyProfiles(); diff --git a/plugins/ConversationTree/lib/conversationtreeitem.php b/plugins/ConversationTree/lib/conversationtreeitem.php index d7db04e1dd..65911dfc48 100644 --- a/plugins/ConversationTree/lib/conversationtreeitem.php +++ b/plugins/ConversationTree/lib/conversationtreeitem.php @@ -69,18 +69,6 @@ class ConversationTreeItem extends NoticeListItem 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 * diff --git a/plugins/GNUsocialProfileExtensions/lib/noticetree.php b/plugins/GNUsocialProfileExtensions/lib/noticetree.php index 4bdffc9428..95df528388 100644 --- a/plugins/GNUsocialProfileExtensions/lib/noticetree.php +++ b/plugins/GNUsocialProfileExtensions/lib/noticetree.php @@ -146,11 +146,6 @@ class NoticeTreeItem extends NoticeListItem return; } - function showContext() - { - return; - } - //Just changing the link... function showReplyLink() { diff --git a/plugins/QnA/QnAPlugin.php b/plugins/QnA/QnAPlugin.php index 1cbab3b60b..e0f5fed12b 100644 --- a/plugins/QnA/QnAPlugin.php +++ b/plugins/QnA/QnAPlugin.php @@ -339,7 +339,7 @@ class QnAPlugin extends MicroAppPlugin $nli->showNoticeLink(); $nli->showNoticeSource(); $nli->showNoticeLocation(); - $nli->showContext(); + $nli->showPermalink(); $nli->showRepeat(); $nli->showNoticeOptions(); diff --git a/theme/base/css/display.css b/theme/base/css/display.css index 06235c791c..d78c2f3d48 100644 --- a/theme/base/css/display.css +++ b/theme/base/css/display.css @@ -983,6 +983,14 @@ content: ":"; display: none; } +.notice .permalink:after { + content: ']'; +} + +.notice .permalink:before { + content: '['; +} + /* old school conversation style */ #conversation .notices .notices {