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.
## 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.

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

@ -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) {

@ -88,6 +88,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,
@ -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) {
const { post: postService } = this.dtp.services;
try {

@ -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.

@ -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');
}

@ -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;

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

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

Loading…
Cancel
Save