From 4b9563abd45dafced0521deedb53ea2f872f5639 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Wed, 24 Jul 2013 20:42:13 +0200 Subject: Show assigned gravatar in story and task lists --- pg-datastore.lisp | 9 ++++++--- static/js/main.js | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/pg-datastore.lisp b/pg-datastore.lisp index 317eca5..39e2646 100644 --- a/pg-datastore.lisp +++ b/pg-datastore.lisp @@ -57,16 +57,19 @@ (defmethod datastore-get-all-stories ((datastore pg-datastore)) (with-connection (connection-spec datastore) - (query (:order-by (:select :* :from 'story) 'priority) :alists))) + (query (:order-by (:select :* (:as (:md5 'assignee) 'md5) + :from 'story) 'priority) :alists))) (defmethod datastore-get-story ((datastore pg-datastore) id) (with-connection (connection-spec datastore) - (append (query (:select :* :from 'story :where (:= 'id id)) :alist) + (append (query (:select :* (:as (:md5 'assignee) 'md5) :from 'story + :where (:= 'id id)) :alist) `((tasks . ,(datastore-get-tasks-for-story datastore id)))))) (defmethod datastore-get-tasks-for-story ((datastore pg-datastore) id) (with-connection (connection-spec datastore) - (query (:order-by (:select :* :from 'task :where (:= 'story-id id)) + (query (:order-by (:select :* (:as (:md5 'assignee) 'md5) :from 'task + :where (:= 'story-id id)) 'priority) :alists))) diff --git a/static/js/main.js b/static/js/main.js index 444f06a..68ea997 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -24,6 +24,25 @@ var StateIcon = React.createClass({ } }); +var AssigneeIcon = React.createClass({ + render: function() { + var icon; + + if (this.props.assignee) + icon = {this.props.assignee}; + else + icon = ( + + + ); + + return icon; + } +}); + var StoryTaskRow = React.createClass({ changeState: React.autoBind(function(event) { $.post("/tasks/state", {'id': this.props.task.id}) @@ -58,6 +77,10 @@ var StoryTaskRow = React.createClass({ + + + {" "} @@ -182,6 +205,10 @@ var StoryRow = React.createClass({ + + + {" "} -- cgit v1.2.3-54-g00ecf