1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 23:46:30 +02:00

Post --> Note

Closes #1411
This commit is contained in:
syuilo
2018-04-08 02:30:37 +09:00
parent c7106d250c
commit a1b490afa7
167 changed files with 4440 additions and 1762 deletions

View File

@@ -1,10 +1,10 @@
<template>
<div class="root posts">
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:mobile.tags.mk-user-overview-posts.loading%<mk-ellipsis/></p>
<div v-if="!fetching && posts.length > 0">
<mk-post-card v-for="post in posts" :key="post.id" :post="post"/>
<div class="root notes">
<p class="fetching" v-if="fetching">%fa:spinner .pulse .fw%%i18n:mobile.tags.mk-user-overview-notes.loading%<mk-ellipsis/></p>
<div v-if="!fetching && notes.length > 0">
<mk-note-card v-for="note in notes" :key="note.id" :note="note"/>
</div>
<p class="empty" v-if="!fetching && posts.length == 0">%i18n:mobile.tags.mk-user-overview-posts.no-posts%</p>
<p class="empty" v-if="!fetching && notes.length == 0">%i18n:mobile.tags.mk-user-overview-notes.no-notes%</p>
</div>
</template>
@@ -15,14 +15,14 @@ export default Vue.extend({
data() {
return {
fetching: true,
posts: []
notes: []
};
},
mounted() {
(this as any).api('users/posts', {
(this as any).api('users/notes', {
userId: this.user.id
}).then(posts => {
this.posts = posts;
}).then(notes => {
this.notes = notes;
this.fetching = false;
});
}
@@ -30,7 +30,7 @@ export default Vue.extend({
</script>
<style lang="stylus" scoped>
.root.posts
.root.notes
> div
overflow-x scroll

View File

@@ -5,7 +5,7 @@
<a v-for="image in images"
class="img"
:style="`background-image: url(${image.media.url}?thumbnail&size=256)`"
:href="`/@${getAcct(image.post.user)}/${image.post.id}`"
:href="`/@${getAcct(image.note.user)}/${image.note.id}`"
></a>
</div>
<p class="empty" v-if="!fetching && images.length == 0">%i18n:mobile.tags.mk-user-overview-photos.no-photos%</p>
@@ -28,15 +28,15 @@ export default Vue.extend({
getAcct
},
mounted() {
(this as any).api('users/posts', {
(this as any).api('users/notes', {
userId: this.user.id,
withMedia: true,
limit: 6
}).then(posts => {
posts.forEach(post => {
post.media.forEach(media => {
}).then(notes => {
notes.forEach(note => {
note.media.forEach(media => {
if (this.images.length < 9) this.images.push({
post,
note,
media
});
});

View File

@@ -1,10 +1,10 @@
<template>
<div class="root home">
<mk-post-detail v-if="user.pinnedPost" :post="user.pinnedPost" :compact="true"/>
<section class="recent-posts">
<h2>%fa:R comments%%i18n:mobile.tags.mk-user-overview.recent-posts%</h2>
<mk-note-detail v-if="user.pinnedNote" :note="user.pinnedNote" :compact="true"/>
<section class="recent-notes">
<h2>%fa:R comments%%i18n:mobile.tags.mk-user-overview.recent-notes%</h2>
<div>
<x-posts :user="user"/>
<x-notes :user="user"/>
</div>
</section>
<section class="images">
@@ -37,14 +37,14 @@
<script lang="ts">
import Vue from 'vue';
import XPosts from './home.posts.vue';
import XNotes from './home.notes.vue';
import XPhotos from './home.photos.vue';
import XFriends from './home.friends.vue';
import XFollowersYouKnow from './home.followers-you-know.vue';
export default Vue.extend({
components: {
XPosts,
XNotes,
XPhotos,
XFriends,
XFollowersYouKnow
@@ -58,7 +58,7 @@ export default Vue.extend({
max-width 600px
margin 0 auto
> .mk-post-detail
> .mk-note-detail
margin 0 0 8px 0
> section