pleroma-fe/src/components/status/status.vue

143 lines
3.7 KiB
Vue
Raw Normal View History

2016-10-28 15:19:42 +02:00
<template>
<div class="status-el" v-if="!status.deleted">
2016-10-28 18:08:03 +02:00
<div v-if="retweet" class="media container retweet-info">
2016-10-28 15:19:42 +02:00
<div class="media-left">
2016-12-04 16:28:07 +01:00
<i class='fa icon-retweet retweeted'></i>
2016-10-28 15:19:42 +02:00
</div>
<div class="media-body">
2016-10-28 18:08:03 +02:00
Retweeted by {{retweeter}}
2016-10-28 15:19:42 +02:00
</div>
</div>
2016-11-28 21:07:48 +01:00
<div class="media status container">
2016-10-28 15:19:42 +02:00
<div class="media-left">
2016-11-07 16:42:29 +01:00
<a :href="status.user.statusnet_profile_url">
2016-10-28 15:19:42 +02:00
<img class='avatar' :src="status.user.profile_image_url_original">
</a>
</div>
<div class="media-body">
<div class="user-content">
<h4 class="media-heading">
{{status.user.name}}
2016-11-30 23:32:22 +01:00
<small><router-link :to="{ name: 'user-profile', params: { id: status.user.id } }">{{status.user.screen_name}}</router-link></small>
<small v-if="status.in_reply_to_screen_name"> &gt;
<router-link :to="{ name: 'user-profile', params: { id: status.in_reply_to_user_id } }">
{{status.in_reply_to_screen_name}}
</router-link>
2016-11-30 23:32:22 +01:00
</small>
-
<small>
<router-link :to="{ name: 'conversation', params: { id: status.id } }">
<timeago :since="status.created_at" :auto-update="60"></timeago>
</router-link>
</small>
<small v-if="!status.is_local" class="source_url">
<a :href="status.external_url" target="_blank" >
2016-12-23 16:52:40 +01:00
<i class="icon-link-ext fa"></i>
</a>
</small>
</h4>
<div class="status-content" v-html="status.statusnet_html"></div>
<div v-if='status.attachments' class='attachments'>
<attachment :status-id="status.id" :nsfw="status.nsfw" :attachment="attachment" v-for="attachment in status.attachments">
</attachment>
</div>
2016-10-28 15:19:42 +02:00
</div>
2016-11-06 20:45:26 +01:00
<div v-if="loggedIn">
2016-10-28 15:19:42 +02:00
<div class='status-actions'>
2016-11-03 16:59:27 +01:00
<div>
2016-11-03 17:35:49 +01:00
<a href="#" v-on:click.prevent="toggleReplying">
2016-11-03 16:59:27 +01:00
<i class='fa icon-reply'></i>
</a>
2016-10-28 15:19:42 +02:00
</div>
<retweet-button :status=status></retweet-button>
2016-10-30 16:12:35 +01:00
<favorite-button :status=status></favorite-button>
<div v-if="canDelete">
<a href="#" v-on:click.prevent="deleteStatus">
<i class='fa icon-cancel delete-status'></i>
</a>
</div>
2016-10-28 15:19:42 +02:00
</div>
2016-11-03 17:35:49 +01:00
<post-status-form v-if="replying" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" v-on:posted="toggleReplying"></post-status-form>
2016-10-28 15:19:42 +02:00
</div>
</div>
</div>
</div>
</template>
<script src="./status.js" ></script>
2016-10-29 01:38:41 +02:00
<style lang="scss">
2016-11-25 17:19:46 +01:00
@import '../../_variables.scss';
.status-el {
2016-11-12 20:57:54 +01:00
hyphens: auto;
overflow-wrap: break-word;
2016-10-29 01:38:41 +02:00
word-wrap: break-word;
2016-11-03 16:59:27 +01:00
word-break: break-word;
2016-10-29 01:38:41 +02:00
.user-content {
min-height: 52px;
}
2016-11-25 17:34:41 +01:00
.source_url {
float: right;
}
2016-11-25 17:34:59 +01:00
.greentext {
color: green;
}
2016-10-29 01:38:41 +02:00
a {
2016-11-12 20:57:54 +01:00
display: inline-block;
2016-10-29 01:38:41 +02:00
word-break: break-all;
}
.status-content {
margin-top: 3px;
margin-bottom: 3px;
}
p {
2016-11-25 17:19:46 +01:00
margin: 0;
margin-top: 0.2em;
margin-bottom: 0.5em;
}
2016-11-25 17:19:46 +01:00
}
2016-11-02 18:38:30 +01:00
2016-11-25 17:19:46 +01:00
.status-actions {
2016-11-02 18:38:30 +01:00
padding-top: 5px;
2016-11-25 17:19:46 +01:00
}
2016-11-25 17:19:46 +01:00
.icon-reply:hover {
color: $blue;
2016-11-25 17:19:46 +01:00
}
2016-11-25 17:19:46 +01:00
.status .avatar {
width: 48px;
}
2016-11-25 17:19:46 +01:00
.status.compact .avatar {
width: 32px;
}
2016-11-25 17:19:46 +01:00
.status {
padding: 0.5em;
padding-right: 1em;
border-bottom: 1px solid silver;
}
2016-11-25 17:19:46 +01:00
.status-el:last-child .status {
border: none
}
.icon-cancel,.delete-status {
cursor: pointer;
&:hover {
color: $red;
}
}
2016-10-29 01:38:41 +02:00
</style>