added motd to admin panel and added colour and transitions to alt-login icons

v1.18.x
Julian Lam 12 years ago
parent 47a29d93dd
commit 1760cf1e89

@ -74,3 +74,7 @@
} }
} }
} }
.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,6 +26,7 @@
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 (fields[x].nodeName === 'INPUT') {
if (nodebb_admin.config[key]) { if (nodebb_admin.config[key]) {
switch(inputType) { switch(inputType) {
case 'text': case 'text':
@ -38,34 +39,10 @@
fields[x].checked = nodebb_admin.config[key] ? true : false; fields[x].checked = nodebb_admin.config[key] ? true : false;
break; 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) {
case 'text':
case 'textarea':
case 'number':
defaultVal = fields[x].value;
break;
case 'checkbox':
defaultVal = fields[x].checked ? '1' : '0';
break;
} }
socket.emit('api:config.set', { } else if (fields[x].nodeName === 'TEXTAREA') {
key: key, if (nodebb_admin.config[key]) fields[x].value = nodebb_admin.config[key];
value: defaultVal
});
nodebb_admin.config[key] = defaultVal;
} }
}*/
} }
saveBtn.addEventListener('click', function(e) { saveBtn.addEventListener('click', function(e) {
@ -74,10 +51,10 @@
for(x=0;x<numFields;x++) { for(x=0;x<numFields;x++) {
key = fields[x].getAttribute('data-field'); key = fields[x].getAttribute('data-field');
if (fields[x].nodeName === 'INPUT') {
inputType = fields[x].getAttribute('type'); inputType = fields[x].getAttribute('type');
switch(inputType) { switch(inputType) {
case 'text': case 'text':
case 'textarea':
case 'number': case 'number':
value = fields[x].value; value = fields[x].value;
break; break;
@ -86,6 +63,10 @@
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>

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

Loading…
Cancel
Save