]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'upstream/develop' into develop
authorRoland Häder <roland@mxchange.org>
Thu, 22 Dec 2016 08:03:44 +0000 (09:03 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 22 Dec 2016 08:03:44 +0000 (09:03 +0100)
19 files changed:
include/NotificationsManager.php
mod/notifications.php
view/templates/notifications_attend_item.tpl
view/templates/notifications_comments_item.tpl
view/templates/notifications_dislikes_item.tpl
view/templates/notifications_friends_item.tpl
view/templates/notifications_likes_item.tpl
view/templates/notifications_network_item.tpl
view/templates/notifications_posts_item.tpl
view/templates/notify.tpl
view/theme/frio/css/style.css
view/theme/frio/templates/notifications_attend_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_comments_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_dislikes_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_friends_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_likes_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_network_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notifications_posts_item.tpl [new file with mode: 0644]
view/theme/frio/templates/notify.tpl [new file with mode: 0644]

index 2adab59721e4cd48d88c482eea03f9ad3681997d..611860f9d08b68e9e115dc46d55d9cf6beb96230 100644 (file)
@@ -198,8 +198,10 @@ class NotificationsManager {
         *      string 'label' => The type of the notification
         *      string 'link' => URL to the source
         *      string 'image' => The avatar image
+        *      string 'url' => The profile url of the contact
         *      string 'text' => The notification text
-        *      string 'when' => Relative date of the notification
+        *      string 'when' => The date of the notification
+        *      string 'ago' => T relative date of the notification
         *      bool 'seen' => Is the notification marked as "seen"
         */
        private function formatNotifs($notifs, $ident = "") {
@@ -223,26 +225,32 @@ class NotificationsManager {
                                                $default_item_label = 'notify';
                                                $default_item_link = $this->a->get_baseurl(true).'/notify/view/'. $it['id'];
                                                $default_item_image = proxy_url($it['photo'], false, PROXY_SIZE_MICRO);
+                                               $default_item_url = $it['url'];
                                                $default_item_text = strip_tags(bbcode($it['msg']));
-                                               $default_item_when = relative_date($it['date']);
+                                               $default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['date'], 'r');
+                                               $default_item_ago = relative_date($it['date']);
                                                break;
 
                                        case 'home':
                                                $default_item_label = 'comment';
                                                $default_item_link = $this->a->get_baseurl(true).'/display/'.$it['pguid'];
                                                $default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
+                                               $default_item_url = $it['author-link'];
                                                $default_item_text = sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']);
-                                               $default_item_when = relative_date($it['created']);
+                                               $default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
+                                               $default_item_ago = relative_date($it['created']);
                                                break;
 
                                        default:
                                                $default_item_label = (($it['id'] == $it['parent']) ? 'post' : 'comment');
                                                $default_item_link = $this->a->get_baseurl(true).'/display/'.$it['pguid'];
                                                $default_item_image = proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO);
+                                               $default_item_url = $it['author-link'];
                                                $default_item_text = (($it['id'] == $it['parent'])
                                                                        ? sprintf(t("%s created a new post"), $it['author-name'])
                                                                        : sprintf(t("%s commented on %s's post"), $it['author-name'], $it['pname']));
-                                               $default_item_when = relative_date($it['created']);
+                                               $default_item_when = datetime_convert('UTC', date_default_timezone_get(), $it['created'], 'r');
+                                               $default_item_ago = relative_date($it['created']);
 
                                }
 
@@ -253,8 +261,10 @@ class NotificationsManager {
                                                        'label' => 'like',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf(t("%s liked %s's post"), $it['author-name'], $it['pname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -264,8 +274,10 @@ class NotificationsManager {
                                                        'label' => 'dislike',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf(t("%s disliked %s's post"), $it['author-name'], $it['pname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -275,8 +287,10 @@ class NotificationsManager {
                                                        'label' => 'attend',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf(t("%s is attending %s's event"), $it['author-name'], $it['pname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -286,8 +300,10 @@ class NotificationsManager {
                                                        'label' => 'attendno',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf( t("%s is not attending %s's event"), $it['author-name'], $it['pname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -297,8 +313,10 @@ class NotificationsManager {
                                                        'label' => 'attendmaybe',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf(t("%s may attend %s's event"), $it['author-name'], $it['pname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -312,8 +330,10 @@ class NotificationsManager {
                                                        'label' => 'friend',
                                                        'link' => $this->a->get_baseurl(true).'/display/'.$it['pguid'],
                                                        'image' => proxy_url($it['author-avatar'], false, PROXY_SIZE_MICRO),
+                                                       'url' => $it['author-link'],
                                                        'text' => sprintf(t("%s is now friends with %s"), $it['author-name'], $it['fname']),
-                                                       'when' => relative_date($it['created']),
+                                                       'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                                break;
@@ -323,8 +343,10 @@ class NotificationsManager {
                                                        'label' => $default_item_label,
                                                        'link' => $default_item_link,
                                                        'image' => $default_item_image,
+                                                       'url' => $default_item_url,
                                                        'text' => $default_item_text,
                                                        'when' => $default_item_when,
+                                                       'ago' => $default_item_ago,
                                                        'seen' => $it['seen']
                                                );
                                }
@@ -459,7 +481,7 @@ class NotificationsManager {
                if($seen === 0)
                        $sql_seen = " AND `seen` = 0 ";
 
-               $r = q("SELECT `id`, `photo`, `msg`, `date`, `seen` FROM `notify`
+               $r = q("SELECT `id`, `url`, `photo`, `msg`, `date`, `seen` FROM `notify`
                                WHERE `uid` = %d $sql_seen ORDER BY `date` DESC LIMIT %d, %d ",
                        intval(local_user()),
                        intval($start),
@@ -626,9 +648,9 @@ class NotificationsManager {
                        $sql_seen = " AND `item`.`unseen` = 1 ";
 
                $r = q("SELECT `item`.`id`,`item`.`parent`, `item`.`verb`, `item`.`author-name`, `item`.`unseen`,
-                               `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` as `object`,
-                               `pitem`.`author-name` as `pname`, `pitem`.`author-link` as `plink`, `pitem`.`guid` as `pguid`
-                       FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent`
+                               `item`.`author-link`, `item`.`author-avatar`, `item`.`created`, `item`.`object` AS `object`,
+                               `pitem`.`author-name` AS `pname`, `pitem`.`author-link` AS `plink`, `pitem`.`guid` AS `pguid`
+                       FROM `item` INNER JOIN `item` AS `pitem` ON `pitem`.`id`=`item`.`parent`
                        WHERE `item`.`visible` = 1 AND
                                 `item`.`deleted` = 0 AND `item`.`uid` = %d AND `item`.`wall` = 1
                                $sql_seen
index e4fa08f3e2be4e9840b246ccae929e9a82975540..47e4cd03405f867f2560f5588f3fd4fa3ac5b840 100644 (file)
@@ -285,8 +285,10 @@ function notifications_content(App &$a) {
                                '$item_label' => $it['label'],
                                '$item_link' => $it['link'],
                                '$item_image' => $it['image'],
+                               '$item_url' => $it['url'],
                                '$item_text' => htmlentities($it['text']),
                                '$item_when' => $it['when'],
+                               '$item_ago' => $it['ago'],
                                '$item_seen' => $it['seen'],
                        ));
                }
index 6add369cb45472917f96aad96866632b8f97a4a9..adaa539d1279cb890e7af213f7e45d8e5c00fe14 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notification"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notification"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index dfa15df2801994cade152bd3081e77929a8bd01c..2550806713c36314c4434144521169134b210896 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index dfa15df2801994cade152bd3081e77929a8bd01c..2550806713c36314c4434144521169134b210896 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index dfa15df2801994cade152bd3081e77929a8bd01c..2550806713c36314c4434144521169134b210896 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index 6add369cb45472917f96aad96866632b8f97a4a9..adaa539d1279cb890e7af213f7e45d8e5c00fe14 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notification"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notification"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index 64395a83d0943d98e48c92d0289cd3850eccbf99..a50b2cf2ad69e2d37322c3fe5dd6f05e9222f569 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
index dfa15df2801994cade152bd3081e77929a8bd01c..2550806713c36314c4434144521169134b210896 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index dfa15df2801994cade152bd3081e77929a8bd01c..2550806713c36314c4434144521169134b210896 100644 (file)
@@ -1,4 +1,4 @@
 
 <div class="notif-item {{if !$item_seen}}unseen{{/if}}">
-       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_when}}</span></a>
+       <a href="{{$item_link}}" target="friendica-notifications"><img src="{{$item_image}}" class="notif-image">{{$item_text}} <span class="notif-when">{{$item_ago}}</span></a>
 </div>
\ No newline at end of file
index 91b6219f1787a46215f1ac78dbcd9c26a69e4da0..1c602898e66ae95c9ce38b60d348501819579fb9 100644 (file)
@@ -1882,6 +1882,9 @@ ul.dropdown-menu li:hover {
     -moz-box-shadow: 0 0 3px #dadada;
 }
 
+.section-title-wrapper {
+    overflow: hidden;
+}
 /* Profile-page */
 #profile-content-standard,
 #profile-content-advanced {
@@ -2208,7 +2211,7 @@ ul li:hover .contact-wrapper a.contact-action-link:hover {
     margin-left: 20px;
 }
 
-/* Notifications */
+/* Intro Notifications */
 ul.notif-network-list {
     margin-left: -15px;
     margin-right: -15px;
@@ -2217,17 +2220,12 @@ ul.notif-network-list > li {
     padding-left: 15px;
     padding-right: 15px;
 }
-ul.notif-network-list li.unseen {
-    border-left: 3px solid #f3fcfd;
-    background-color: #f3fcfd;
-}
 .intro-wrapper.media {
     overflow: visible;
     word-wrap: break-word;
     margin-top: 0;
 }
-.intro-photo-wrapper img.intro-photo,
-.notif-item img.notif-image {
+.intro-photo-wrapper img.intro-photo {
     height:80px;
     width: 80px;
     border-radius: 4px;
@@ -2280,6 +2278,26 @@ ul.notif-network-list > li:hover .intro-action-buttons {
     margin-top: 5px
 }
 
+/* Notifications Page */
+ul.notif-network-list li.unseen {
+    background-color: #f3fcfd;
+}
+.notif-item img.notif-image {
+    height: 48px;
+    width: 48px;
+    border-radius: 4px;
+}
+.notif-item .notif-desc-wrapper {
+    height: 48px;
+}
+.notif-item .notif-desc-wrapper a {
+    height: 100%;
+    display: block;
+    color: #555;
+    font-size: 13px;
+    font-weight: 600;
+}
+
 /* Search Page */
 
 /* This is a little bit hacky. Since the search page is used for diferent
diff --git a/view/theme/frio/templates/notifications_attend_item.tpl b/view/theme/frio/templates/notifications_attend_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_comments_item.tpl b/view/theme/frio/templates/notifications_comments_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_dislikes_item.tpl b/view/theme/frio/templates/notifications_dislikes_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_friends_item.tpl b/view/theme/frio/templates/notifications_friends_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_likes_item.tpl b/view/theme/frio/templates/notifications_likes_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_network_item.tpl b/view/theme/frio/templates/notifications_network_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notifications_posts_item.tpl b/view/theme/frio/templates/notifications_posts_item.tpl
new file mode 100644 (file)
index 0000000..680b29a
--- /dev/null
@@ -0,0 +1,2 @@
+
+{{include file="notify.tpl"}}
diff --git a/view/theme/frio/templates/notify.tpl b/view/theme/frio/templates/notify.tpl
new file mode 100644 (file)
index 0000000..6122ecd
--- /dev/null
@@ -0,0 +1,12 @@
+
+<div class="notif-item {{if !$item_seen}}unseen{{/if}} {{$item_label}} media">
+       <div class="notif-photo-wrapper media-object pull-left">
+               <a class="userinfo" href="{{$item_url}}"><img src="{{$item_image}}" class="notif-image"></a>
+       </div>
+       <div class="notif-desc-wrapper media-body">
+               <a href="{{$item_link}}">
+                       {{$item_text}}
+                       <div><time class="notif-when time" data-toggle="tooltip" title="{{$item_when}}">{{$item_ago}}</time></div>
+               </a>
+       </div>
+</div>