mirror of
https://hk.gh-proxy.com/https://github.com/NodeBB/nodebb-plugin-composer-default.git
synced 2025-10-03 04:31:23 +08:00
update acp page
This commit is contained in:
parent
34e5dc95a8
commit
1608e1f3ba
3 changed files with 25 additions and 19 deletions
|
@ -3,7 +3,9 @@
|
||||||
const Controllers = {};
|
const Controllers = {};
|
||||||
|
|
||||||
Controllers.renderAdminPage = function (req, res) {
|
Controllers.renderAdminPage = function (req, res) {
|
||||||
res.render('admin/plugins/composer-default', {});
|
res.render('admin/plugins/composer-default', {
|
||||||
|
title: 'Composer (Default)',
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = Controllers;
|
module.exports = Controllers;
|
||||||
|
|
|
@ -23,11 +23,11 @@ const plugin = module.exports;
|
||||||
plugin.socketMethods = socketMethods;
|
plugin.socketMethods = socketMethods;
|
||||||
|
|
||||||
plugin.init = async function (data) {
|
plugin.init = async function (data) {
|
||||||
|
const { router } = data;
|
||||||
|
const routeHelpers = require.main.require('./src/routes/helpers');
|
||||||
const controllers = require('./controllers');
|
const controllers = require('./controllers');
|
||||||
SocketPlugins.composer = socketMethods;
|
SocketPlugins.composer = socketMethods;
|
||||||
|
routeHelpers.setupAdminPageRoute(router, '/admin/plugins/composer-default', controllers.renderAdminPage);
|
||||||
data.router.get('/admin/plugins/composer-default', data.middleware.admin.buildHeader, controllers.renderAdminPage);
|
|
||||||
data.router.get('/api/admin/plugins/composer-default', controllers.renderAdminPage);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin.appendConfig = async function (config) {
|
plugin.appendConfig = async function (config) {
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
<form role="form" class="composer-default-settings">
|
<div class="acp-page-container">
|
||||||
<div class="row">
|
<!-- IMPORT admin/partials/settings/header.tpl -->
|
||||||
<div class="col-sm-2 col-12 settings-header">General</div>
|
|
||||||
<div class="col-sm-10 col-12">
|
|
||||||
<div class="form-check form-switch">
|
|
||||||
<input id="composeRouteEnabled" class="form-check-input" type="checkbox" name="composeRouteEnabled" />
|
|
||||||
<label for="composeRouteEnabled" class="form-check-label">Use a separate route for the composer</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-check form-switch">
|
<div class="row m-0">
|
||||||
<input type="checkbox" class="form-check-input" id="hidePreviewOnOpen" name="hidePreviewOnOpen" />
|
<div id="spy-container" class="col-12 col-md-8 px-0 mb-4" tabindex="0">
|
||||||
<label for="hidePreviewOnOpen" class="form-check-label">Hide preview on open</label>
|
<form role="form" class="composer-default-settings mb-4">
|
||||||
</div>
|
<div class="form-check form-switch">
|
||||||
|
<input id="composeRouteEnabled" class="form-check-input" type="checkbox" name="composeRouteEnabled" />
|
||||||
|
<label for="composeRouteEnabled" class="form-check-label">Use a separate route for the composer</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input type="checkbox" class="form-check-input" id="hidePreviewOnOpen" name="hidePreviewOnOpen" />
|
||||||
|
<label for="hidePreviewOnOpen" class="form-check-label">Hide preview on open</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
<!-- IMPORT admin/partials/save_button.tpl -->
|
<!-- IMPORT admin/partials/settings/toc.tpl -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue