This commit is contained in:
syuilo 2018-04-15 18:38:40 +09:00
parent 10e3411020
commit a9ea405c0c
6 changed files with 53 additions and 9 deletions
locales
src
client/app
desktop/views/pages/user
mobile/views/pages
models
remote/activitypub/objects

View file

@ -403,6 +403,10 @@ desktop/views/pages/user/user.friends.vue:
loading: "Loading"
no-users: "No users"
desktop/views/pages/user/user.header.vue:
is-remote: "This user is not a user of Misskey, so the information is not accurate."
view-remote: "See accurate information"
desktop/views/pages/user/user.home.vue:
last-used-at: "Last used at"
@ -585,6 +589,8 @@ mobile/views/pages/user.vue:
overview: "Overview"
timeline: "Timeline"
media: "Media"
is-remote: "This user is not a user of Misskey, so the information is not accurate."
view-remote: "See accurate information"
mobile/views/pages/user/home.vue:
recent-notes: "Recent notes"

View file

@ -403,6 +403,10 @@ desktop/views/pages/user/user.friends.vue:
loading: "読み込み中"
no-users: "よく話すユーザーはいません"
desktop/views/pages/user/user.header.vue:
is-remote: "このユーザーはMisskeyのユーザーではないため情報が正確ではありません。"
view-remote: "正確な情報を見る"
desktop/views/pages/user/user.home.vue:
last-used-at: "最終アクセス"
@ -585,6 +589,8 @@ mobile/views/pages/user.vue:
overview: "概要"
timeline: "タイムライン"
media: "メディア"
is-remote: "このユーザーはMisskeyのユーザーではないため情報が正確ではありません。"
view-remote: "正確な情報を見る"
mobile/views/pages/user/home.vue:
recent-notes: "最近の投稿"

View file

@ -1,5 +1,6 @@
<template>
<div class="header" :data-is-dark-background="user.bannerUrl != null">
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote% <a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<div class="banner-container" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
</div>
@ -26,14 +27,18 @@ import Vue from 'vue';
export default Vue.extend({
props: ['user'],
mounted() {
window.addEventListener('load', this.onScroll);
window.addEventListener('scroll', this.onScroll);
window.addEventListener('resize', this.onScroll);
if (this.user.bannerUrl) {
window.addEventListener('load', this.onScroll);
window.addEventListener('scroll', this.onScroll);
window.addEventListener('resize', this.onScroll);
}
},
beforeDestroy() {
window.removeEventListener('load', this.onScroll);
window.removeEventListener('scroll', this.onScroll);
window.removeEventListener('resize', this.onScroll);
if (this.user.bannerUrl) {
window.removeEventListener('load', this.onScroll);
window.removeEventListener('scroll', this.onScroll);
window.removeEventListener('resize', this.onScroll);
}
},
methods: {
onScroll() {
@ -68,9 +73,21 @@ export default Vue.extend({
$footer-height = 58px
overflow hidden
background #f7f7f7
background #bfccd0
box-shadow 0 1px 1px rgba(0, 0, 0, 0.075)
> .is-remote
padding 16px
color #573c08
background #fff0db
> p
margin 0 auto
max-width 1024px
> a
font-weight bold
&[data-is-dark-background]
> .banner-container
> .banner
@ -130,7 +147,7 @@ export default Vue.extend({
left 0
width 100%
padding 0 0 8px 195px
color #656565
color #5e6367
font-family '游ゴシック', 'YuGothic', 'ヒラギノ角ゴ ProN W3', 'Hiragino Kaku Gothic ProN', 'Meiryo', 'メイリオ', sans-serif
> .name

View file

@ -2,6 +2,7 @@
<mk-ui>
<span slot="header" v-if="!fetching">%fa:user% {{ user | userName }}</span>
<main v-if="!fetching">
<div class="is-remote" v-if="user.host != null"><p>%fa:exclamation-triangle% %i18n:@is-remote% <a :href="user.url || user.uri" target="_blank">%i18n:@view-remote%</a></p></div>
<header>
<div class="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''"></div>
<div class="body">
@ -109,6 +110,18 @@ export default Vue.extend({
@import '~const.styl'
main
> .is-remote
padding 16px
color #573c08
background #fff0db
> p
margin 0 auto
max-width 1024px
> a
font-weight bold
> header
> .banner

View file

@ -88,6 +88,7 @@ export interface ILocalUser extends IUserBase {
export interface IRemoteUser extends IUserBase {
inbox: string;
uri: string;
url?: string;
publicKey: {
id: string;
publicKeyPem: string;

View file

@ -96,7 +96,8 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
publicKeyPem: person.publicKey.publicKeyPem
},
inbox: person.inbox,
uri: person.id
uri: person.id,
url: person.url
}) as IRemoteUser;
//#region アイコンとヘッダー画像をフェッチ