# HG changeset patch # User durandn # Date 1470384110 -7200 # Node ID 8ec8aced3f68449c56153e309c1dc02c0a7a2059 # Parent 21ed0482625bad32e4eeb7ec4c31ce1f34473dcf small fixes on comment page calculation + added functionality to clear unread notification from button in user home + quick css fixes diff -r 21ed0482625b -r 8ec8aced3f68 src/iconolab/models.py --- a/src/iconolab/models.py Thu Aug 04 15:36:32 2016 +0200 +++ b/src/iconolab/models.py Fri Aug 05 10:01:50 2016 +0200 @@ -378,11 +378,9 @@ # Get page for considered comment, with COMMENTS_PER_PAGE_DEFAULT comments per page def get_comment_page(self): - return self._default_manager.filter( - object_pk=self.object_pk, - content_type__app_label=self.content_type.app_label, - content_type__model=self.content_type.model - ).order_by("thread_id", "-order").filter(thread_id__lt=self.thread_id, order__gt=self.order).count() // settings.COMMENTS_PER_PAGE_DEFAULT + 1 + return (self._default_manager.for_app_models("iconolab.annotation").filter( + object_pk=self.object_pk, + ).filter(thread_id__gte=self.thread_id).filter(order__lte=self.order).count()) // settings.COMMENTS_PER_PAGE_DEFAULT + 1 class MetaCategory(models.Model): NONE = 0 # Notifies nobody diff -r 21ed0482625b -r 8ec8aced3f68 src/iconolab/static/iconolab/css/iconolab.css --- a/src/iconolab/static/iconolab/css/iconolab.css Thu Aug 04 15:36:32 2016 +0200 +++ b/src/iconolab/static/iconolab/css/iconolab.css Fri Aug 05 10:01:50 2016 +0200 @@ -73,33 +73,18 @@ .badge-error { background-color: #b94a48; } -.badge-error:hover { - background-color: #953b39; -} .badge-warning { background-color: #f89406; } -.badge-warning:hover { - background-color: #c67605; -} .badge-success { background-color: #468847; } -.badge-success:hover { - background-color: #356635; -} .badge-info { background-color: #3a87ad; } -.badge-info:hover { - background-color: #2d6987; -} .badge-inverse { background-color: #333333; } -.badge-inverse:hover { - background-color: #1a1a1a; -} .notif-badge{ margin-bottom: 5px; diff -r 21ed0482625b -r 8ec8aced3f68 src/iconolab/templates/iconolab/user_home.html --- a/src/iconolab/templates/iconolab/user_home.html Thu Aug 04 15:36:32 2016 +0200 +++ b/src/iconolab/templates/iconolab/user_home.html Fri Aug 05 10:01:50 2016 +0200 @@ -18,7 +18,7 @@ {% notifications_unread as unread_count %}

{{unread_count}} Notifications non lues Voir toutes mes notifications - Tout marquer comme lu + Tout marquer comme lu

@@ -54,10 +54,13 @@