]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of git.gnu.io:gnu/gnu-social into nightly
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 6 Nov 2015 12:39:17 +0000 (13:39 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 6 Nov 2015 12:39:17 +0000 (13:39 +0100)
lib/noticelistitem.php
theme/base/css/display.css

index eff3aabe25eb608dcd4b97b5ba32b068556093b0..ae00921bb15883fe8d85a0cec312ce73312cbe32 100644 (file)
@@ -64,6 +64,7 @@ class NoticeListItem extends Widget
     protected $options = true;
     protected $maxchars = 0;   // if <= 0 it means use full posts
     protected $item_tag = 'li';
+    protected $pa = null;
 
     /**
      * constructor
@@ -150,7 +151,13 @@ class NoticeListItem extends Widget
         $this->elementStart('section', array('class'=>'notice-headers'));
         $this->showNoticeTitle();
         $this->showAuthor();
-        if ($this->addressees) { $this->showAddressees(); }
+
+        if (!empty($this->notice->reply_to) || count($this->getProfileAddressees()) > 0) {
+            $this->elementStart('div', array('class' => 'parents'));
+            if (!empty($this->notice->reply_to)) { $this->showParent(); }
+            if ($this->addressees) { $this->showAddressees(); }
+            $this->elementEnd('div');
+        }
         $this->elementEnd('section');
     }
 
@@ -248,6 +255,19 @@ class NoticeListItem extends Widget
         }
     }
 
+    function showParent()
+    {
+        $this->out->element(
+            'a',
+            array(
+                'href' => $this->notice->getParent()->getUrl(),
+                'class' => 'u-in-reply-to',
+                'rel' => 'in-reply-to'
+            ),
+            'in reply to'
+        );
+    }
+
     function showAddressees()
     {
         $pa = $this->getProfileAddressees();
@@ -268,19 +288,20 @@ class NoticeListItem extends Widget
 
     function getProfileAddressees()
     {
-        $pa = array();
+        if($this->pa) { return $this->pa; }
+        $this->pa = array();
 
         $attentions = $this->getReplyProfiles();
 
         foreach ($attentions as $attn) {
             $class = $attn->isGroup() ? 'group' : 'account';
-            $pa[] = array('href' => $attn->profileurl,
-                          'title' => $attn->getNickname(),
-                          'class' => "addressee {$class}",
-                          'text' => $attn->getStreamName());
+            $this->pa[] = array('href' => $attn->profileurl,
+                                'title' => $attn->getNickname(),
+                                'class' => "addressee {$class}",
+                                'text' => $attn->getStreamName());
         }
 
-        return $pa;
+        return $this->pa;
     }
 
     function getReplyProfiles()
index 2bd4b4fe0c13978477a36eaa2a53bd42c66daedb..46d95a864dab74a5fa5d171b10739dda0764307c 100644 (file)
@@ -648,12 +648,12 @@ address .poweredby {
     width:100%;
 }
 
-.notice .p-author {
-    margin-right: 8px;
+.notice .parents {
+    display: inline;
 }
 
-.notice .addressees::before {
-    content: '\25B8';
+.notice .parents::before {
+    content: '\25B8  ';
 }
 .notice .addressees, .notice .addressees li {
     display: inline;