From 9a7aa34a3b9800c8b25f17d62cff963f8d0dc129 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 16 Jan 2023 01:25:14 -0500 Subject: [PATCH 1/5] quick update for prod and formatting also includes a stub for removing a post's featured image. It does NOT remove the image for now. I'm just in a hurry, and am entirely sick of italic text being red. --- app/controllers/post.js | 11 +++++++++++ client/js/site-app.js | 4 ++++ client/less/site/main.less | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/app/controllers/post.js b/app/controllers/post.js index 10ac01a..7c75691 100644 --- a/app/controllers/post.js +++ b/app/controllers/post.js @@ -72,6 +72,13 @@ class PostController extends SiteController { this.getIndex.bind(this), ); + router.delete( + '/:postId/profile-photo', + // limiterService.createMiddleware(limiterService.config.post.deletePostFeatureImage), + requireAuthorPrivileges, + this.deletePostFeatureImage.bind(this), + ); + router.delete( '/:postId', requireAuthorPrivileges, @@ -187,6 +194,10 @@ class PostController extends SiteController { } } + async deletePostFeatureImage (req, res) { + res.status(500).json({ success: false, message: 'Removing the featured image is not yet implemented'}); + } + async postUpdatePost (req, res, next) { const { post: postService } = this.dtp.services; try { diff --git a/client/js/site-app.js b/client/js/site-app.js index 6c96fd5..247cbf0 100644 --- a/client/js/site-app.js +++ b/client/js/site-app.js @@ -400,6 +400,10 @@ export default class DtpSiteApp extends DtpApp { response = await fetch(`/user/${this.user._id}/profile-photo`, { method: 'DELETE' }); break; + case 'post-image-file'://this is UNFINISHED, figure out the route in controller, and implement it + response = await fetch(`/post/${this.user._id}/feature-image`, { method: 'DELETE' }); + break; + default: throw new Error('Invalid image type'); } diff --git a/client/less/site/main.less b/client/less/site/main.less index 007a841..539a0ed 100644 --- a/client/less/site/main.less +++ b/client/less/site/main.less @@ -8,6 +8,10 @@ body { padding-top: @site-navbar-height; background-color: @page-background-color; + em, i { + color: inherit; + } + &[data-current-view="chat"] { position: fixed; top: @navbar-nav-item-height; right: 0; bottom: 0; left: 0; From 582e88164b528f30047cecebbe479521c00eb7d3 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 16 Jan 2023 01:25:37 -0500 Subject: [PATCH 2/5] v0.6.12 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 985621f..d770d8c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dtp-sites", - "version": "0.6.11", + "version": "0.6.12", "description": "Open source blogging engine for the Digital Telepresence Platform.", "main": "dtp-sites.js", "author": "DTP Technologies, LLC", From 2ac9c3f1a03415d7632f5dd945193232739c43b9 Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 16 Jan 2023 01:52:33 -0500 Subject: [PATCH 3/5] newsroom updates - newsroom pagination added - newsroom displays 12 feeds per page --- app/controllers/newsroom.js | 2 +- app/views/newsroom/index.pug | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/newsroom.js b/app/controllers/newsroom.js index 265e018..b97d8d3 100644 --- a/app/controllers/newsroom.js +++ b/app/controllers/newsroom.js @@ -68,7 +68,7 @@ class NewsroomController extends SiteController { async getHome (req, res, next) { const { feed: feedService } = this.dtp.services; try { - res.locals.pagination = this.getPaginationParameters(req, 10); + res.locals.pagination = this.getPaginationParameters(req, 12); res.locals.newsroom = await feedService.getFeeds(res.locals.pagination, { withEntries: true }); res.render('newsroom/index'); } catch (error) { diff --git a/app/views/newsroom/index.pug b/app/views/newsroom/index.pug index 27fc24a..dc8a8f5 100644 --- a/app/views/newsroom/index.pug +++ b/app/views/newsroom/index.pug @@ -1,6 +1,8 @@ extends ../layouts/main block content + include ../components/pagination-bar + section.uk-section.uk-section-default.uk-section-small .uk-container @@ -11,7 +13,7 @@ block content div(class="uk-width-1-1 uk-width-1-2@s uk-width-1-3@m uk-width-1-4@l") .uk-card.uk-card-secondary.uk-card-small.uk-border-rounded .uk-card-header(style="border-bottom: solid 1px #808080;") - div(uk-grid).uk-grid-small.uk-flex-middle + div(uk-grid).uk-grid-small .uk-width-expand h2.uk-card-title.uk-margin-remove a(href=`/newsroom/${feed._id}`, uk-tooltip=`See all for ${feed.title}`)= feed.title @@ -33,5 +35,9 @@ block content else div No recent posts + + .uk-margin + +renderPaginationBar('/newsroom', newsroom.totalFeedCount) + else div There are no configured news feeds. \ No newline at end of file From 35864c2a5d5556013a76388b783d7149e0b42def Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 16 Jan 2023 01:52:39 -0500 Subject: [PATCH 4/5] doc update - added instructions for installing build tools to README --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index a72378b..bea1014 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,12 @@ DTP Sites is an open source blogging platform built on Node.js and the DTP ecosy The only qualified operated system for hosting a DTP Sites suite is [Ubuntu 20.04 LTS](https://releases.ubuntu.com/20.04/). It is acceptable to run it in a virtual machine for development and testing, but it should be run as close to bare metal as can be had for production environments. +## Install Build Tools (for mediasoup support) + +```sh +apt-get -y install build-essential python3-pip +``` + ## Install Data Tier Components You will need MongoDB and MinIO installed and running before you can start DTP Sites web services. From 748095e2cfcfc1aef0c36ad6926c4ac2d1ab0f0b Mon Sep 17 00:00:00 2001 From: rob Date: Mon, 16 Jan 2023 01:52:46 -0500 Subject: [PATCH 5/5] v0.6.13 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d770d8c..975d8be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dtp-sites", - "version": "0.6.12", + "version": "0.6.13", "description": "Open source blogging engine for the Digital Telepresence Platform.", "main": "dtp-sites.js", "author": "DTP Technologies, LLC",