Skip to content

Node.js based forum software built for the modern web

refactor: acp tpl + config option

Julian Lamab3ff320b565
diff --git a/src/middleware/index.js b/src/middleware/index.js
index 349178598d..2d09dfcdf1 100644
--- a/src/middleware/index.js
+++ b/src/middleware/index.js
@@ -310,7 +310,7 @@ middleware.proceedOnActivityPub = (req, res, next) => {
// For whatever reason, express accepts does not recognize "profile" as a valid differentiator
// Therefore, manual header parsing is used here.
const { accept } = req.headers;
- if (!accept || !meta.config.activityPubEnabled) {
+ if (!accept || !meta.config.activitypubEnabled) {
return next('route');
}
diff --git a/src/views/admin/settings/activitypub.tpl b/src/views/admin/settings/activitypub.tpl
index a32920619a..8002a4c5d5 100644
--- a/src/views/admin/settings/activitypub.tpl
+++ b/src/views/admin/settings/activitypub.tpl
@@ -1,20 +1,20 @@
-<!-- IMPORT admin/partials/settings/header.tpl -->
+<div class="acp-page-container">
+ <!-- IMPORT admin/partials/settings/header.tpl -->
-<p class="lead">[[admin/settings/activitypub:intro-lead]]</p>
-<p>[[admin/settings/activitypub:intro-body]]</p>
+ <p class="lead">[[admin/settings/activitypub:intro-lead]]</p>
+ <p>[[admin/settings/activitypub:intro-body]]</p>
-<hr />
+ <hr />
-<div class="row mb-4">
- <div class="col-sm-2 col-12 settings-header">[[admin/settings/activitypub:general]]</div>
- <div class="col-sm-10 col-12">
- <form>
- <div class="form-check form-switch mb-3">
- <input class="form-check-input" type="checkbox" data-field="activityPubEnabled">
- <label class="form-check-label">[[admin/settings/activitypub:enabled]]</label>
- </div>
- </form>
+ <div class="row settings m-0">
+ <div class="col-sm-2 col-12 settings-header">[[admin/settings/activitypub:general]]</div>
+ <div class="col-sm-10 col-12">
+ <form>
+ <div class="form-check form-switch mb-3">
+ <input class="form-check-input" type="checkbox" data-field="activitypubEnabled">
+ <label class="form-check-label">[[admin/settings/activitypub:enabled]]</label>
+ </div>
+ </form>
+ </div>
</div>
</div>
-
-<!-- IMPORT admin/partials/settings/footer.tpl -->
diff --git a/test/activitypub.js b/test/activitypub.js
index 5193fdfbee..ce1c51ab98 100644
--- a/test/activitypub.js
+++ b/test/activitypub.js
@@ -14,11 +14,11 @@ const privileges = require('../src/privileges');
describe('ActivityPub integration', () => {
before(() => {
- meta.config.activityPubEnabled = 1;
+ meta.config.activitypubEnabled = 1;
});
after(() => {
- delete meta.config.activityPubEnabled;
+ delete meta.config.activitypubEnabled;
});
describe('WebFinger endpoint', () => {
@@ -108,7 +108,7 @@ describe('ActivityPub integration', () => {
});
it('should return regular user profile html if federation is disabled', async () => {
- delete meta.config.activityPubEnabled;
+ delete meta.config.activitypubEnabled;
const response = await request(`${nconf.get('url')}/user/${slug}`, {
method: 'get',
@@ -124,7 +124,7 @@ describe('ActivityPub integration', () => {
assert.strictEqual(response.statusCode, 200);
assert(response.body.startsWith('<!DOCTYPE html>'));
- meta.config.activityPubEnabled = 1;
+ meta.config.activitypubEnabled = 1;
});
it('should return regular user profile html if Accept header is not ActivityPub-related', async () => {