]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Show permalinks only for local notices
authorMikael Nordfeldth <mmn@hethane.se>
Wed, 5 Nov 2014 18:49:41 +0000 (19:49 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 5 Nov 2014 18:53:59 +0000 (19:53 +0100)
the "from [site]" already links to the permalink

lib/noticelistitem.php
theme/base/css/display.css

index d12a584022e6dfdc60e1f562c074cf6816ac3416..8572c6583ee083c2040727f5d11557c3a23a4d17 100644 (file)
@@ -308,7 +308,7 @@ class NoticeListItem extends Widget
     function showNoticeLink()
     {
         $this->out->elementStart('a', array('rel' => 'bookmark',
-                                            'class' => 'u-url timestamp',
+                                            'class' => 'timestamp',
                                             'href' => Conversation::getUrlFromNotice($this->notice)));
         $this->out->element('time', array('class' => 'dt-published',
                                           'datetime' => common_date_iso8601($this->notice->created),
@@ -472,11 +472,19 @@ class NoticeListItem extends Widget
      */
     function showPermalink()
     {
-        $this->out->element('a',
-                            array('href' => $this->notice->getLocalUrl(),
-                                  'class' => 'permalink'),
-                            // TRANS: Addition in notice list item for single-notice view.
-                            _('permalink'));
+        $class = 'permalink u-url';
+        if (!$this->notice->isLocal()) {
+            $class .= ' external';
+        }
+        try {
+            $this->out->element('a',
+                        array('href' => $this->notice->getUrl(),
+                              'class' => $class),
+                        // TRANS: Addition in notice list item for single-notice view.
+                        _('permalink'));
+        } catch (InvalidUrlException $e) {
+            // no permalink available
+        }
     }
 
     /**
index d78c2f3d48d2b1b588abf72f7406921b1c4ef09d..bff926bd2779cf79af2ad7980ff9af5ecabfcd3d 100644 (file)
@@ -991,6 +991,10 @@ content: ":";
     content: '[';
 }
 
+.notice .permalink.external {
+    display: none;
+}
+
 /* old school conversation style */
 
 #conversation .notices .notices {