Refactor
This commit is contained in:
parent
2a5016865a
commit
98fe9c39eb
57 changed files with 2846 additions and 422 deletions
|
|
@ -2,8 +2,8 @@
|
|||
<div class="note">
|
||||
<header>
|
||||
<a class="index" @click="reply">{{ note.index }}:</a>
|
||||
<router-link class="name" :to="`/@${acct}`" v-user-preview="note.user.id"><b>{{ name }}</b></router-link>
|
||||
<span>ID:<i>{{ acct }}</i></span>
|
||||
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id"><b>{{ note.user | userName }}</b></router-link>
|
||||
<span>ID:<i>{{ note.user | acct }}</i></span>
|
||||
</header>
|
||||
<div>
|
||||
<a v-if="note.reply">>>{{ note.reply.index }}</a>
|
||||
|
|
@ -19,19 +19,9 @@
|
|||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['note'],
|
||||
computed: {
|
||||
acct() {
|
||||
return getAcct(this.note.user);
|
||||
},
|
||||
name() {
|
||||
return getUserName(this.note.user);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
reply() {
|
||||
this.$emit('reply', this.note);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
<template>
|
||||
<div class="note">
|
||||
<header>
|
||||
<a class="index" @click="reply">{{ note.index }}:</a>
|
||||
<router-link class="name" :to="note.user | userPage" v-user-preview="note.user.id"><b>{{ note.user | userName }}</b></router-link>
|
||||
<span>ID:<i>{{ note.user | acct }}</i></span>
|
||||
</header>
|
||||
<div>
|
||||
<a v-if="note.reply">>>{{ note.reply.index }}</a>
|
||||
{{ note.text }}
|
||||
<div class="media" v-if="note.media">
|
||||
<a v-for="file in note.media" :href="file.url" target="_blank">
|
||||
<img :src="`${file.url}?thumbnail&size=512`" :alt="file.name" :title="file.name"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['note'],
|
||||
methods: {
|
||||
reply() {
|
||||
this.$emit('reply', this.note);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.note
|
||||
margin 0
|
||||
padding 0
|
||||
color #444
|
||||
|
||||
> header
|
||||
position -webkit-sticky
|
||||
position sticky
|
||||
z-index 1
|
||||
top 0
|
||||
padding 8px 4px 4px 16px
|
||||
background rgba(255, 255, 255, 0.9)
|
||||
|
||||
> .index
|
||||
margin-right 0.25em
|
||||
|
||||
> .name
|
||||
margin-right 0.5em
|
||||
color #008000
|
||||
|
||||
> div
|
||||
padding 0 16px 16px 16px
|
||||
|
||||
> .media
|
||||
> a
|
||||
display inline-block
|
||||
|
||||
> img
|
||||
max-width 100%
|
||||
vertical-align bottom
|
||||
|
||||
</style>
|
||||
|
|
@ -15,14 +15,13 @@
|
|||
title="クリックでアバター編集"
|
||||
v-user-preview="os.i.id"
|
||||
/>
|
||||
<router-link class="name" :to="`/@${os.i.username}`">{{ name }}</router-link>
|
||||
<p class="username">@{{ os.i.username }}</p>
|
||||
<router-link class="name" :to="os.i | userPage">{{ os.i | userName }}</router-link>
|
||||
<p class="username">@{{ os.i | acct }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import define from '../../../common/define-widget';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
export default define({
|
||||
name: 'profile',
|
||||
|
|
@ -30,11 +29,6 @@ export default define({
|
|||
design: 0
|
||||
})
|
||||
}).extend({
|
||||
computed: {
|
||||
name() {
|
||||
return getUserName(this.os.i);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
func() {
|
||||
if (this.props.design == 2) {
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:common.loading%<mk-ellipsis/></p>
|
||||
<template v-else-if="users.length != 0">
|
||||
<div class="user" v-for="_user in users">
|
||||
<router-link class="avatar-anchor" :to="`/@${getAcct(_user)}`">
|
||||
<router-link class="avatar-anchor" :to="_user | userPage">
|
||||
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
|
||||
</router-link>
|
||||
<div class="body">
|
||||
<router-link class="name" :to="`/@${getAcct(_user)}`" v-user-preview="_user.id">{{ getUserName(_user) }}</router-link>
|
||||
<p class="username">@{{ getAcct(_user) }}</p>
|
||||
<router-link class="name" :to="_user | userPage" v-user-preview="_user.id">{{ _user | userName }}</router-link>
|
||||
<p class="username">@{{ _user | acct }}</p>
|
||||
</div>
|
||||
<mk-follow-button :user="_user"/>
|
||||
</div>
|
||||
|
|
@ -23,8 +23,6 @@
|
|||
|
||||
<script lang="ts">
|
||||
import define from '../../../common/define-widget';
|
||||
import getAcct from '../../../../../acct/render';
|
||||
import getUserName from '../../../../../renderers/get-user-name';
|
||||
|
||||
const limit = 3;
|
||||
|
||||
|
|
@ -45,8 +43,6 @@ export default define({
|
|||
this.fetch();
|
||||
},
|
||||
methods: {
|
||||
getAcct,
|
||||
getUserName,
|
||||
func() {
|
||||
this.props.compact = !this.props.compact;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue