forked from mirror/pixelfed
Merge pull request #1176 from pixelfed/frontend-ui-refactor
Frontend ui refactor
This commit is contained in:
commit
530ad3ee97
File diff suppressed because one or more lines are too long
|
@ -11,5 +11,5 @@
|
||||||
"/js/profile.js": "/js/profile.js?id=402ccf915090841ff183",
|
"/js/profile.js": "/js/profile.js?id=402ccf915090841ff183",
|
||||||
"/js/search.js": "/js/search.js?id=0d3d080dc05f4f49b204",
|
"/js/search.js": "/js/search.js?id=0d3d080dc05f4f49b204",
|
||||||
"/js/status.js": "/js/status.js?id=0b11c2129b9ebdb0eddf",
|
"/js/status.js": "/js/status.js?id=0b11c2129b9ebdb0eddf",
|
||||||
"/js/timeline.js": "/js/timeline.js?id=a55e77b5ab5237de0aaf"
|
"/js/timeline.js": "/js/timeline.js?id=c3ba4d9afb752f54c6f8"
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,27 +18,27 @@
|
||||||
<div class="media-body font-weight-light small">
|
<div class="media-body font-weight-light small">
|
||||||
<div v-if="n.type == 'favourite'">
|
<div v-if="n.type == 'favourite'">
|
||||||
<p class="my-0">
|
<p class="my-0">
|
||||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break">{{n.account.username}}</a> liked your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>.
|
<a :href="n.account.url" class="font-weight-bold text-dark word-break" data-placement="bottom" data-toggle="tooltip" :title="n.account.username">{{truncate(n.account.username)}}</a> liked your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="n.type == 'comment'">
|
<div v-else-if="n.type == 'comment'">
|
||||||
<p class="my-0">
|
<p class="my-0">
|
||||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break">{{n.account.username}}</a> commented on your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>.
|
<a :href="n.account.url" class="font-weight-bold text-dark word-break" data-placement="bottom" data-toggle="tooltip" :title="n.account.username">{{truncate(n.account.username)}}</a> commented on your <a class="font-weight-bold" v-bind:href="n.status.url">post</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="n.type == 'mention'">
|
<div v-else-if="n.type == 'mention'">
|
||||||
<p class="my-0">
|
<p class="my-0">
|
||||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break">{{n.account.username}}</a> <a class="font-weight-bold" v-bind:href="mentionUrl(n.status)">mentioned</a> you.
|
<a :href="n.account.url" class="font-weight-bold text-dark word-break" data-placement="bottom" data-toggle="tooltip" :title="n.account.username">{{truncate(n.account.username)}}</a> <a class="font-weight-bold" v-bind:href="mentionUrl(n.status)">mentioned</a> you.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="n.type == 'follow'">
|
<div v-else-if="n.type == 'follow'">
|
||||||
<p class="my-0">
|
<p class="my-0">
|
||||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break">{{n.account.username}}</a> followed you.
|
<a :href="n.account.url" class="font-weight-bold text-dark word-break" data-placement="bottom" data-toggle="tooltip" :title="n.account.username">{{truncate(n.account.username)}}</a> followed you.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="n.type == 'share'">
|
<div v-else-if="n.type == 'share'">
|
||||||
<p class="my-0">
|
<p class="my-0">
|
||||||
<a :href="n.account.url" class="font-weight-bold text-dark word-break">{{n.account.username}}</a> shared your <a class="font-weight-bold" v-bind:href="n.status.reblog.url">post</a>.
|
<a :href="n.account.url" class="font-weight-bold text-dark word-break" data-placement="bottom" data-toggle="tooltip" :title="n.account.username">{{truncate(n.account.username)}}</a> shared your <a class="font-weight-bold" v-bind:href="n.status.reblog.url">post</a>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,6 +73,10 @@
|
||||||
this.fetchNotifications();
|
this.fetchNotifications();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
updated() {
|
||||||
|
$('[data-toggle="tooltip"]').tooltip()
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
fetchNotifications() {
|
fetchNotifications() {
|
||||||
axios.get('/api/v1/notifications')
|
axios.get('/api/v1/notifications')
|
||||||
|
@ -114,6 +118,14 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
truncate(text) {
|
||||||
|
if(text.length <= 15) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
|
return text.slice(0,15) + '...'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
Loading…
Reference in New Issue