diff options
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/messages_widget.tpl | 7 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 14 |
2 files changed, 16 insertions, 5 deletions
diff --git a/view/tpl/messages_widget.tpl b/view/tpl/messages_widget.tpl index ddb21beb5..5d0caf46d 100644 --- a/view/tpl/messages_widget.tpl +++ b/view/tpl/messages_widget.tpl @@ -36,6 +36,7 @@ <div class="text-break">{2}</div> </div> <small>{3}</small> + {8} </a> </div> <div id="dm-container" class="list-group list-group-flush" data-offset="10"> @@ -52,6 +53,9 @@ <div class="text-break">{{$e.summary}}</div> </div> <small>{{$e.info}}</small> + {{if $e.unseen}} + <span class="badge bg-transparent border border-{{$e.unseen_class}} text-{{$e.unseen_class}} rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">{{$e.unseen}}</span> + {{/if}} </a> {{/foreach}} <div id="messages-empty" class="list-group-item border-0"{{if $entries}} style="display: none;"{{/if}}> @@ -124,7 +128,8 @@ e.author_name, e.author_addr, e.href, - e.icon + e.icon, + e.unseen ? '<span class="badge bg-transparent border border-' + e.unseen_class + ' text-' + e.unseen_class + ' rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">' + e.unseen + '</span>' : '' ); $('#messages-loading').before(html); }); diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 82b3665c3..7a4e909c7 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -306,12 +306,18 @@ if(typeof obj[type] === typeof undefined) return true; + var count = Number(obj[type].count); + + if(obj[type].count) { $('.' + type + '-button').fadeIn(); - if(replace || followup) - $('.' + type + '-update').html(Number(obj[type].count)); - else - $('.' + type + '-update').html(Number(obj[type].count) + Number($('.' + type + '-update').html())); + if(replace || followup) { + $('.' + type + '-update').html(count >= 100 ? '99+' : count); + } + else { + count = count + Number($('.' + type + '-update').html().replace(/\++$/, '')); + $('.' + type + '-update').html(count >= 100 ? '99+' : count); + } } else { $('.' + type + '-update').html('0'); |