Added assignee to frontend

This commit is contained in:
Phil Hughes 2016-08-05 08:44:26 +01:00
parent fcee9323c0
commit db2eabfd03
4 changed files with 20 additions and 0 deletions

View file

@ -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) => {

View file

@ -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;
}
}

View file

@ -237,3 +237,8 @@
margin-right: 8px;
font-weight: 500;
}
.card-avatar {
margin-top: -2px;
border-radius: 50%;
}

View file

@ -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 }