2019-02-14 21:08:59 +01:00
|
|
|
<template>
|
2019-02-16 02:58:44 +01:00
|
|
|
<div class="omechnps" v-if="!fetching">
|
2019-02-14 21:08:59 +01:00
|
|
|
<div class="is-suspended" v-if="user.isSuspended"><fa icon="exclamation-triangle"/> {{ $t('@.user-suspended') }}</div>
|
|
|
|
<div class="is-remote" v-if="user.host != null"><fa icon="exclamation-triangle"/> {{ $t('@.is-remote-user') }}<a :href="user.url || user.uri" target="_blank">{{ $t('@.view-on-remote') }}</a></div>
|
|
|
|
<div class="main">
|
2019-02-16 02:58:44 +01:00
|
|
|
<x-header class="header" :user="user"/>
|
|
|
|
<router-view :user="user"></router-view>
|
2019-02-14 21:08:59 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
import i18n from '../../../../i18n';
|
|
|
|
import parseAcct from '../../../../../../misc/acct/parse';
|
|
|
|
import Progress from '../../../../common/scripts/loading';
|
|
|
|
import XHeader from './user.header.vue';
|
|
|
|
|
|
|
|
export default Vue.extend({
|
|
|
|
i18n: i18n(),
|
|
|
|
components: {
|
2019-02-16 02:58:44 +01:00
|
|
|
XHeader
|
2019-02-14 21:08:59 +01:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
fetching: true,
|
|
|
|
user: null
|
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route: 'fetch'
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.fetch();
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
fetch() {
|
|
|
|
this.fetching = true;
|
|
|
|
Progress.start();
|
|
|
|
this.$root.api('users/show', parseAcct(this.$route.params.user)).then(user => {
|
|
|
|
this.user = user;
|
|
|
|
this.fetching = false;
|
|
|
|
Progress.done();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
warp(date) {
|
|
|
|
(this.$refs.tl as any).warp(date);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="stylus" scoped>
|
2019-02-16 02:58:44 +01:00
|
|
|
.omechnps
|
2019-02-14 21:08:59 +01:00
|
|
|
width 100%
|
|
|
|
margin 0 auto
|
|
|
|
|
|
|
|
> .is-suspended
|
|
|
|
> .is-remote
|
|
|
|
margin-bottom 16px
|
|
|
|
padding 14px 16px
|
|
|
|
font-size 14px
|
|
|
|
box-shadow var(--shadow)
|
|
|
|
border-radius var(--round)
|
|
|
|
|
|
|
|
&.is-suspended
|
|
|
|
color var(--suspendedInfoFg)
|
|
|
|
background var(--suspendedInfoBg)
|
|
|
|
|
|
|
|
&.is-remote
|
|
|
|
color var(--remoteInfoFg)
|
|
|
|
background var(--remoteInfoBg)
|
|
|
|
|
|
|
|
> a
|
|
|
|
font-weight bold
|
|
|
|
|
|
|
|
> .main
|
2019-02-16 02:58:44 +01:00
|
|
|
> .header
|
2019-02-14 21:08:59 +01:00
|
|
|
margin-bottom 16px
|
|
|
|
|
|
|
|
</style>
|