]> git.mxchange.org Git - friendica.git/commitdiff
The manage page now shows the unread notifications
authorMichael Vogel <icarus@dabo.de>
Sat, 28 Nov 2015 21:56:48 +0000 (22:56 +0100)
committerMichael Vogel <icarus@dabo.de>
Sat, 28 Nov 2015 21:56:48 +0000 (22:56 +0100)
mod/manage.php
view/templates/manage.tpl
view/theme/vier/plus.css
view/theme/vier/style.css

index c0eedc2ba07ebcfecaa4b05cd44ab428c844ef5d..3f2023b7e3cd2b1d01c6c4461f9f92e778b2dec7 100644 (file)
@@ -114,6 +114,20 @@ function manage_content(&$a) {
                $identities[$key][thumb] = $thumb[0][thumb];
 
                $identities[$key]['selected'] = (($id['nickname'] === $a->user['nickname']) ? true : false);
+
+               $notifications = 0;
+
+               $r = q("SELECT DISTINCT(`parent`) FROM `notify` WHERE `uid` = %d AND NOT `seen` AND NOT (`type` IN (%d, %d))",
+                       intval($id['uid']), intval(NOTIFY_INTRO), intval(NOTIFY_MAIL));
+               if ($r)
+                       $notifications = sizeof($r);
+
+               $r = q("SELECT DISTINCT(`convid`) FROM `mail` WHERE `uid` = %d AND NOT `seen`",
+                       intval($id['uid']));
+               if ($r)
+                       $notifications = $notifications + sizeof($r);
+
+               $identities[$key]['notifications'] = $notifications;
        }
 
        $o = replace_macros(get_markup_template('manage.tpl'), array(
index e23c4027548212284f74df45226598c331fcab98..dd27092e9badb689925bc4bc940c5be704a2237e 100644 (file)
@@ -11,6 +11,7 @@
                        <div class="identity-match-photo" id="identity-match-photo-{{$id.uid}}">
                                <button name="identity" value="{{$id.uid}}" onclick="this.form.submit();" title="{{$id.username}}">
                                        <img src="{{$id.thumb}}" alt="{{$id.username}}" />
+                                       {{if $id.notifications}}<span class="manage-notify">{{$id.notifications}}</span>{{/if}}
                                </button>
                        </div>
 
@@ -22,7 +23,6 @@
                                </div>
                                <div class="identity-match-details" id="identity-match-nick-{{$id.uid}}">({{$id.nickname}})</div>
                        </div>
-
                        <div class="identity-match-end"></div>
                </div>
        {{/foreach}}
index 5faf069c22ad94e1e2cbb3d19b3982c664838cac..8e1865a8692c93c38e57052c83c0f7352aa504d0 100644 (file)
@@ -17,6 +17,12 @@ nav a:hover,
   color: #000;
 }
 
+.manage-notify {
+  background-color: #CB4437;
+  border-radius: 10px;
+  font: bold 11px/16px Arial;
+}
+
 nav .nav-notify {
 /*  background-color: #427FED; */
   background-color: #CB4437;
index 5bd475759fff3d0a7ef4389e27cd4266e1306dc9..a9c5e7ec8e2d9532cfca34ebe2b77458ba545522 100644 (file)
@@ -667,6 +667,7 @@ nav .nav-menu img {
   margin-top: -3px;
   margin-right: 4px;
 }
+
 nav .nav-menu-icon .nav-notify {
   top: 3px;
 }
@@ -701,6 +702,23 @@ nav .nav-menu:hover {
 /*    background: #4c619c; */
     text-decoration: none;
 }
+
+.manage-notify {
+   background-color: #F80;
+  -moz-border-radius: 5px 5px 5px 5px;
+  -webkit-border-radius: 5px 5px 5px 5px;
+  border-radius: 5px 5px 5px 5px;
+  font-size: 10px;
+  padding: 1px 3px;
+  top: 0px;
+  min-width: 15px;
+  text-align: center;
+  color: white;
+  float: right;
+  margin-top: -14px;
+  margin-right: -20px;
+}
+
 nav .nav-notify {
   display: none;
   position: absolute;
@@ -720,6 +738,7 @@ nav .nav-notify {
   text-align: center;
   color: white;
 }
+
 nav .nav-notify.show {
   display: block;
 }