mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-15 18:26:15 +01:00
added motd to admin panel and added colour and transitions to alt-login icons
This commit is contained in:
@@ -73,4 +73,8 @@
|
|||||||
background-color: rgba(128, 128, 128, 0.2);
|
background-color: rgba(128, 128, 128, 0.2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.motd textarea {
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -546,6 +546,26 @@ footer.footer {
|
|||||||
&.active {
|
&.active {
|
||||||
.inline-block;
|
.inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
-webkit-transition: color 100ms linear;
|
||||||
|
-moz-transition: color 100ms linear;
|
||||||
|
-ms-transition: color 100ms linear;
|
||||||
|
-o-transition: color 100ms linear;
|
||||||
|
transition: color 100ms linear;
|
||||||
|
|
||||||
|
&.icon-twitter-sign:hover {
|
||||||
|
color: #4099FF;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.icon-facebook-sign:hover {
|
||||||
|
color: #3b5999;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.icon-google-plus-sign:hover {
|
||||||
|
color: #d34836;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,46 +26,23 @@
|
|||||||
for(x=0;x<numFields;x++) {
|
for(x=0;x<numFields;x++) {
|
||||||
key = fields[x].getAttribute('data-field');
|
key = fields[x].getAttribute('data-field');
|
||||||
inputType = fields[x].getAttribute('type');
|
inputType = fields[x].getAttribute('type');
|
||||||
if (nodebb_admin.config[key]) {
|
if (fields[x].nodeName === 'INPUT') {
|
||||||
switch(inputType) {
|
if (nodebb_admin.config[key]) {
|
||||||
case 'text':
|
|
||||||
case 'textarea':
|
|
||||||
case 'number':
|
|
||||||
fields[x].value = nodebb_admin.config[key];
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'checkbox':
|
|
||||||
fields[x].checked = nodebb_admin.config[key] ? true : false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} /*else {
|
|
||||||
// Save defaults, if they're not found in the config
|
|
||||||
var defaultFields = [
|
|
||||||
'use_port', 'port', 'upload_url', 'mailer:host',
|
|
||||||
'mailer:port', 'privileges:manage_content',
|
|
||||||
'privileges:manage_topic'
|
|
||||||
],
|
|
||||||
defaultVal;
|
|
||||||
if (defaultFields.indexOf(key) !== -1) {
|
|
||||||
console.log('saving default value: ', key);
|
|
||||||
switch(inputType) {
|
switch(inputType) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'textarea':
|
case 'textarea':
|
||||||
case 'number':
|
case 'number':
|
||||||
defaultVal = fields[x].value;
|
fields[x].value = nodebb_admin.config[key];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
defaultVal = fields[x].checked ? '1' : '0';
|
fields[x].checked = nodebb_admin.config[key] ? true : false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
socket.emit('api:config.set', {
|
|
||||||
key: key,
|
|
||||||
value: defaultVal
|
|
||||||
});
|
|
||||||
nodebb_admin.config[key] = defaultVal;
|
|
||||||
}
|
}
|
||||||
}*/
|
} else if (fields[x].nodeName === 'TEXTAREA') {
|
||||||
|
if (nodebb_admin.config[key]) fields[x].value = nodebb_admin.config[key];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
saveBtn.addEventListener('click', function(e) {
|
saveBtn.addEventListener('click', function(e) {
|
||||||
@@ -74,18 +51,22 @@
|
|||||||
|
|
||||||
for(x=0;x<numFields;x++) {
|
for(x=0;x<numFields;x++) {
|
||||||
key = fields[x].getAttribute('data-field');
|
key = fields[x].getAttribute('data-field');
|
||||||
inputType = fields[x].getAttribute('type');
|
if (fields[x].nodeName === 'INPUT') {
|
||||||
switch(inputType) {
|
inputType = fields[x].getAttribute('type');
|
||||||
case 'text':
|
switch(inputType) {
|
||||||
case 'textarea':
|
case 'text':
|
||||||
case 'number':
|
case 'number':
|
||||||
value = fields[x].value;
|
value = fields[x].value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
value = fields[x].checked ? '1' : '0';
|
value = fields[x].checked ? '1' : '0';
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
} else if (fields[x].nodeName === 'TEXTAREA') {
|
||||||
|
value = fields[x].value;
|
||||||
}
|
}
|
||||||
|
|
||||||
socket.emit('api:config.set', { key: key, value: value });
|
socket.emit('api:config.set', { key: key, value: value });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
<li class=''><a href='/admin/themes'><i class='icon-th'></i> Themes</a></li>
|
<li class=''><a href='/admin/themes'><i class='icon-th'></i> Themes</a></li>
|
||||||
<li class=''><a href='/admin/settings'><i class='icon-cogs'></i> Settings</a></li>
|
<li class=''><a href='/admin/settings'><i class='icon-cogs'></i> Settings</a></li>
|
||||||
<li class=''><a href='/admin/redis'><i class='icon-hdd'></i> Redis</a></li>
|
<li class=''><a href='/admin/redis'><i class='icon-hdd'></i> Redis</a></li>
|
||||||
|
<li class=''><a href="/admin/motd"><i class="icon-comment"></i> MOTD</a></li>
|
||||||
|
|
||||||
<li class="nav-header">Social Authentication</li>
|
<li class="nav-header">Social Authentication</li>
|
||||||
<li class=''><a href='/admin/twitter'><i class='icon-twitter'></i>Twitter</a></li>
|
<li class=''><a href='/admin/twitter'><i class='icon-twitter'></i>Twitter</a></li>
|
||||||
|
|||||||
19
public/templates/admin/motd.tpl
Normal file
19
public/templates/admin/motd.tpl
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
<h1>MOTD</h1>
|
||||||
|
|
||||||
|
<div class="alert motd">
|
||||||
|
<p>
|
||||||
|
The <strong>Message of the Day</strong> (MOTD) is typically a message shown to users when they first log into a forum or chat room.
|
||||||
|
In NodeBB, the MOTD is present at the top of the forum homepage, and can be customized much like a header.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can enter either full HTML or Markdown text.
|
||||||
|
</p>
|
||||||
|
<textarea placeholder="Welcome to NodeBB!" data-field="motd" rows="10"></textarea>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-large btn-primary" id="save">Save</button>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
nodebb_admin.prepare();
|
||||||
|
</script>
|
||||||
@@ -15,10 +15,31 @@
|
|||||||
<form>
|
<form>
|
||||||
<h3>Email Settings</h3>
|
<h3>Email Settings</h3>
|
||||||
<div class="alert alert-notify">
|
<div class="alert alert-notify">
|
||||||
<strong>Email Address</strong><br /> <input type="text" class="" value="info@localhost"><br />
|
<div>
|
||||||
|
<p>
|
||||||
|
<strong>Email Address</strong><br />
|
||||||
|
The following email address refers to the email that the recipient will see in the "From" and "Reply To" fields.
|
||||||
|
</p>
|
||||||
|
<input type="text" class="input-large" data-field="email:from" placeholder="info@example.org" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
<strong>SMTP Server Host</strong><br />
|
||||||
|
(Default: <em>127.0.0.1</em>)
|
||||||
|
</p>
|
||||||
|
<input type="text" class="input-medium" data-field="email:smtp:host" placeholder="127.0.0.1" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
<strong>SMTP Server Port</strong>
|
||||||
|
</p>
|
||||||
|
<input type="text" class="input-mini" data-field="email:smtp:port" placeholder="25" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<button class="btn btn-large btn-primary" id="save">Save</button>
|
||||||
|
|
||||||
<button class="btn btn-large btn-primary" type="submit">Save</button>
|
<script>
|
||||||
<button class="btn btn-large" type="submit" disabled>Delete</button>
|
nodebb_admin.prepare();
|
||||||
|
</script>
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
"admin/twitter[^]*": "admin/twitter",
|
"admin/twitter[^]*": "admin/twitter",
|
||||||
"admin/facebook[^]*": "admin/facebook",
|
"admin/facebook[^]*": "admin/facebook",
|
||||||
"admin/gplus[^]*": "admin/gplus",
|
"admin/gplus[^]*": "admin/gplus",
|
||||||
|
"admin/motd/?$": "admin/motd",
|
||||||
"install/?$": "install/mail",
|
"install/?$": "install/mail",
|
||||||
"install/mail/?": "install/mail",
|
"install/mail/?": "install/mail",
|
||||||
"install/social/?": "install/social",
|
"install/social/?": "install/social",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ var user = require('./../user.js'),
|
|||||||
Admin.create_routes = function(app) {
|
Admin.create_routes = function(app) {
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus', 'redis'];
|
var routes = ['categories', 'users', 'topics', 'settings', 'themes', 'twitter', 'facebook', 'gplus', 'redis', 'motd'];
|
||||||
|
|
||||||
for (var i=0, ii=routes.length; i<ii; i++) {
|
for (var i=0, ii=routes.length; i<ii; i++) {
|
||||||
(function(route) {
|
(function(route) {
|
||||||
|
|||||||
Reference in New Issue
Block a user