mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-08 16:42:48 +01:00
interim commit
This commit is contained in:
2
app.js
2
app.js
@@ -18,7 +18,7 @@ global.templates = {};
|
||||
templates.init([
|
||||
'header', 'footer', 'logout', 'admin/header', 'admin/footer', 'admin/index',
|
||||
'emails/reset', 'emails/reset_plaintext', 'emails/email_confirm', 'emails/email_confirm_plaintext',
|
||||
'emails/header.tpl', 'emails/footer.tpl'
|
||||
'emails/header', 'emails/footer', 'install/header', 'install/footer', 'install/basic'
|
||||
]);
|
||||
|
||||
templates.ready(function() {
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
"admin/twitter[^]*": "admin/twitter",
|
||||
"admin/facebook[^]*": "admin/facebook",
|
||||
"admin/gplus[^]*": "admin/gplus",
|
||||
"install/?$": "install/basic",
|
||||
"install/basic/?$": "install/basic",
|
||||
"users[^]*edit": "accountedit",
|
||||
"users[^]*friends": "friends",
|
||||
"users/[^]*": "account",
|
||||
|
||||
28
public/templates/install/basic.tpl
Normal file
28
public/templates/install/basic.tpl
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
<h1>Step 1 – Basic Information</h1>
|
||||
|
||||
<p class="lead">
|
||||
Thanks for choosing to install NodeBB! We'll need some information to set up your installation
|
||||
configuration...
|
||||
</p>
|
||||
|
||||
<h3>Path Information</h3>
|
||||
<p>
|
||||
Please enter the web-accessible url that will be used to point to the NodeBB installation. If you are using a port number in the address,
|
||||
<strong>include it in the field below, not here</strong>
|
||||
<input type="text" class="input-large" data-field="base_url" placeholder="http://www.example.org" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<label class="checkbox"><input type="checkbox" data-field="use_port" /> Use port</label>
|
||||
</p>
|
||||
|
||||
<form class="form-inline">
|
||||
<label>Port</label> <input type="text" data-field="port" />
|
||||
</form>
|
||||
|
||||
<h3>NodeBB Secret</h3>
|
||||
<p>
|
||||
This "secret" is used to encode user sessions, so they are not stored in plaintext. Enter a bunch of random characters below:
|
||||
</p>
|
||||
<input type="text" class="input-xxlarge" data-field="secret" placeholder="n239he#dh9j9$jc4h%y4yuhnx9y(&#y9ryn9c3" />
|
||||
3
public/templates/install/footer.tpl
Normal file
3
public/templates/install/footer.tpl
Normal file
@@ -0,0 +1,3 @@
|
||||
|
||||
</div>
|
||||
</body>
|
||||
45
public/templates/install/header.tpl
Normal file
45
public/templates/install/header.tpl
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>NodeBB</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" CONTENT="NodeBB">
|
||||
<meta name="description" content="Node.js/Redis/Socket.io powered forums for a new generation">
|
||||
<link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
|
||||
<link href="/vendor/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
|
||||
<link rel="stylesheet" href="/vendor/fontawesome/css/font-awesome.min.css">
|
||||
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
|
||||
<script type="text/javascript" src="/vendor/jquery/js/jquery-ui-1.10.3.custom.min.js"></script>
|
||||
<script type="text/javascript" src="/vendor/bootstrap/js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
|
||||
<script type="text/javascript" src="/src/app.js"></script>
|
||||
<script type="text/javascript" src="/src/templates.js"></script>
|
||||
<script type="text/javascript" src="/src/ajaxify.js"></script>
|
||||
<script type="text/javascript" src="/src/jquery.form.js"></script>
|
||||
<script type="text/javascript" src="/src/utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/css/style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="navbar-inner">
|
||||
<div class="container">
|
||||
<a class="brand" href="/">NodeBB Installation</a>
|
||||
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<div class="nav-collapse collapse">
|
||||
<ul class="nav nodebb-inline-block">
|
||||
<li>
|
||||
<a data-tab="basic" href="#"><i class="icon-cog"></i> Basic</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container" id="content">
|
||||
44
src/routes/install.js
Normal file
44
src/routes/install.js
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
var RDB = require('../redis.js');
|
||||
|
||||
(function(Install) {
|
||||
Install.create_routes = function(app) {
|
||||
|
||||
(function() {
|
||||
var routes = ['basic'];
|
||||
|
||||
for (var i=0, ii=routes.length; i<ii; i++) {
|
||||
(function(route) {
|
||||
app.get('/install/' + route, function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/' + route) + templates['install/footer']);
|
||||
});
|
||||
}(routes[i]));
|
||||
}
|
||||
}());
|
||||
|
||||
//todo consolidate.
|
||||
app.get('/install', function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/basic') + templates['install/footer']);
|
||||
});
|
||||
app.get('/install/index', function(req, res) {
|
||||
res.send(templates['install/header'] + app.create_route('install/index') + templates['install/footer']);
|
||||
});
|
||||
|
||||
|
||||
function api_method(req, res) {
|
||||
switch(req.params.method) {
|
||||
case 'basic' :
|
||||
res.send('{}');
|
||||
break;
|
||||
|
||||
default :
|
||||
res.send('{}');
|
||||
}
|
||||
}
|
||||
|
||||
app.get('/api/install/:method/:tab?*', api_method);
|
||||
app.get('/api/install/:method*', api_method);
|
||||
};
|
||||
|
||||
|
||||
}(exports));
|
||||
@@ -17,6 +17,7 @@ var express = require('express'),
|
||||
notifications = require('./notifications.js'),
|
||||
admin = require('./routes/admin.js'),
|
||||
userRoute = require('./routes/user.js'),
|
||||
installRoute = require('./routes/install.js'),
|
||||
auth = require('./routes/authentication.js');
|
||||
|
||||
(function(app) {
|
||||
@@ -62,6 +63,7 @@ var express = require('express'),
|
||||
auth.create_routes(app);
|
||||
admin.create_routes(app);
|
||||
userRoute.create_routes(app);
|
||||
installRoute.create_routes(app);
|
||||
|
||||
|
||||
app.create_route = function(url, tpl) { // to remove
|
||||
|
||||
Reference in New Issue
Block a user