load database questions

v1.18.x
psychobunny 10 years ago
parent a11652ead1
commit bf13b6160f

@ -48,7 +48,19 @@ function setupRoutes() {
}
function install(req, res, next) {
res.render('install/index', {});
var dbs = ['redis', 'mongo'],
databases = [];
dbs.forEach(function(el) {
databases.push({
name: el,
questions: require('../src/database/' + el).questions
});
});
res.render('install/index', {
databases: databases
});
}
function compileLess(callback) {

@ -44,10 +44,14 @@
<div class="container">
<p>
<h1>Welcome to the NodeBB Installer! <hr /><small>You are just a few steps away from launching your own NodeBB forum</small></h1>
<h1>Welcome to the NodeBB Installer</h1>
You are just a few steps away from launching your own NodeBB forum!
</p>
<br />
<form>
<p>
<h1><small>Create an Administrator account</small></h1>
<hr />
</p>
<div class="row input-row">
<div class="col-sm-7 col-xs-12 input-field">
<label for="username">Username</label>
@ -84,14 +88,31 @@
<div class="row input-row">
<div class="col-sm-7 col-xs-12 input-field">
<label for="confirm">Confirm Password</label>
<input type="password" class="form-control" name="confirm" placeholder="Confirm Password" />
<label for="confirm">Database Type</label>
<select class="form-control" name="database">
<option value="redis">Redis</option>
<option value="mongodb">MongoDB</option>
</select>
</div>
<div class="col-sm-5 help-text" data-help="Please confirm your password."></div>
</div>
</form>
</div>
<div class="hidea">
<!-- BEGIN databases -->
<div data-database="{databases.name}">
<!-- BEGIN questions -->
<div class="row input-row">
<div class="col-sm-7 col-xs-12 input-field">
<label for="{databases.questions.name}">{databases.questions.description}</label>
<input type="<!-- IF hidden -->password<!-- ELSE -->text<!-- ENDIF hidden -->" class="form-control" name="{databases.questions.name}" placeholder="{databases.questions.default}" />
</div>
</div>
<!-- END questions -->
</div>
<!-- END databases -->
</div>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script type="text/javascript" src="nodebb.min.js"></script>

Loading…
Cancel
Save