This commit is contained in:
syuilo 2018-03-05 13:46:54 +09:00
parent 47c1139a49
commit 5c6dfe5bb6
4 changed files with 32 additions and 4 deletions

View file

@ -49,6 +49,9 @@
</div> </div>
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a> <a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
<div class="map" v-if="p.geo" ref="map"></div> <div class="map" v-if="p.geo" ref="map"></div>
<div class="repost" v-if="p.repost">
<mk-post-preview :post="p.repost"/>
</div>
</div> </div>
<footer> <footer>
<mk-reactions-viewer :post="p"/> <mk-reactions-viewer :post="p"/>
@ -104,7 +107,10 @@ export default Vue.extend({
}, },
computed: { computed: {
isRepost(): boolean { isRepost(): boolean {
return this.post.repost != null; return (this.post.repost &&
this.post.text == null &&
this.post.media_ids == null &&
this.post.poll == null);
}, },
p(): any { p(): any {
return this.isRepost ? this.post.repost : this.post; return this.isRepost ? this.post.repost : this.post;
@ -325,6 +331,14 @@ export default Vue.extend({
> .body > .body
padding 8px 0 padding 8px 0
> .repost
margin 8px 0
> .mk-post-preview
padding 16px
border dashed 1px #c0dac6
border-radius 8px
> .location > .location
margin 4px 0 margin 4px 0
font-size 12px font-size 12px

View file

@ -51,7 +51,7 @@
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a> <a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
<div class="map" v-if="p.geo" ref="map"></div> <div class="map" v-if="p.geo" ref="map"></div>
<div class="repost" v-if="p.repost"> <div class="repost" v-if="p.repost">
<mk-post-preview class="repost" :post="p.repost"/> <mk-post-preview :post="p.repost"/>
</div> </div>
<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> </div>

View file

@ -49,6 +49,9 @@
<mk-url-preview v-for="url in urls" :url="url" :key="url"/> <mk-url-preview v-for="url in urls" :url="url" :key="url"/>
<a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a> <a class="location" v-if="p.geo" :href="`http://maps.google.com/maps?q=${p.geo.latitude},${p.geo.longitude}`" target="_blank">%fa:map-marker-alt% 位置情報</a>
<div class="map" v-if="p.geo" ref="map"></div> <div class="map" v-if="p.geo" ref="map"></div>
<div class="repost" v-if="p.repost">
<mk-post-preview :post="p.repost"/>
</div>
</div> </div>
<router-link class="time" :to="`/${p.user.username}/${p.id}`"> <router-link class="time" :to="`/${p.user.username}/${p.id}`">
<mk-time :time="p.created_at" mode="detail"/> <mk-time :time="p.created_at" mode="detail"/>
@ -103,7 +106,10 @@ export default Vue.extend({
}, },
computed: { computed: {
isRepost(): boolean { isRepost(): boolean {
return this.post.repost != null; return (this.post.repost &&
this.post.text == null &&
this.post.media_ids == null &&
this.post.poll == null);
}, },
p(): any { p(): any {
return this.isRepost ? this.post.repost : this.post; return this.isRepost ? this.post.repost : this.post;
@ -326,6 +332,14 @@ export default Vue.extend({
> .body > .body
padding 8px 0 padding 8px 0
> .repost
margin 8px 0
> .mk-post-preview
padding 16px
border dashed 1px #c0dac6
border-radius 8px
> .location > .location
margin 4px 0 margin 4px 0
font-size 12px font-size 12px

View file

@ -52,7 +52,7 @@
<div class="map" v-if="p.geo" ref="map"></div> <div class="map" v-if="p.geo" ref="map"></div>
<span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span> <span class="app" v-if="p.app">via <b>{{ p.app.name }}</b></span>
<div class="repost" v-if="p.repost"> <div class="repost" v-if="p.repost">
<mk-post-preview class="repost" :post="p.repost"/> <mk-post-preview :post="p.repost"/>
</div> </div>
</div> </div>
<footer> <footer>