From 30a38f7ed9fe0f9fbd9b3046539a7c77783a470c Mon Sep 17 00:00:00 2001 From: Tanshu Date: Mon, 24 Jun 2013 13:53:51 +0530 Subject: [PATCH] Updated Thread / Messaging to show unread / read messages Showing subscribers in main.html Messages are considered read when the message is opened by the user. Fixed error left from before where batch date was not updated on updating purchase voucher. --- brewman/brewman/models/messaging.py | 2 ++ brewman/brewman/static/offline.appcache | 2 +- brewman/brewman/static/partial/home.html | 16 +++--------- .../static/scripts/angular_directive.js | 10 ++++--- brewman/brewman/views/messaging.py | 26 ++++++++++++++----- .../views/services/voucher/purchase.py | 1 + 6 files changed, 33 insertions(+), 24 deletions(-) diff --git a/brewman/brewman/models/messaging.py b/brewman/brewman/models/messaging.py index 27c64cab..7313be45 100644 --- a/brewman/brewman/models/messaging.py +++ b/brewman/brewman/models/messaging.py @@ -71,6 +71,8 @@ class Thread(Base): @classmethod def by_id(cls, id): + if not isinstance(id, uuid.UUID): + id = uuid.UUID(id) return DBSession.query(cls).filter(cls.id == id).first() @classmethod diff --git a/brewman/brewman/static/offline.appcache b/brewman/brewman/static/offline.appcache index 1cd19418..76df45e3 100644 --- a/brewman/brewman/static/offline.appcache +++ b/brewman/brewman/static/offline.appcache @@ -1,6 +1,6 @@ CACHE MANIFEST -# version 2013-06-19.1 +# version 2013-06-24.1 CACHE: /partial/404.html diff --git a/brewman/brewman/static/partial/home.html b/brewman/brewman/static/partial/home.html index 87077e81..40fb99e2 100644 --- a/brewman/brewman/static/partial/home.html +++ b/brewman/brewman/static/partial/home.html @@ -6,7 +6,7 @@
  • Open
  • Closed
  • All
  • -