Merge pull request #2052 from fabrixxm/issue_1718

duepuntozero, vier: add unread messages per group
This commit is contained in:
Tobias Diekershoff 2015-11-08 18:29:15 +01:00
commit 686ba3fcb0
6 changed files with 51 additions and 21 deletions

View file

@ -203,6 +203,13 @@
var birthdaystoday = $(data).find('birthdays-today').text(); var birthdaystoday = $(data).find('birthdays-today').text();
if(birthdaystoday == 0) { $('#birthdays-update').removeClass('notif-birthdays-today') } else { $('#birthdays-update').addClass('notif-birthdays-today') } 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') var eNotif = $(data).find('notif')

View file

@ -4,7 +4,7 @@
<div id="sidebar-group-list"> <div id="sidebar-group-list">
<ul role="menu" id="sidebar-group-ul"> <ul role="menu" id="sidebar-group-ul">
{{foreach $groups as $group}} {{foreach $groups as $group}}
<li role="menuitem" class="sidebar-group-li"> <li role="menuitem" class="sidebar-group-li group-{{$group.id}}">
{{if $group.cid}} {{if $group.cid}}
<input type="checkbox" <input type="checkbox"
class="{{if $group.selected}}ticked{{else}}unticked {{/if}} action" class="{{if $group.selected}}ticked{{else}}unticked {{/if}} action"
@ -16,6 +16,7 @@
<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> <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}} {{/if}}
<a id="sidebar-group-element-{{$group.id}}" class="sidebar-group-element {{if $group.selected}}group-selected{{/if}}" href="{{$group.href}}">{{$group.text}}</a> <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> </li>
{{/foreach}} {{/foreach}}
</ul> </ul>

View file

@ -2039,6 +2039,17 @@ a.mail-list-link {
#sidebar-group-list ul { #sidebar-group-list ul {
list-style-type: none; 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 { #sidebar-group-list .icon, #sidebar-group-list .iconspacer {
display: inline-block; display: inline-block;

View file

@ -4,7 +4,7 @@ $(document).ready(function(){
var intro = $(data).find('intro').text(); var intro = $(data).find('intro').text();
var mail = $(data).find('mail').text(); var mail = $(data).find('mail').text();
$("tool notify").removeClass("on"); $(".tool .notify").removeClass("on");
$(data).find("group").each(function() { $(data).find("group").each(function() {
var gid = this.id; var gid = this.id;
var gcount = this.innerHTML; var gcount = this.innerHTML;

View file

@ -366,6 +366,17 @@ code {
#sidebar-group-list .tool:hover { #sidebar-group-list .tool:hover {
background: #EEE; 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 { .tool .label {
/* float: left; */ /* float: left; */
} }