Merge pull request #1538 from pixelfed/frontend-ui-refactor

Frontend ui refactor
This commit is contained in:
daniel 2019-07-20 23:33:23 -06:00 committed by GitHub
commit 7f6337dd97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 13 deletions

BIN
public/js/activity.js vendored

Binary file not shown.

BIN
public/js/status.js vendored

Binary file not shown.

BIN
public/js/timeline.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -146,6 +146,9 @@ export default {
if(n.type == 'share' && !status) {
return false;
}
if(_.find(this.notifications, {id: n.id})) {
return false;
}
return true;
});
this.notifications.push(...data);

View file

@ -1,10 +1,10 @@
<template>
<div>
<div class="card notification-card">
<div class="card notification-card shadow-none border">
<div class="card-header bg-white">
<p class="mb-0 d-flex align-items-center justify-content-between">
<span><i class="far fa-bell fa-lg text-muted"></i></span>
<span class="small text-dark text-uppercase font-weight-bold">Alerts</span>
<span><i class="far fa-bell fa-lg text-white"></i></span>
<span class="small text-dark text-uppercase font-weight-bold">Notifications</span>
<a class="text-decoration-none text-muted" href="/account/activity"><i class="fas fa-inbox fa-lg"></i></a>
</p>
</div>
@ -13,8 +13,8 @@
<span class="sr-only">Loading...</span>
</div>
</div>
<div class="card-body pt-2 px-0 contents" style="max-height: 230px; overflow-y: scroll;">
<div v-if="notifications.length > 0" class="media mb-4 align-items-center px-3" v-for="(n, index) in notifications">
<div class="card-body pt-2 px-0 py-0 contents" style="max-height: 230px; overflow-y: scroll;">
<div v-if="notifications.length > 0" class="media align-items-center px-3 py-2 border-bottom border-light" v-for="(n, index) in notifications">
<img class="mr-2 rounded-circle" style="border:1px solid #ccc" :src="n.account.avatar" alt="" width="32px" height="32px">
<div class="media-body font-weight-light small">
<div v-if="n.type == 'favourite'">
@ -43,7 +43,7 @@
</p>
</div>
</div>
<div class="small text-muted" :title="n.created_at">{{timeAgo(n.created_at)}}</div>
<div class="small text-muted font-weight-bold" :title="n.created_at">{{timeAgo(n.created_at)}}</div>
</div>
<div v-if="notifications.length">
<infinite-loading @infinite="infiniteNotifications">
@ -90,16 +90,16 @@
return true;
});
let ids = res.data.map(n => n.id);
this.notificationMaxId = Math.max(...ids);
this.notificationMaxId = Math.min(...ids);
this.notifications = data;
$('.notification-card .loader').addClass('d-none');
$('.notification-card .contents').removeClass('d-none');
this.notificationPoll();
//this.notificationPoll();
});
},
infiniteNotifications($state) {
if(this.notificationCursor > 10) {
if(this.notificationCursor > 5) {
$state.complete();
return;
}
@ -113,6 +113,9 @@
if(n.type == 'share' && !status) {
return false;
}
if(_.find(this.notifications, {id: n.id})) {
return false;
}
return true;
});
this.notifications.push(...data);

View file

@ -11,7 +11,7 @@
</div>
<div v-if="loaded && warning == false" class="postComponent">
<div v-if="profileLayout == 'metro'" class="container px-0">
<div class="card card-md-rounded-0 status-container orientation-unknown">
<div class="card card-md-rounded-0 status-container orientation-unknown shadow-none border">
<div class="row px-0 mx-0">
<div class="d-flex d-md-none align-items-center justify-content-between card-header bg-white w-100">
<a :href="statusProfileUrl" class="d-flex align-items-center status-username text-truncate" data-toggle="tooltip" data-placement="bottom" :title="statusUsername">

View file

@ -9,7 +9,7 @@
</div>
</div>
<div :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
<div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0">
<div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
<div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
<h6 class="text-muted font-weight-bold mb-0">Suggestions For You</h6>
<span class="cursor-pointer text-muted" v-on:click="hideSuggestions"><i class="fas fa-times"></i></span>
@ -40,7 +40,7 @@
</div>
</div>
<div v-if="index == 4 && showHashtagPosts && hashtagPosts.length" class="card mb-sm-4 status-card card-md-rounded-0">
<div v-if="index == 4 && showHashtagPosts && hashtagPosts.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
<div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
<span></span>
<h6 class="text-muted font-weight-bold mb-0"><a :href="'/discover/tags/'+hashtagPostsName+'?src=tr'">#{{hashtagPostsName}}</a></h6>
@ -66,7 +66,7 @@
</div>
</div>
</div>
<div class="card mb-sm-4 status-card card-md-rounded-0">
<div class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
<div v-if="!modes.distractionFree" class="card-header d-inline-flex align-items-center bg-white">
<img v-bind:src="status.account.avatar" width="32px" height="32px" style="border-radius: 32px;">
<a class="username font-weight-bold pl-2 text-dark" v-bind:href="status.account.url">