In Reports add link to user's profile page in admin-fe and to user's account in Pleroma

This commit is contained in:
Angelina Filippova 2020-06-10 01:49:20 +03:00
parent 1033eee7e8
commit a8fb2a7255
5 changed files with 79 additions and 52 deletions

View file

@ -104,7 +104,7 @@
<div class="status-footer"> <div class="status-footer">
<span class="status-created-at">{{ parseTimestamp(status.created_at) }}</span> <span class="status-created-at">{{ parseTimestamp(status.created_at) }}</span>
<a v-if="status.url" :href="status.url" target="_blank" class="account" @click.stop> <a v-if="status.url" :href="status.url" target="_blank" class="account" @click.stop>
Open status in instance {{ $t('statuses.openStatusInInstance') }}
<i class="el-icon-top-right"/> <i class="el-icon-top-right"/>
</a> </a>
</div> </div>

View file

@ -254,7 +254,8 @@ export default {
direct: 'Direct', direct: 'Direct',
private: 'Private', private: 'Private',
public: 'Public', public: 'Public',
unlisted: 'Unlisted' unlisted: 'Unlisted',
openStatusInInstance: 'Open status in instance'
}, },
userProfile: { userProfile: {
tags: 'Tags', tags: 'Tags',
@ -270,6 +271,7 @@ export default {
status: 'Status', status: 'Status',
deactivated: 'Deactivated', deactivated: 'Deactivated',
noStatuses: 'No statuses to show', noStatuses: 'No statuses to show',
openAccountInInstance: 'Open account in instance',
securitySettings: { securitySettings: {
email: 'Email', email: 'Email',
password: 'Password', password: 'Password',

View file

@ -27,23 +27,28 @@
<moderate-user-dropdown v-if="propertyExists(report.account, 'nickname')" :account="report.account"/> <moderate-user-dropdown v-if="propertyExists(report.account, 'nickname')" :account="report.account"/>
</div> </div>
</div> </div>
<div> <el-divider class="divider"/>
<el-divider class="divider"/> <div class="report-account-container">
<span class="report-row-key">{{ $t('reports.account') }}:</span> <span class="report-row-key">{{ $t('reports.account') }}:</span>
<img <div class="report-account">
v-if="propertyExists(report.account, 'avatar')" <router-link
:src="report.account.avatar" v-if="propertyExists(report.account, 'id')"
alt="avatar" :to="{ name: 'UsersShow', params: { id: report.account.id }}"
class="avatar-img"> class="router-link">
<a v-if="propertyExists(report.account, 'url', 'nickname')" :href="report.account.url" target="_blank" class="account"> <img
<span class="report-account-name">{{ report.account.nickname }}</span> v-if="propertyExists(report.account, 'avatar')"
</a> :src="report.account.avatar"
<span v-else> alt="avatar"
<span v-if="propertyExists(report.account, 'nickname')" class="report-account-name"> class="avatar-img">
{{ report.account.nickname }} <span v-if="propertyExists(report.account, 'nickname')" class="report-account-name">{{ report.account.nickname }}</span>
</span> <span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span>
</router-link>
<span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span> <span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span>
</span> <a v-if="propertyExists(report.account, 'url')" :href="report.account.url" target="_blank" class="account">
{{ $t('userProfile.openAccountInInstance') }}
<i class="el-icon-top-right"/>
</a>
</div>
</div> </div>
<div v-if="report.content && report.content.length > 0"> <div v-if="report.content && report.content.length > 0">
<el-divider class="divider"/> <el-divider class="divider"/>
@ -51,25 +56,30 @@
<span>{{ report.content }}</span> <span>{{ report.content }}</span>
</span> </span>
</div> </div>
<div :style="showStatuses(report.statuses) ? '' : 'margin-bottom:15px'"> <el-divider class="divider"/>
<el-divider class="divider"/> <div :style="showStatuses(report.statuses) ? '' : 'margin-bottom:15px'" class="report-account-container">
<span class="report-row-key">{{ $t('reports.actor') }}:</span> <span class="report-row-key">{{ $t('reports.actor') }}:</span>
<img <div class="report-account">
v-if="propertyExists(report.actor, 'avatar')" <router-link
:src="report.actor.avatar" v-if="propertyExists(report.actor, 'id')"
alt="avatar" :to="{ name: 'UsersShow', params: { id: report.actor.id }}"
class="avatar-img"> class="router-link">
<a v-if="propertyExists(report.actor, 'url', 'nickname')" :href="report.actor.url" target="_blank" class="account"> <img
<span class="report-account-name">{{ report.actor.nickname }}</span> v-if="propertyExists(report.actor, 'avatar')"
</a> :src="report.actor.avatar"
<span v-else> alt="avatar"
<span v-if="propertyExists(report.actor, 'nickname')" class="report-account-name"> class="avatar-img">
{{ report.actor.nickname }} <span v-if="propertyExists(report.actor, 'nickname')" class="report-account-name">{{ report.actor.nickname }}</span>
</span> <span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span>
</router-link>
<span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span> <span v-else class="report-account-name deactivated">({{ $t('users.invalidNickname') }})</span>
</span> <a v-if="propertyExists(report.actor, 'url')" :href="report.actor.url" target="_blank" class="account">
{{ $t('userProfile.openAccountInInstance') }}
<i class="el-icon-top-right"/>
</a>
</div>
</div> </div>
<div v-if="showStatuses(report.statuses)" class="statuses"> <div v-if="showStatuses(report.statuses)" class="reported-statuses">
<el-collapse> <el-collapse>
<el-collapse-item :title="getStatusesTitle(report.statuses)"> <el-collapse-item :title="getStatusesTitle(report.statuses)">
<div v-for="status in report.statuses" :key="status.id"> <div v-for="status in report.statuses" :key="status.id">
@ -192,14 +202,22 @@ export default {
</script> </script>
<style rel='stylesheet/scss' lang='scss'> <style rel='stylesheet/scss' lang='scss'>
h4 {
margin: 0;
height: 17px;
}
.account { .account {
line-height: 26px;
font-size: 13px;
color: #606266;
}
.account:hover {
text-decoration: underline; text-decoration: underline;
} }
.avatar-img { .avatar-img {
vertical-align: bottom; vertical-align: bottom;
width: 15px; width: 15px;
height: 15px; height: 15px;
margin-left: 5px;
} }
.divider { .divider {
margin: 15px 0; margin: 15px 0;
@ -231,18 +249,6 @@ export default {
padding: 10px 5px 10px 10px; padding: 10px 5px 10px 10px;
cursor: pointer; cursor: pointer;
} }
h4 {
margin: 0;
height: 17px;
}
.report {
.report-header-container {
display: flex;
justify-content: space-between;
align-items: baseline;
height: 40px;
}
}
.id { .id {
color: gray; color: gray;
margin-top: 6px; margin-top: 6px;
@ -269,6 +275,24 @@ export default {
font-style: italic; font-style: italic;
color: gray; color: gray;
} }
.report {
.report-header-container {
display: flex;
justify-content: space-between;
align-items: baseline;
height: 40px;
}
}
.report-account {
display: flex;
align-items: baseline;
justify-content: space-between;
flex-grow: 2;
}
.report-account-container {
display: flex;
align-items: baseline;
}
.report-account-name { .report-account-name {
font-size: 15px; font-size: 15px;
font-weight: 500; font-weight: 500;
@ -276,9 +300,7 @@ export default {
.report-row-key { .report-row-key {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
} padding-right: 5px;
.report-row-key {
font-size: 14px;
} }
.report-title { .report-title {
margin: 0; margin: 0;
@ -298,7 +320,10 @@ export default {
margin: 30px 45px 45px 19px; margin: 30px 45px 45px 19px;
padding: 0px; padding: 0px;
} }
.statuses { .router-link {
text-decoration: none;
}
.reported-statuses {
margin-top: 15px; margin-top: 15px;
} }
.submit-button { .submit-button {

View file

@ -13,7 +13,7 @@
</div> </div>
</router-link> </router-link>
<a v-if="propertyExists(user, 'url')" :href="user.url" target="_blank"> <a v-if="propertyExists(user, 'url')" :href="user.url" target="_blank">
<i class="el-icon-top-right" title="Open user in instance"/> <i :title="$t('userProfile.openAccountInInstance')" class="el-icon-top-right"/>
</a> </a>
</div> </div>
<div class="left-header-container"> <div class="left-header-container">

View file

@ -6,7 +6,7 @@
<h1 v-if="propertyExists(user, 'nickname')">{{ user.nickname }}</h1> <h1 v-if="propertyExists(user, 'nickname')">{{ user.nickname }}</h1>
<h1 v-else class="invalid">({{ $t('users.invalidNickname') }})</h1> <h1 v-else class="invalid">({{ $t('users.invalidNickname') }})</h1>
<a v-if="propertyExists(user, 'url')" :href="user.url" target="_blank"> <a v-if="propertyExists(user, 'url')" :href="user.url" target="_blank">
<i class="el-icon-top-right" title="Open user in instance"/> <i :title="$t('userProfile.openAccountInInstance')" class="el-icon-top-right"/>
</a> </a>
</div> </div>
<div class="left-header-container"> <div class="left-header-container">