]> git.mxchange.org Git - friendica.git/commitdiff
duepuntozero, vier: add unread messages per group
authorfabrixxm <fabrix.xm@gmail.com>
Sun, 8 Nov 2015 17:02:04 +0000 (18:02 +0100)
committerfabrixxm <fabrix.xm@gmail.com>
Sun, 8 Nov 2015 17:02:04 +0000 (18:02 +0100)
js/main.js
mod/ping.php
view/templates/group_side.tpl
view/theme/duepuntozero/style.css
view/theme/quattro/js/quattro.js
view/theme/vier/style.css

index 84940eb239ac55f63ae8ebdbde4e2242d5436ad7..df454afe1fb8bbccdf1aa86fafe9486917da74c0 100644 (file)
                        var birthdaystoday = $(data).find('birthdays-today').text();
                        if(birthdaystoday == 0) { $('#birthdays-update').removeClass('notif-birthdays-today') } else { $('#birthdays-update').addClass('notif-birthdays-today') }
 
+                       $(".sidebar-group-li .notify").removeClass("show");
+                       $(data).find("group").each(function() {
+                               var gid = this.id;
+                               var gcount = this.innerHTML;
+                               $(".group-"+gid+" .notify").addClass("show").text(gcount);
+                       });
+
 
                        var eNotif = $(data).find('notif')
 
index a7a2755c5ed1712fbba664bf81dc56850fb74472..30b5785aeca7d2df4e8524c56c67299e30775627 100644 (file)
@@ -203,8 +203,8 @@ function ping_init(&$a) {
                        if ($a->is_friendica_app() OR !$regularnotifications)
                                $n['message'] = str_replace("{0}", $n['name'], $n['message']);
 
-                       $local_time = datetime_convert('UTC',date_default_timezone_get(),$n['date']); 
-                               
+                       $local_time = datetime_convert('UTC',date_default_timezone_get(),$n['date']);
+
                        call_hooks('ping_xmlize', $n);
                        $notsxml = '<note href="%s" name="%s" url="%s" photo="%s" date="%s" seen="%s" timestamp="%s" >%s</note>'."\n";
                        return sprintf ( $notsxml,
@@ -250,41 +250,41 @@ function ping_init(&$a) {
                                $n = array(
                                        'href' => $a->get_baseurl().'/notifications/intros/'.$i['id'],
                                        'name' => $i['name'],
-                                       'url' => $i['url'], 
+                                       'url' => $i['url'],
                                        'photo' => $i['photo'],
                                        'date' => $i['datetime'],
                                        'seen' => false,
-                                       'message' => t("{0} wants to be your friend"),                          
+                                       'message' => t("{0} wants to be your friend"),
                                );
                                $notifs[] = $n;
                        }
                }
-               
+
                if ($mail>0){
                        foreach ($mails as $i) {
                                $n = array(
                                        'href' => $a->get_baseurl().'/message/'.$i['id'],
                                        'name' => $i['from-name'],
-                                       'url' => $i['from-url'], 
+                                       'url' => $i['from-url'],
                                        'photo' => $i['from-photo'],
                                        'date' => $i['created'],
                                        'seen' => false,
-                                       'message' => t("{0} sent you a message"),                               
+                                       'message' => t("{0} sent you a message"),
                                );
                                $notifs[] = $n;
                        }
                }
-               
+
                if ($register>0){
                        foreach ($regs as $i) {
                                $n = array(
                                        'href' => $a->get_baseurl().'/admin/users/',
                                        'name' => $i['name'],
-                                       'url' => $i['url'], 
+                                       'url' => $i['url'],
                                        'photo' => $i['micro'],
                                        'date' => $i['created'],
                                        'seen' => false,
-                                       'message' => t("{0} requested registration"),                           
+                                       'message' => t("{0} requested registration"),
                                );
                                $notifs[] = $n;
                        }
@@ -363,7 +363,7 @@ function ping_get_notifications($uid) {
                        $quit = true;
                else
                        $offset += 50;
-                       
+
 
                foreach ($r AS $notification) {
                        if (is_null($notification["visible"]))
@@ -386,7 +386,7 @@ function ping_get_notifications($uid) {
                                $notification["message"] = substr_replace($notification["message"],"{0}",$pos,strlen($notification["name"]));
 
                        $notification['href'] = $a->get_baseurl() . '/notify/view/' . $notification['id'];
-                               
+
                        if ($notification["visible"] AND !$notification["spam"] AND
                                !$notification["deleted"] AND !is_array($result[$notification["parent"]])) {
                                $result[$notification["parent"]] = $notification;
@@ -395,6 +395,6 @@ function ping_get_notifications($uid) {
 
        } while ((count($result) < 50) AND !$quit);
 
-       
+
        return($result);
 }
index c7e1aa895e2c063a3b567aa83a0fb1eee3eb7083..4905c2fa1a1346fc2c8ccce86d67b00cceecd340 100644 (file)
@@ -4,18 +4,19 @@
 <div id="sidebar-group-list">
        <ul role="menu" id="sidebar-group-ul">
                {{foreach $groups as $group}}
-                       <li role="menuitem" class="sidebar-group-li">
+                       <li role="menuitem" class="sidebar-group-li group-{{$group.id}}">
                                {{if $group.cid}}
-                                       <input type="checkbox" 
-                                               class="{{if $group.selected}}ticked{{else}}unticked {{/if}} action" 
+                                       <input type="checkbox"
+                                               class="{{if $group.selected}}ticked{{else}}unticked {{/if}} action"
                                                onclick="contactgroupChangeMember('{{$group.id}}','{{$group.cid}}');return true;"
                                                {{if $group.ismember}}checked="checked"{{/if}}
                                        />
-                               {{/if}}                 
+                               {{/if}}
                                {{if $group.edit}}
                                        <a class="groupsideedit" href="{{$group.edit.href}}" title="{{$edittext}}"><span id="edit-sidebar-group-element-{{$group.id}}" class="group-edit-icon iconspacer small-pencil"><span class="sr-only">{{$edittext}}</span></span></a>
                                {{/if}}
                                <a id="sidebar-group-element-{{$group.id}}" class="sidebar-group-element {{if $group.selected}}group-selected{{/if}}" href="{{$group.href}}">{{$group.text}}</a>
+                               <span class="notify"></span>
                        </li>
                {{/foreach}}
        </ul>
index 5bec657f6c653176e0b297ac1fe69606af51559c..0198431919bfc9759dcfb1b3a1dc1236532689f7 100644 (file)
@@ -2039,6 +2039,17 @@ a.mail-list-link {
 #sidebar-group-list ul {
        list-style-type: none;
 }
+.sidebar-group-li .notify {
+       display: none;
+       font-size: 9px;
+       border: 1px solid rgb(221, 221, 221);
+       padding: 2px;
+       float: right;
+       background-color: #BABDB6;
+}
+.sidebar-group-li .notify.show {
+       display: block;
+}
 
 #sidebar-group-list .icon, #sidebar-group-list .iconspacer {
        display: inline-block;
index 1a532b9d55103ce27795390d5f07ab7ee1cfe564..c2573ebd1d5f726cf58e03c2895c7afe28499ca0 100644 (file)
@@ -4,7 +4,7 @@ $(document).ready(function(){
                var intro = $(data).find('intro').text();
                var mail = $(data).find('mail').text();
 
-               $("tool notify").removeClass("on");
+               $(".tool .notify").removeClass("on");
                $(data).find("group").each(function() {
                        var gid = this.id;
                        var gcount = this.innerHTML;
index 75b8288636224e682a4f171ccf75bb112483e6f3..3d30db809345c8983dc693c1e96c83b22148179b 100644 (file)
@@ -366,6 +366,17 @@ code {
 #sidebar-group-list .tool:hover {
        background: #EEE;
 }
+#sidebar-group-list .notify {
+       min-width: 10px;
+       text-align: center;
+       color: #FFF;
+       background-color: #CB4437;
+       font: bold 10px Arial;
+       padding: 3px;
+       border-radius: 10px;
+       display: none;
+}
+#sidebar-group-list .notify.show { display: inline-block; }
 .tool .label {
 /*  float: left; */
 }
@@ -1360,12 +1371,12 @@ section.minimal {
   width: 100%;
   margin-bottom: 0.3em;
 }
-.wall-item-container .wall-item-actions-social, 
+.wall-item-container .wall-item-actions-social,
 .wall-item-container .wall-item-actions-isevent {
   float: left;
   margin-bottom: 1px;
 }
-.wall-item-container .wall-item-actions-social a, 
+.wall-item-container .wall-item-actions-social a,
 .wall-item-container .wall-item-actions-isevent a {
   float: left;
   margin-right: 1em;
@@ -2287,7 +2298,7 @@ aside #id_password {
   width: 120px;
   height: 130px;
   float: left;
-  overflow: hidden; 
+  overflow: hidden;
   margin-left: 5px;
 }*/