This commit is contained in:
syuilo 2018-02-19 15:55:17 +09:00
parent 469ff88287
commit 62152bfa6f
6 changed files with 40 additions and 37 deletions

View File

@ -5,10 +5,10 @@
</template> </template>
<div class="user" v-if="!loading && users.length != 0" each={ _user in users }> <div class="user" v-if="!loading && users.length != 0" each={ _user in users }>
<a class="avatar-anchor" href={ '/' + _user.username }> <a class="avatar-anchor" href={ '/' + _user.username }>
<img class="avatar" src={ _user.avatar_url + '?thumbnail&size=42' } alt="" data-user-preview={ _user.id }/> <img class="avatar" src={ _user.avatar_url + '?thumbnail&size=42' } alt="" v-user-preview={ _user.id }/>
</a> </a>
<div class="body"> <div class="body">
<a class="name" href={ '/' + _user.username } data-user-preview={ _user.id }>{ _user.name }</a> <a class="name" href={ '/' + _user.username } v-user-preview={ _user.id }>{ _user.name }</a>
<p class="username">@{ _user.username }</p> <p class="username">@{ _user.username }</p>
</div> </div>
<mk-follow-button user={ _user }/> <mk-follow-button user={ _user }/>

View File

@ -32,6 +32,7 @@ import driveFile from './drive-file.vue';
import driveFolder from './drive-folder.vue'; import driveFolder from './drive-folder.vue';
import driveNavFolder from './drive-nav-folder.vue'; import driveNavFolder from './drive-nav-folder.vue';
import contextMenuMenu from './context-menu-menu.vue'; import contextMenuMenu from './context-menu-menu.vue';
import postDetail from './post-detail.vue';
import wNav from './widgets/nav.vue'; import wNav from './widgets/nav.vue';
import wCalendar from './widgets/calendar.vue'; import wCalendar from './widgets/calendar.vue';
import wPhotoStream from './widgets/photo-stream.vue'; import wPhotoStream from './widgets/photo-stream.vue';
@ -72,6 +73,7 @@ Vue.component('mk-drive-file', driveFile);
Vue.component('mk-drive-folder', driveFolder); Vue.component('mk-drive-folder', driveFolder);
Vue.component('mk-drive-nav-folder', driveNavFolder); Vue.component('mk-drive-nav-folder', driveNavFolder);
Vue.component('context-menu-menu', contextMenuMenu); Vue.component('context-menu-menu', contextMenuMenu);
Vue.component('post-detail', postDetail);
Vue.component('mkw-nav', wNav); Vue.component('mkw-nav', wNav);
Vue.component('mkw-calendar', wCalendar); Vue.component('mkw-calendar', wCalendar);
Vue.component('mkw-photo-stream', wPhotoStream); Vue.component('mkw-photo-stream', wPhotoStream);

View File

@ -1,12 +1,12 @@
<template> <template>
<div class="mk-post-detail-sub" :title="title"> <div class="mk-post-detail-sub" :title="title">
<a class="avatar-anchor" href={ '/' + post.user.username }> <a class="avatar-anchor" href={ '/' + post.user.username }>
<img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ post.user_id }/> <img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=64' } alt="avatar" v-user-preview={ post.user_id }/>
</a> </a>
<div class="main"> <div class="main">
<header> <header>
<div class="left"> <div class="left">
<a class="name" href={ '/' + post.user.username } data-user-preview={ post.user_id }>{ post.user.name }</a> <a class="name" href={ '/' + post.user.username } v-user-preview={ post.user_id }>{ post.user.name }</a>
<span class="username">@{ post.user.username }</span> <span class="username">@{ post.user.username }</span>
</div> </div>
<div class="right"> <div class="right">

View File

@ -1,57 +1,60 @@
<template> <template>
<div class="mk-post-detail" :title="title"> <div class="mk-post-detail" :title="title">
<button class="read-more" v-if="p.reply && p.reply.reply_id && context == null" title="会話をもっと読み込む" @click="loadContext" disabled={ contextFetching }> <button
class="read-more"
v-if="p.reply && p.reply.reply_id && context == null"
title="会話をもっと読み込む"
@click="loadContext"
:disabled="contextFetching"
>
<template v-if="!contextFetching">%fa:ellipsis-v%</template> <template v-if="!contextFetching">%fa:ellipsis-v%</template>
<template v-if="contextFetching">%fa:spinner .pulse%</template> <template v-if="contextFetching">%fa:spinner .pulse%</template>
</button> </button>
<div class="context"> <div class="context">
<template each={ post in context }> <mk-post-detail-sub v-for="post in context" :key="post.id" :post="post"/>
<mk-post-detail-sub post={ post }/>
</template>
</div> </div>
<div class="reply-to" v-if="p.reply"> <div class="reply-to" v-if="p.reply">
<mk-post-detail-sub post={ p.reply }/> <mk-post-detail-sub :post="p.reply"/>
</div> </div>
<div class="repost" v-if="isRepost"> <div class="repost" v-if="isRepost">
<p> <p>
<a class="avatar-anchor" href={ '/' + post.user.username } data-user-preview={ post.user_id }> <router-link class="avatar-anchor" :to="`/${post.user.username}`" v-user-preview="post.user_id">
<img class="avatar" src={ post.user.avatar_url + '?thumbnail&size=32' } alt="avatar"/> <img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
</a> </router-link>
%fa:retweet%<a class="name" href={ '/' + post.user.username }> %fa:retweet%
{ post.user.name } <router-link class="name" :href="`/${post.user.username}`">{{ post.user.name }}</router-link>
</a>
がRepost がRepost
</p> </p>
</div> </div>
<article> <article>
<a class="avatar-anchor" href={ '/' + p.user.username }> <router-link class="avatar-anchor" :to="`/${p.user.username}`">
<img class="avatar" src={ p.user.avatar_url + '?thumbnail&size=64' } alt="avatar" data-user-preview={ p.user.id }/> <img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
</a> </router-link>
<header> <header>
<a class="name" href={ '/' + p.user.username } data-user-preview={ p.user.id }>{ p.user.name }</a> <router-link class="name" :to="`/${p.user.username}`" v-user-preview="p.user.id">{{ p.user.name }}</router-link>
<span class="username">@{ p.user.username }</span> <span class="username">@{{ p.user.username }}</span>
<a class="time" href={ '/' + p.user.username + '/' + p.id }> <router-link class="time" :to="`/${p.user.username}/${p.id}`">
<mk-time time={ p.created_at }/> <mk-time :time="p.created_at"/>
</a> </router-link>
</header> </header>
<div class="body"> <div class="body">
<mk-post-html v-if="p.ast" :ast="p.ast" :i="os.i"/> <mk-post-html v-if="p.ast" :ast="p.ast" :i="os.i"/>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/> <mk-url-preview v-for="url in urls" :url="url" :key="url"/>
<div class="media" v-if="p.media"> <div class="media" v-if="p.media">
<mk-images images={ p.media }/> <mk-images :images="p.media"/>
</div> </div>
<mk-poll v-if="p.poll" post={ p }/> <mk-poll v-if="p.poll" :post="p"/>
</div> </div>
<footer> <footer>
<mk-reactions-viewer post={ p }/> <mk-reactions-viewer :post="p"/>
<button @click="reply" title="返信"> <button @click="reply" title="返信">
%fa:reply%<p class="count" v-if="p.replies_count > 0">{ p.replies_count }</p> %fa:reply%<p class="count" v-if="p.replies_count > 0">{{ p.replies_count }}</p>
</button> </button>
<button @click="repost" title="Repost"> <button @click="repost" title="Repost">
%fa:retweet%<p class="count" v-if="p.repost_count > 0">{ p.repost_count }</p> %fa:retweet%<p class="count" v-if="p.repost_count > 0">{{ p.repost_count }}</p>
</button> </button>
<button :class="{ reacted: p.my_reaction != null }" @click="react" ref="reactButton" title="リアクション"> <button :class="{ reacted: p.my_reaction != null }" @click="react" ref="reactButton" title="リアクション">
%fa:plus%<p class="count" v-if="p.reactions_count > 0">{ p.reactions_count }</p> %fa:plus%<p class="count" v-if="p.reactions_count > 0">{{ p.reactions_count }}</p>
</button> </button>
<button @click="menu" ref="menuButton"> <button @click="menu" ref="menuButton">
%fa:ellipsis-h% %fa:ellipsis-h%
@ -59,9 +62,7 @@
</footer> </footer>
</article> </article>
<div class="replies" v-if="!compact"> <div class="replies" v-if="!compact">
<template each={ post in replies }> <mk-post-detail-sub v-for="post in nreplies" :key="post.id" :post="post"/>
<mk-post-detail-sub post={ post }/>
</template>
</div> </div>
</div> </div>
</template> </template>

View File

@ -4,7 +4,7 @@
<h1>%fa:heart%%i18n:desktop.tags.mk-donation-home-widget.title%</h1> <h1>%fa:heart%%i18n:desktop.tags.mk-donation-home-widget.title%</h1>
<p> <p>
{{ '%i18n:desktop.tags.mk-donation-home-widget.text%'.substr(0, '%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('{')) }} {{ '%i18n:desktop.tags.mk-donation-home-widget.text%'.substr(0, '%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('{')) }}
<a href="/syuilo" data-user-preview="@syuilo">@syuilo</a> <a href="/syuilo" v-user-preview="@syuilo">@syuilo</a>
{{ '%i18n:desktop.tags.mk-donation-home-widget.text%'.substr('%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('}') + 1) }} {{ '%i18n:desktop.tags.mk-donation-home-widget.text%'.substr('%i18n:desktop.tags.mk-donation-home-widget.text%'.indexOf('}') + 1) }}
</p> </p>
</article> </article>

View File

@ -4,10 +4,10 @@
<p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:desktop.tags.mk-user.frequently-replied-users.loading%<mk-ellipsis/></p> <p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:desktop.tags.mk-user.frequently-replied-users.loading%<mk-ellipsis/></p>
<div class="user" v-if="!fetching && users.length != 0" each={ _user in users }> <div class="user" v-if="!fetching && users.length != 0" each={ _user in users }>
<a class="avatar-anchor" href={ '/' + _user.username }> <a class="avatar-anchor" href={ '/' + _user.username }>
<img class="avatar" src={ _user.avatar_url + '?thumbnail&size=42' } alt="" data-user-preview={ _user.id }/> <img class="avatar" src={ _user.avatar_url + '?thumbnail&size=42' } alt="" v-user-preview={ _user.id }/>
</a> </a>
<div class="body"> <div class="body">
<a class="name" href={ '/' + _user.username } data-user-preview={ _user.id }>{ _user.name }</a> <a class="name" href={ '/' + _user.username } v-user-preview={ _user.id }>{ _user.name }</a>
<p class="username">@{ _user.username }</p> <p class="username">@{ _user.username }</p>
</div> </div>
<mk-follow-button user={ _user }/> <mk-follow-button user={ _user }/>