Merge remote-tracking branch 'origin/master'

master
Andrew 1 year ago
commit 30c249b6a1

@ -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. 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 ## Install Data Tier Components
You will need MongoDB and MinIO installed and running before you can start DTP Sites web services. You will need MongoDB and MinIO installed and running before you can start DTP Sites web services.

@ -63,11 +63,7 @@ class HomeController extends SiteController {
} }
async getHome (req, res, next) { async getHome (req, res, next) {
const { const { announcement: announcementService, hive: hiveService, post: postService } = this.dtp.services;
announcement: announcementService,
hive: hiveService,
post: postService,
} = this.dtp.services;
try { try {
res.locals.announcements = await announcementService.getLatest(req.user); res.locals.announcements = await announcementService.getLatest(req.user);
res.locals.featuredPosts = await postService.getFeaturedPosts(3); res.locals.featuredPosts = await postService.getFeaturedPosts(3);

@ -68,7 +68,7 @@ class NewsroomController extends SiteController {
async getHome (req, res, next) { async getHome (req, res, next) {
const { feed: feedService } = this.dtp.services; const { feed: feedService } = this.dtp.services;
try { 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.locals.newsroom = await feedService.getFeeds(res.locals.pagination, { withEntries: true });
res.render('newsroom/index'); res.render('newsroom/index');
} catch (error) { } catch (error) {

@ -88,6 +88,13 @@ class PostController extends SiteController {
this.getIndex.bind(this), this.getIndex.bind(this),
); );
router.delete(
'/:postId/profile-photo',
// limiterService.createMiddleware(limiterService.config.post.deletePostFeatureImage),
requireAuthorPrivileges,
this.deletePostFeatureImage.bind(this),
);
router.delete( router.delete(
'/:postId', '/:postId',
requireAuthorPrivileges, requireAuthorPrivileges,
@ -219,6 +226,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) { async postUpdatePost (req, res, next) {
const { post: postService } = this.dtp.services; const { post: postService } = this.dtp.services;
try { try {

@ -1,6 +1,8 @@
extends ../layouts/main extends ../layouts/main
block content block content
include ../components/pagination-bar
section.uk-section.uk-section-default.uk-section-small section.uk-section.uk-section-default.uk-section-small
.uk-container .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") 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.uk-card-secondary.uk-card-small.uk-border-rounded
.uk-card-header(style="border-bottom: solid 1px #808080;") .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 .uk-width-expand
h2.uk-card-title.uk-margin-remove h2.uk-card-title.uk-margin-remove
a(href=`/newsroom/${feed._id}`, uk-tooltip=`See all for ${feed.title}`)= feed.title a(href=`/newsroom/${feed._id}`, uk-tooltip=`See all for ${feed.title}`)= feed.title
@ -33,5 +35,9 @@ block content
else else
div No recent posts div No recent posts
.uk-margin
+renderPaginationBar('/newsroom', newsroom.totalFeedCount)
else else
div There are no configured news feeds. div There are no configured news feeds.

@ -400,6 +400,10 @@ export default class DtpSiteApp extends DtpApp {
response = await fetch(`/user/${this.user._id}/profile-photo`, { method: 'DELETE' }); response = await fetch(`/user/${this.user._id}/profile-photo`, { method: 'DELETE' });
break; 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: default:
throw new Error('Invalid image type'); throw new Error('Invalid image type');
} }

@ -8,6 +8,10 @@ body {
padding-top: @site-navbar-height; padding-top: @site-navbar-height;
background-color: @page-background-color; background-color: @page-background-color;
em, i {
color: inherit;
}
&[data-current-view="chat"] { &[data-current-view="chat"] {
position: fixed; position: fixed;
top: @navbar-nav-item-height; right: 0; bottom: 0; left: 0; top: @navbar-nav-item-height; right: 0; bottom: 0; left: 0;

@ -22,22 +22,21 @@ module.config = {
http: require(path.join(module.rootPath, 'config', 'http')), http: require(path.join(module.rootPath, 'config', 'http')),
https: require(path.join(module.rootPath, 'config', 'https')), https: require(path.join(module.rootPath, 'config', 'https')),
registerMiddleware: async (dtp, app) => { registerMiddleware: async (dtp, app) => {
module.log.info('registering Page service middleware'); module.log.info('registering Page service middleware');
const { const {
feed: feedService,
gabTV: gabTvService, gabTV: gabTvService,
page: pageService, page: pageService,
siteLink: siteLinkService, siteLink: siteLinkService,
venue: venueService, venue: venueService,
} = module.services; } = module.services;
app.use( app.use(
feedService.middleware({ maxEntryCount: 5 }),
pageService.menuMiddleware.bind(pageService), pageService.menuMiddleware.bind(pageService),
siteLinkService.middleware(), siteLinkService.middleware(),
venueService.channelMiddleware(), venueService.channelMiddleware(),
gabTvService.channelMiddleware() gabTvService.channelMiddleware()
); );
const { feed: feedService } = dtp.services;
app.use(feedService.middleware({ maxEntryCount: 5 }));
}, },
}; };

@ -1,6 +1,6 @@
{ {
"name": "dtp-sites", "name": "dtp-sites",
"version": "0.6.10", "version": "0.6.13",
"description": "Open source blogging engine for the Digital Telepresence Platform.", "description": "Open source blogging engine for the Digital Telepresence Platform.",
"main": "dtp-sites.js", "main": "dtp-sites.js",
"author": "DTP Technologies, LLC", "author": "DTP Technologies, LLC",

Loading…
Cancel
Save