✌️
This commit is contained in:
		
							parent
							
								
									073a2def64
								
							
						
					
					
						commit
						e1984e3991
					
				
					 5 changed files with 68 additions and 101 deletions
				
			
		| 
						 | 
					@ -2,6 +2,7 @@ import Vue from 'vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import ui from './ui.vue';
 | 
					import ui from './ui.vue';
 | 
				
			||||||
import timeline from './timeline.vue';
 | 
					import timeline from './timeline.vue';
 | 
				
			||||||
 | 
					import post from './post.vue';
 | 
				
			||||||
import posts from './posts.vue';
 | 
					import posts from './posts.vue';
 | 
				
			||||||
import imagesImage from './images-image.vue';
 | 
					import imagesImage from './images-image.vue';
 | 
				
			||||||
import drive from './drive.vue';
 | 
					import drive from './drive.vue';
 | 
				
			||||||
| 
						 | 
					@ -23,6 +24,7 @@ import widgetContainer from './widget-container.vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Vue.component('mk-ui', ui);
 | 
					Vue.component('mk-ui', ui);
 | 
				
			||||||
Vue.component('mk-timeline', timeline);
 | 
					Vue.component('mk-timeline', timeline);
 | 
				
			||||||
 | 
					Vue.component('mk-post', post);
 | 
				
			||||||
Vue.component('mk-posts', posts);
 | 
					Vue.component('mk-posts', posts);
 | 
				
			||||||
Vue.component('mk-images-image', imagesImage);
 | 
					Vue.component('mk-images-image', imagesImage);
 | 
				
			||||||
Vue.component('mk-drive', drive);
 | 
					Vue.component('mk-drive', drive);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,7 @@
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
<div class="mk-notification" :class="notification.type">
 | 
					<div class="mk-notification">
 | 
				
			||||||
	<mk-time :time="notification.created_at"/>
 | 
						<div class="notification reaction" v-if="notification.type == 'reaction'">
 | 
				
			||||||
 | 
							<mk-time :time="notification.created_at"/>
 | 
				
			||||||
	<template v-if="notification.type == 'reaction'">
 | 
					 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
							<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
				
			||||||
			<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
								<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
				
			||||||
		</router-link>
 | 
							</router-link>
 | 
				
			||||||
| 
						 | 
					@ -16,9 +15,10 @@
 | 
				
			||||||
				%fa:quote-right%
 | 
									%fa:quote-right%
 | 
				
			||||||
			</router-link>
 | 
								</router-link>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</template>
 | 
						</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'repost'">
 | 
						<div class="notification repost" v-if="notification.type == 'repost'">
 | 
				
			||||||
 | 
							<mk-time :time="notification.created_at"/>
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.post.user.username}`">
 | 
							<router-link class="avatar-anchor" :to="`/${notification.post.user.username}`">
 | 
				
			||||||
			<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
								<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
				
			||||||
		</router-link>
 | 
							</router-link>
 | 
				
			||||||
| 
						 | 
					@ -31,22 +31,14 @@
 | 
				
			||||||
				%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%
 | 
									%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%
 | 
				
			||||||
			</router-link>
 | 
								</router-link>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</template>
 | 
						</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'quote'">
 | 
						<template v-if="notification.type == 'quote'">
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.post.user.username}`">
 | 
							<mk-post :post="notification.post"/>
 | 
				
			||||||
			<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
					 | 
				
			||||||
		</router-link>
 | 
					 | 
				
			||||||
		<div class="text">
 | 
					 | 
				
			||||||
			<p>
 | 
					 | 
				
			||||||
				%fa:quote-left%
 | 
					 | 
				
			||||||
				<router-link :to="`/${notification.post.user.username}`">{{ notification.post.user.name }}</router-link>
 | 
					 | 
				
			||||||
			</p>
 | 
					 | 
				
			||||||
			<router-link class="post-preview" :to="`/${notification.post.user.username}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</router-link>
 | 
					 | 
				
			||||||
		</div>
 | 
					 | 
				
			||||||
	</template>
 | 
						</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'follow'">
 | 
						<div class="notification follow" v-if="notification.type == 'follow'">
 | 
				
			||||||
 | 
							<mk-time :time="notification.created_at"/>
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
							<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
				
			||||||
			<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
								<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
				
			||||||
		</router-link>
 | 
							</router-link>
 | 
				
			||||||
| 
						 | 
					@ -56,35 +48,18 @@
 | 
				
			||||||
				<router-link :to="`/${notification.user.username}`">{{ notification.user.name }}</router-link>
 | 
									<router-link :to="`/${notification.user.username}`">{{ notification.user.name }}</router-link>
 | 
				
			||||||
			</p>
 | 
								</p>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</template>
 | 
						</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'reply'">
 | 
						<template v-if="notification.type == 'reply'">
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.post.user.username}`">
 | 
							<mk-post :post="notification.post"/>
 | 
				
			||||||
			<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
					 | 
				
			||||||
		</router-link>
 | 
					 | 
				
			||||||
		<div class="text">
 | 
					 | 
				
			||||||
			<p>
 | 
					 | 
				
			||||||
				%fa:reply%
 | 
					 | 
				
			||||||
				<router-link :to="`/${notification.post.user.username}`">{{ notification.post.user.name }}</router-link>
 | 
					 | 
				
			||||||
			</p>
 | 
					 | 
				
			||||||
			<router-link class="post-preview" :to="`/${notification.post.user.username}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</router-link>
 | 
					 | 
				
			||||||
		</div>
 | 
					 | 
				
			||||||
	</template>
 | 
						</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'mention'">
 | 
						<template v-if="notification.type == 'mention'">
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.post.user.username}`">
 | 
							<mk-post :post="notification.post"/>
 | 
				
			||||||
			<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
					 | 
				
			||||||
		</router-link>
 | 
					 | 
				
			||||||
		<div class="text">
 | 
					 | 
				
			||||||
			<p>
 | 
					 | 
				
			||||||
				%fa:at%
 | 
					 | 
				
			||||||
				<router-link :to="`/${notification.post.user.username}`">{{ notification.post.user.name }}</router-link>
 | 
					 | 
				
			||||||
			</p>
 | 
					 | 
				
			||||||
			<router-link class="post-preview" :to="`/${notification.post.user.username}/${notification.post.id}`">{{ getPostSummary(notification.post) }}</router-link>
 | 
					 | 
				
			||||||
		</div>
 | 
					 | 
				
			||||||
	</template>
 | 
						</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<template v-if="notification.type == 'poll_vote'">
 | 
						<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
 | 
				
			||||||
 | 
							<mk-time :time="notification.created_at"/>
 | 
				
			||||||
		<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
							<router-link class="avatar-anchor" :to="`/${notification.user.username}`">
 | 
				
			||||||
			<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
								<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
 | 
				
			||||||
		</router-link>
 | 
							</router-link>
 | 
				
			||||||
| 
						 | 
					@ -97,7 +72,7 @@
 | 
				
			||||||
				%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%
 | 
									%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%
 | 
				
			||||||
			</router-link>
 | 
								</router-link>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
	</template>
 | 
						</div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -117,73 +92,67 @@ export default Vue.extend({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style lang="stylus" scoped>
 | 
					<style lang="stylus" scoped>
 | 
				
			||||||
.mk-notification
 | 
					.mk-notification
 | 
				
			||||||
	margin 0
 | 
					 | 
				
			||||||
	padding 16px
 | 
					 | 
				
			||||||
	overflow-wrap break-word
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	> .mk-time
 | 
						> .notification
 | 
				
			||||||
		display inline
 | 
							padding 16px
 | 
				
			||||||
		position absolute
 | 
							overflow-wrap break-word
 | 
				
			||||||
		top 16px
 | 
					 | 
				
			||||||
		right 12px
 | 
					 | 
				
			||||||
		vertical-align top
 | 
					 | 
				
			||||||
		color rgba(0, 0, 0, 0.6)
 | 
					 | 
				
			||||||
		font-size 12px
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	&:after
 | 
							&:after
 | 
				
			||||||
		content ""
 | 
								content ""
 | 
				
			||||||
		display block
 | 
								display block
 | 
				
			||||||
		clear both
 | 
								clear both
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.avatar-anchor
 | 
							> .mk-time
 | 
				
			||||||
		display block
 | 
								display inline
 | 
				
			||||||
		float left
 | 
								position absolute
 | 
				
			||||||
 | 
								top 16px
 | 
				
			||||||
 | 
								right 12px
 | 
				
			||||||
 | 
								vertical-align top
 | 
				
			||||||
 | 
								color rgba(0, 0, 0, 0.6)
 | 
				
			||||||
 | 
								font-size 0.9em
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		img
 | 
							> .avatar-anchor
 | 
				
			||||||
			min-width 36px
 | 
								display block
 | 
				
			||||||
			min-height 36px
 | 
								float left
 | 
				
			||||||
			max-width 36px
 | 
					 | 
				
			||||||
			max-height 36px
 | 
					 | 
				
			||||||
			border-radius 6px
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.text
 | 
								img
 | 
				
			||||||
		float right
 | 
									min-width 36px
 | 
				
			||||||
		width calc(100% - 36px)
 | 
									min-height 36px
 | 
				
			||||||
		padding-left 8px
 | 
									max-width 36px
 | 
				
			||||||
 | 
									max-height 36px
 | 
				
			||||||
 | 
									border-radius 6px
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		p
 | 
							> .text
 | 
				
			||||||
			margin 0
 | 
								float right
 | 
				
			||||||
 | 
								width calc(100% - 36px)
 | 
				
			||||||
 | 
								padding-left 8px
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			i, .mk-reaction-icon
 | 
								p
 | 
				
			||||||
				margin-right 4px
 | 
									margin 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.post-preview
 | 
									i, .mk-reaction-icon
 | 
				
			||||||
		color rgba(0, 0, 0, 0.7)
 | 
										margin-right 4px
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	.post-ref
 | 
								> .post-preview
 | 
				
			||||||
		color rgba(0, 0, 0, 0.7)
 | 
									color rgba(0, 0, 0, 0.7)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		[data-fa]
 | 
								> .post-ref
 | 
				
			||||||
			font-size 1em
 | 
									color rgba(0, 0, 0, 0.7)
 | 
				
			||||||
			font-weight normal
 | 
					 | 
				
			||||||
			font-style normal
 | 
					 | 
				
			||||||
			display inline-block
 | 
					 | 
				
			||||||
			margin-right 3px
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	&.repost, &.quote
 | 
									[data-fa]
 | 
				
			||||||
		.text p i
 | 
										font-size 1em
 | 
				
			||||||
			color #77B255
 | 
										font-weight normal
 | 
				
			||||||
 | 
										font-style normal
 | 
				
			||||||
 | 
										display inline-block
 | 
				
			||||||
 | 
										margin-right 3px
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	&.follow
 | 
							&.repost
 | 
				
			||||||
		.text p i
 | 
								.text p i
 | 
				
			||||||
			color #53c7ce
 | 
									color #77B255
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	&.reply, &.mention
 | 
							&.follow
 | 
				
			||||||
		.text p i
 | 
								.text p i
 | 
				
			||||||
			color #555
 | 
									color #53c7ce
 | 
				
			||||||
 | 
					 | 
				
			||||||
		.post-preview
 | 
					 | 
				
			||||||
			color rgba(0, 0, 0, 0.7)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
</style>
 | 
					</style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -77,7 +77,7 @@
 | 
				
			||||||
import Vue from 'vue';
 | 
					import Vue from 'vue';
 | 
				
			||||||
import MkPostMenu from '../../../common/views/components/post-menu.vue';
 | 
					import MkPostMenu from '../../../common/views/components/post-menu.vue';
 | 
				
			||||||
import MkReactionPicker from '../../../common/views/components/reaction-picker.vue';
 | 
					import MkReactionPicker from '../../../common/views/components/reaction-picker.vue';
 | 
				
			||||||
import XSub from './posts.post.sub.vue';
 | 
					import XSub from './post.sub.vue';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default Vue.extend({
 | 
					export default Vue.extend({
 | 
				
			||||||
	components: {
 | 
						components: {
 | 
				
			||||||
| 
						 | 
					@ -3,7 +3,7 @@
 | 
				
			||||||
	<slot name="head"></slot>
 | 
						<slot name="head"></slot>
 | 
				
			||||||
	<slot></slot>
 | 
						<slot></slot>
 | 
				
			||||||
	<template v-for="(post, i) in _posts">
 | 
						<template v-for="(post, i) in _posts">
 | 
				
			||||||
		<x-post :post="post" :key="post.id" @update:post="onPostUpdated(i, $event)"/>
 | 
							<mk-post :post="post" :key="post.id" @update:post="onPostUpdated(i, $event)"/>
 | 
				
			||||||
		<p class="date" v-if="i != posts.length - 1 && post._date != _posts[i + 1]._date">
 | 
							<p class="date" v-if="i != posts.length - 1 && post._date != _posts[i + 1]._date">
 | 
				
			||||||
			<span>%fa:angle-up%{{ post._datetext }}</span>
 | 
								<span>%fa:angle-up%{{ post._datetext }}</span>
 | 
				
			||||||
			<span>%fa:angle-down%{{ _posts[i + 1]._datetext }}</span>
 | 
								<span>%fa:angle-down%{{ _posts[i + 1]._datetext }}</span>
 | 
				
			||||||
| 
						 | 
					@ -17,12 +17,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script lang="ts">
 | 
					<script lang="ts">
 | 
				
			||||||
import Vue from 'vue';
 | 
					import Vue from 'vue';
 | 
				
			||||||
import XPost from './posts.post.vue';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default Vue.extend({
 | 
					export default Vue.extend({
 | 
				
			||||||
	components: {
 | 
					 | 
				
			||||||
		XPost
 | 
					 | 
				
			||||||
	},
 | 
					 | 
				
			||||||
	props: {
 | 
						props: {
 | 
				
			||||||
		posts: {
 | 
							posts: {
 | 
				
			||||||
			type: Array,
 | 
								type: Array,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue