Show avatars of assigned users

This commit is contained in:
kolaente 2019-06-06 12:52:05 +02:00
parent 0b18ca73c2
commit aeae2c4f1f
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
4 changed files with 16 additions and 1 deletions

View file

@ -23,7 +23,9 @@ export default {
// Tell others the user is autheticated // Tell others the user is autheticated
this.user.authenticated = true this.user.authenticated = true
this.getUserInfos() const inf = this.getUserInfos()
// eslint-disable-next-line
console.log(inf)
// Hide the loader // Hide the loader
context.loading = false context.loading = false

View file

@ -38,6 +38,7 @@
<span class="tag" v-for="label in l.labels" :style="{'background': label.hex_color, 'color': label.textColor}" :key="label.id"> <span class="tag" v-for="label in l.labels" :style="{'background': label.hex_color, 'color': label.textColor}" :key="label.id">
<span>{{ label.title }}</span> <span>{{ label.title }}</span>
</span> </span>
<img :src="gravatar(a)" :alt="a.username" v-for="a in l.assignees" class="avatar" :key="l.id + 'assignee' + a.id"/>
<i v-if="l.dueDate > 0" :class="{'overdue': (l.dueDate <= new Date())}"> - Due on {{new Date(l.dueDate).toLocaleString()}}</i> <i v-if="l.dueDate > 0" :class="{'overdue': (l.dueDate <= new Date())}"> - Due on {{new Date(l.dueDate).toLocaleString()}}</i>
<span v-if="l.priority >= priorities.HIGH" class="high-priority" :class="{'not-so-high': l.priority === priorities.HIGH}"> <span v-if="l.priority >= priorities.HIGH" class="high-priority" :class="{'not-so-high': l.priority === priorities.HIGH}">
<span class="icon"> <span class="icon">
@ -173,6 +174,9 @@
this.taskEditTask = theTask this.taskEditTask = theTask
this.isTaskEdit = true this.isTaskEdit = true
}, },
gravatar(user) {
return 'https://www.gravatar.com/avatar/' + user.avatarUrl + '?s=27'
},
} }
} }
</script> </script>

View file

@ -4,6 +4,7 @@ export default class UserModel extends AbstractModel {
defaults() { defaults() {
return { return {
id: 0, id: 0,
avatarUrl: '',
email: '', email: '',
username: '', username: '',
created: 0, created: 0,

View file

@ -58,6 +58,14 @@
.tag { .tag {
margin: 0 0.5em; margin: 0 0.5em;
} }
.avatar {
border-radius: 50%;
vertical-align: bottom;
margin-left: 5px;
height: 27px;
width: 27px;
}
} }
.high-priority{ .high-priority{