mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 00:10:25 +01:00
resolved issue #913
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
define(function() {
|
define(['forum/admin/settings'], function(Settings) {
|
||||||
var Themes = {};
|
var Themes = {};
|
||||||
|
|
||||||
Themes.init = function() {
|
Themes.init = function() {
|
||||||
@@ -96,6 +96,8 @@ define(function() {
|
|||||||
instListEl.innerHTML = '';
|
instListEl.innerHTML = '';
|
||||||
instListEl.appendChild(themeFrag);
|
instListEl.appendChild(themeFrag);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Settings.prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
Themes.render = function(bootswatch) {
|
Themes.render = function(bootswatch) {
|
||||||
|
|||||||
@@ -1,11 +1,19 @@
|
|||||||
<h1><i class="fa fa-th"></i> Themes</h1>
|
<h1><i class="fa fa-th"></i> Themes</h1>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
||||||
<h3>Custom Themes</h3>
|
<div class="themes">
|
||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="active"><a href="#" data-target="#themes" data-toggle="tab">Themes</a></li>
|
||||||
|
<li><a href="#" data-target="#customise" data-toggle="tab">Customise</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div class="tab-pane active" id="themes">
|
||||||
|
<h3>Installed Themes</h3>
|
||||||
<p>
|
<p>
|
||||||
The following themes are currently installed in this NodeBB instance.
|
The following themes are currently installed in this NodeBB instance.
|
||||||
</p>
|
</p>
|
||||||
<ul class="themes" id="installed_themes">
|
<ul class="directory" id="installed_themes">
|
||||||
<li><i class="fa fa-refresh fa-spin"></i> Checking for installed themes...</li>
|
<li><i class="fa fa-refresh fa-spin"></i> Checking for installed themes...</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -14,7 +22,7 @@
|
|||||||
NodeBB Themes are powered by Bootswatch, a repository containing themes built
|
NodeBB Themes are powered by Bootswatch, a repository containing themes built
|
||||||
with Bootstrap as a base theme.
|
with Bootstrap as a base theme.
|
||||||
</p>
|
</p>
|
||||||
<ul class="themes" id="bootstrap_themes">
|
<ul class="directory" id="bootstrap_themes">
|
||||||
<li><i class="fa fa-refresh fa-spin"></i> Loading Themes</li>
|
<li><i class="fa fa-refresh fa-spin"></i> Loading Themes</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
@@ -22,6 +30,27 @@
|
|||||||
<p class="alert">
|
<p class="alert">
|
||||||
<button class="btn btn-warning" id="revert_theme">Revert</button> This will remove any custom theme applied to your NodeBB, and restore the base theme.
|
<button class="btn btn-warning" id="revert_theme">Revert</button> This will remove any custom theme applied to your NodeBB, and restore the base theme.
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane" id="customise">
|
||||||
|
<h3>Custom CSS</h3>
|
||||||
|
<p>
|
||||||
|
You may also opt to enter your own CSS declarations here, which will be applied after all other styles.
|
||||||
|
</p>
|
||||||
|
<textarea class="well" data-field="customCSS" placeholder="Enter your custom CSS here..."></textarea>
|
||||||
|
|
||||||
|
<form class="form">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="useCustomCSS">
|
||||||
|
Use Custom CSS?
|
||||||
|
<input id="useCustomCSS" type="checkbox" data-field="useCustomCSS" />
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<button class="btn btn-lg btn-primary" id="save">Save</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var bootswatchListener = function(data) {
|
var bootswatchListener = function(data) {
|
||||||
|
|||||||
@@ -34,6 +34,9 @@
|
|||||||
|
|
||||||
<!-- TODO : this has to be refactored, maybe configured from ACP? -baris -->
|
<!-- TODO : this has to be refactored, maybe configured from ACP? -baris -->
|
||||||
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
|
<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css">
|
||||||
|
<!-- IF useCustomCSS -->
|
||||||
|
<style type="text/css">{customCSS}</style>
|
||||||
|
<!-- ENDIF useCustomCSS -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -146,6 +146,13 @@ module.exports.server = server;
|
|||||||
uid = options.req.user.uid;
|
uid = options.req.user.uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom CSS
|
||||||
|
templateValues.useCustomCSS = false;
|
||||||
|
if (meta.config.useCustomCSS === '1') {
|
||||||
|
templateValues.useCustomCSS = true;
|
||||||
|
templateValues.customCSS = meta.config.customCSS;
|
||||||
|
}
|
||||||
|
|
||||||
user.isAdministrator(uid, function(err, isAdmin) {
|
user.isAdministrator(uid, function(err, isAdmin) {
|
||||||
templateValues.adminDisplay = isAdmin ? 'show' : 'hide';
|
templateValues.adminDisplay = isAdmin ? 'show' : 'hide';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user