mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
40 lines
974 B
Vue
40 lines
974 B
Vue
<template lang="pug">
|
|
.ui.internally.celled.grid
|
|
.row
|
|
.sixteen.wide.colum
|
|
h2.ui.dividing.header(v-once) {{ $t('inbox') }}
|
|
.ui.middle.aligned.selection.list
|
|
.item(v-for="conversation in conversations")
|
|
img.ui.avatar.image(src='http://semantic-ui.com/images/avatar/small/daniel.jpg')
|
|
.content
|
|
.header
|
|
router-link(:to="{ name: 'conversation', params: { id: conversation.fromUserId } }")
|
|
| {{ conversation.from }}
|
|
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data () {
|
|
// @TODO: Abstract to Store
|
|
let messages = [
|
|
{
|
|
from: 'Paglias',
|
|
fromUserId: 1234,
|
|
to: 'TheHollidayInn',
|
|
message: 'I love the Gang of Four',
|
|
},
|
|
];
|
|
|
|
let conversations = {};
|
|
for (let message of messages) {
|
|
if (!conversations[message.fromUserId]) conversations[message.fromUserId] = message;
|
|
}
|
|
|
|
return {
|
|
conversations,
|
|
};
|
|
},
|
|
};
|
|
</script>
|