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 25 additions and 19 deletions

File diff suppressed because one or more lines are too long

2
public/js/status.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
"/js/manifest.js": "/js/manifest.js?id=01c8731923a46c30aaed",
"/js/vendor.js": "/js/vendor.js?id=383c6f227a3b8d8d1c71",
"/js/ace.js": "/js/ace.js?id=4a28163d5fd63e64d6af",
"/js/activity.js": "/js/activity.js?id=7405cc1a22814a5b2a70",
"/js/activity.js": "/js/activity.js?id=a414018a6c03ddd2a492",
"/js/app.js": "/js/app.js?id=2f034c84c06dbb3e511d",
"/css/app.css": "/css/app.css?id=56642158bfe8b6469355",
"/css/appdark.css": "/css/appdark.css?id=1b13fc163fa4deb9233f",
@ -20,7 +20,7 @@
"/js/profile.js": "/js/profile.js?id=ea657aeb8d50b124f7e5",
"/js/quill.js": "/js/quill.js?id=9edfe94c043a1bc68860",
"/js/search.js": "/js/search.js?id=b1bd588d07e682f8fce5",
"/js/status.js": "/js/status.js?id=88ff0424ea5962941336",
"/js/status.js": "/js/status.js?id=769dca36a9a31b7fda55",
"/js/theme-monokai.js": "/js/theme-monokai.js?id=344fb8527bb66574e4cd",
"/js/timeline.js": "/js/timeline.js?id=3662e7d43abcaae71f3b"
"/js/timeline.js": "/js/timeline.js?id=2bf7f82e900bd72a73f9"
}

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">