diff options
4 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/models/issue.js.es6 b/app/assets/javascripts/boards/models/issue.js.es6 index 1b32cf80b9b..a56b2bc5175 100644 --- a/app/assets/javascripts/boards/models/issue.js.es6 +++ b/app/assets/javascripts/boards/models/issue.js.es6 @@ -2,6 +2,11 @@ class Issue { constructor (obj) { this.id = obj.iid; this.title = obj.title; + + if (obj.assignee) { + this.assignee = new User(obj.assignee); + } + this.labels = []; obj.labels.forEach((label) => { diff --git a/app/assets/javascripts/boards/models/user.js.es6 b/app/assets/javascripts/boards/models/user.js.es6 new file mode 100644 index 00000000000..e6b35569f77 --- /dev/null +++ b/app/assets/javascripts/boards/models/user.js.es6 @@ -0,0 +1,8 @@ +class User { + constructor (user) { + this.id = user.id; + this.name = user.name; + this.username = user.username; + this.avatar = user.avatar_url; + } +} diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 7054cfd73c1..09bb3113f6f 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -237,3 +237,8 @@ margin-right: 8px; font-weight: 500; } + +.card-avatar { + margin-top: -2px; + border-radius: 50%; +} diff --git a/app/views/projects/boards/components/_card.html.haml b/app/views/projects/boards/components/_card.html.haml index 0cb92ecadfe..707559122ef 100644 --- a/app/views/projects/boards/components/_card.html.haml +++ b/app/views/projects/boards/components/_card.html.haml @@ -8,3 +8,5 @@ {{ issue.id }} %span.label.color-label{ "v-for" => "label in issue.labels", ":style" => "{ backgroundColor: label.color, color: label.textColor }" } {{ label.title }} + %a{ ":href" => "'/u/' + issue.assignee.username", ":title" => "issue.assignee.name", "v-if" => "issue.assignee" } + %img.card-avatar{ ":src" => "issue.assignee.avatar", width: 20, height: 20 } |