From a9828d89ed1ebbf3eae80a5af4b486a480df6055 Mon Sep 17 00:00:00 2001 From: CaramelKat <32065563+caramelkat@users.noreply.github.com> Date: Fri, 22 May 2020 02:50:08 -0500 Subject: [PATCH] Fixed posting in portal, added support for video posts --- src/database.js | 9 +- src/html/portal/communities.html | 52 +------ src/html/portal/communities_body.html | 171 ++++++++++----------- src/html/portal/community.html | 27 +++- src/html/portal/community_body.html | 22 ++- src/html/portal/feed_body.html | 1 + src/html/portal/post.html | 2 +- src/html/portal/post_body.html | 18 +-- src/models/post.js | 15 ++ src/services/web-api/index.js | 14 +- src/services/web-api/routes/portal.js | 204 +++++++++++++++++++++----- src/services/web-api/routes/post.js | 12 +- 12 files changed, 340 insertions(+), 207 deletions(-) diff --git a/src/database.js b/src/database.js index 3b8e3a4..ead78db 100644 --- a/src/database.js +++ b/src/database.js @@ -81,12 +81,18 @@ async function getPostsByUserID(userID) { }); } -async function getPostsByCommunity(community, numberOfPosts) { +async function getHotPostsByCommunity(community, numberOfPosts) { verifyConnected(); return POST.find({ title_id: community.title_id }).sort({empathy_count: -1}).limit(numberOfPosts); } +async function getPostsByCommunity(community, numberOfPosts) { + verifyConnected(); + return POST.find({ + title_id: community.title_id + }).limit(numberOfPosts); +} async function getPostsByCommunityKey(community, numberOfPosts, search_key) { verifyConnected(); @@ -125,6 +131,7 @@ module.exports = { getCommunityByID, getDiscoveryHosts, getPostsByCommunity, + getHotPostsByCommunity, getPostsByCommunityKey, getPostsByUserID, getPostByID, diff --git a/src/html/portal/communities.html b/src/html/portal/communities.html index e47329f..df080aa 100644 --- a/src/html/portal/communities.html +++ b/src/html/portal/communities.html @@ -104,19 +104,7 @@ -
+ OLV_WIIU_NEW_COMMUNITIES Show More