mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-04 14:50:47 +01:00
completely removing all motd code in favour of using the widget system
This commit is contained in:
@@ -106,7 +106,6 @@
|
||||
<li><a href="{relative_path}/admin/languages"><i class="fa fa-fw fa-comments-o"></i> Languages</a></li>
|
||||
<li><a href="{relative_path}/admin/settings"><i class="fa fa-fw fa-cogs"></i> Settings</a></li>
|
||||
<li><a href="{relative_path}/admin/database"><i class="fa fa-fw fa-hdd-o"></i> Database</a></li>
|
||||
<li><a href="{relative_path}/admin/motd"><i class="fa fa-fw fa-comment"></i> MOTD</a></li>
|
||||
<li><a href="{relative_path}/admin/events"><i class="fa fa-fw fa-calendar-o"></i> Events</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<h1><i class="fa fa-comment"></i> MOTD</h1>
|
||||
<hr />
|
||||
<div class="alert alert-warning 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 full HTML/Javascript.
|
||||
</p>
|
||||
<br />
|
||||
<textarea class="form-control" placeholder="Welcome to NodeBB!" data-field="motd" rows="10"></textarea>
|
||||
<br />
|
||||
<form class="form-inline">
|
||||
<label>MOTD Class</label>
|
||||
<input class="form-control" type="text" placeholder="CSS class to add to MOTD" data-field="motd_class" />
|
||||
</form>
|
||||
<form class="form-inline">
|
||||
<div class="checkbox">
|
||||
<label for="show_motd">
|
||||
<input type="checkbox" id="show_motd" data-field="show_motd" /> Show the Message of the Day
|
||||
</label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary" id="save" checked>Save</button>
|
||||
|
||||
<script>
|
||||
require(['forum/admin/settings'], function(Settings) {
|
||||
Settings.prepare();
|
||||
});
|
||||
</script>
|
||||
@@ -1,7 +1,3 @@
|
||||
<div class="motd {motd_class}">
|
||||
{motd}
|
||||
</div>
|
||||
|
||||
<div widget-area="motd" class="hidden">
|
||||
<!-- BEGIN widgets -->
|
||||
<div class="well">
|
||||
|
||||
@@ -108,45 +108,7 @@ var path = require('path'),
|
||||
data.categories = visibleCategories;
|
||||
|
||||
async.each(data.categories, getRecentReplies, function (err) {
|
||||
|
||||
var motdString,
|
||||
assemble = function() {
|
||||
data.motd_class = (parseInt(meta.config.show_motd, 10) === 1 || meta.config.show_motd === undefined) ? '' : ' none';
|
||||
data.motd_class += (meta.config.motd && meta.config.motd.length > 0) ? '' : ' default';
|
||||
data.motd_class += meta.config.motd_class ? ' ' + meta.config.motd_class : '';
|
||||
|
||||
data.motd = motdString;
|
||||
res.json(data);
|
||||
};
|
||||
|
||||
if (!meta.config.motd) {
|
||||
translator.translate('\n\n<h1>NodeBB</h1> <small><span>v' + pkg.version + '</span></small>\n\n<h5>[[global:motd.welcome]]</h5>\
|
||||
<div class="btn-group">\
|
||||
<a target="_blank" href="https://www.nodebb.org" class="btn btn-link btn-md">\
|
||||
<i class="fa fa-comment"></i>\
|
||||
<span> [[global:motd.get]]</span>\
|
||||
</a>\
|
||||
<a target="_blank" href="https://github.com/designcreateplay/NodeBB" class="btn btn-link btn-md">\
|
||||
<i class="fa fa-github"></i>\
|
||||
<span> [[global:motd.fork]]</span>\
|
||||
</a>\
|
||||
<a target="_blank" href="https://facebook.com/NodeBB" class="btn btn-link btn-md">\
|
||||
<i class="fa fa-facebook"></i>\
|
||||
<span> [[global:motd.like]]</span>\
|
||||
</a>\
|
||||
<a target="_blank" href="https://twitter.com/NodeBB" class="btn btn-link btn-md">\
|
||||
<i class="fa fa-twitter"></i>\
|
||||
<span> [[global:motd.follow]]</span>\
|
||||
</a>\
|
||||
</div>\
|
||||
', function(motd) {
|
||||
motdString = motd;
|
||||
assemble();
|
||||
});
|
||||
} else {
|
||||
motdString = meta.config.motd;
|
||||
assemble();
|
||||
}
|
||||
res.json(data);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user