2018-10-26 11:08:46 +00:00
|
|
|
<!--
|
|
|
|
- @copyright Copyright (c) 2018 Julius Härtl <jus@bitgrid.net>
|
|
|
|
-
|
|
|
|
- @author Julius Härtl <jus@bitgrid.net>
|
|
|
|
-
|
|
|
|
- @license GNU AGPL version 3 or any later version
|
|
|
|
-
|
|
|
|
- This program is free software: you can redistribute it and/or modify
|
|
|
|
- it under the terms of the GNU Affero General Public License as
|
|
|
|
- published by the Free Software Foundation, either version 3 of the
|
|
|
|
- License, or (at your option) any later version.
|
|
|
|
-
|
|
|
|
- This program is distributed in the hope that it will be useful,
|
|
|
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
- GNU Affero General Public License for more details.
|
|
|
|
-
|
|
|
|
- You should have received a copy of the GNU Affero General Public License
|
|
|
|
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
-
|
|
|
|
-->
|
|
|
|
|
|
|
|
<template>
|
2018-11-29 10:51:22 +00:00
|
|
|
<div v-if="item" class="user-entry">
|
2018-10-26 11:08:46 +00:00
|
|
|
<div class="entry-content">
|
|
|
|
<div class="user-avatar">
|
2023-01-19 16:18:11 +00:00
|
|
|
<NcAvatar v-if="isLocal"
|
2022-10-27 13:07:12 +00:00
|
|
|
:size="32"
|
2023-01-19 16:18:11 +00:00
|
|
|
:user="item.username"
|
2019-01-09 14:59:59 +00:00
|
|
|
:disable-tooltip="true" />
|
2023-01-19 16:18:11 +00:00
|
|
|
<NcAvatar v-else :url="item.avatar" />
|
2018-10-26 11:08:46 +00:00
|
|
|
</div>
|
|
|
|
<div class="user-details">
|
2023-01-19 16:18:11 +00:00
|
|
|
<router-link v-if="!serverData.public" :to="{ name: 'profile', params: { account: item.acct }}">
|
2019-01-02 23:25:44 +00:00
|
|
|
<span class="post-author">
|
2023-01-19 16:18:11 +00:00
|
|
|
{{ item.display_name }}
|
2019-01-02 23:25:44 +00:00
|
|
|
</span>
|
|
|
|
<span class="user-description">
|
2023-01-19 16:18:11 +00:00
|
|
|
{{ item.acct }}
|
2019-01-02 23:25:44 +00:00
|
|
|
</span>
|
2018-10-26 11:08:46 +00:00
|
|
|
</router-link>
|
2022-10-27 13:07:12 +00:00
|
|
|
<a v-else
|
|
|
|
:href="item.id"
|
|
|
|
target="_blank"
|
2019-01-09 14:59:59 +00:00
|
|
|
rel="noreferrer">
|
2019-01-02 23:25:44 +00:00
|
|
|
<span class="post-author">
|
2023-01-19 16:18:11 +00:00
|
|
|
{{ item.display_name }}
|
2019-01-02 23:25:44 +00:00
|
|
|
</span>
|
|
|
|
<span class="user-description">
|
2023-01-19 16:18:11 +00:00
|
|
|
{{ item.acct }}
|
2019-01-02 23:25:44 +00:00
|
|
|
</span>
|
2018-12-21 16:33:29 +00:00
|
|
|
</a>
|
2019-01-02 23:25:44 +00:00
|
|
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
2023-01-19 16:18:11 +00:00
|
|
|
<p v-html="item.note" />
|
2018-10-26 11:08:46 +00:00
|
|
|
</div>
|
2023-01-19 16:18:11 +00:00
|
|
|
<FollowButton :account="item.acct" :uid="cloudId" />
|
2018-10-26 11:08:46 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-09-12 13:42:18 +00:00
|
|
|
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
|
|
|
|
import currentUser from '../mixins/currentUserMixin.js'
|
2019-09-09 14:16:40 +00:00
|
|
|
import FollowButton from './FollowButton.vue'
|
2018-10-26 11:08:46 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'UserEntry',
|
|
|
|
components: {
|
2018-12-21 16:33:29 +00:00
|
|
|
FollowButton,
|
2022-09-12 13:42:18 +00:00
|
|
|
NcAvatar,
|
2018-10-26 11:08:46 +00:00
|
|
|
},
|
2018-11-29 10:51:22 +00:00
|
|
|
mixins: [
|
2022-10-27 13:07:12 +00:00
|
|
|
currentUser,
|
2018-11-29 10:51:22 +00:00
|
|
|
],
|
2018-10-26 11:08:46 +00:00
|
|
|
props: {
|
2023-01-19 16:18:11 +00:00
|
|
|
/** @type {import('vue').PropType<import('../types/Mastodon.js').Account>} */
|
|
|
|
item: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {},
|
|
|
|
},
|
2018-10-26 11:08:46 +00:00
|
|
|
},
|
2022-10-27 13:07:12 +00:00
|
|
|
data() {
|
2018-10-26 11:08:46 +00:00
|
|
|
return {
|
2022-10-27 13:07:12 +00:00
|
|
|
followingText: t('social', 'Following'),
|
2018-10-26 11:08:46 +00:00
|
|
|
}
|
2018-12-03 09:02:46 +00:00
|
|
|
},
|
|
|
|
computed: {
|
2023-01-19 16:18:11 +00:00
|
|
|
/**
|
|
|
|
* @return {boolean}
|
|
|
|
*/
|
|
|
|
isLocal() {
|
|
|
|
return !this.item.acct.includes('@')
|
2022-10-27 13:07:12 +00:00
|
|
|
},
|
|
|
|
},
|
2018-10-26 11:08:46 +00:00
|
|
|
}
|
|
|
|
</script>
|
2023-01-12 11:25:21 +00:00
|
|
|
<style scoped lang="scss">
|
|
|
|
.entry-content {
|
|
|
|
height: 50px;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
2018-10-26 11:08:46 +00:00
|
|
|
.user-avatar {
|
2023-01-12 11:25:21 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
2018-10-26 11:08:46 +00:00
|
|
|
margin-right: 10px;
|
|
|
|
flex-shrink: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.user-details {
|
|
|
|
flex-grow: 1;
|
|
|
|
|
2023-01-12 11:25:21 +00:00
|
|
|
.post-author {
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
2018-12-03 07:10:43 +00:00
|
|
|
|
2023-01-12 11:25:21 +00:00
|
|
|
.user-description {
|
|
|
|
opacity: 0.7;
|
|
|
|
}
|
2018-12-03 07:10:43 +00:00
|
|
|
}
|
2023-01-12 11:25:21 +00:00
|
|
|
}
|
2018-12-03 07:10:43 +00:00
|
|
|
|
2018-10-26 11:08:46 +00:00
|
|
|
</style>
|