From d8686c94eeb9a216f6fe6d49b360d9a6609154f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Thu, 27 Dec 2018 01:24:14 +0100 Subject: [PATCH] empty usercp --- inc/fftcgrouter.coffee | 3 ++- src/usercp.coffee | 10 ++++++++++ views/usercp.pug | 6 ++++++ webpack.config.js | 5 +++-- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 src/usercp.coffee create mode 100644 views/usercp.pug diff --git a/inc/fftcgrouter.coffee b/inc/fftcgrouter.coffee index d068c57..574027f 100644 --- a/inc/fftcgrouter.coffee +++ b/inc/fftcgrouter.coffee @@ -61,8 +61,9 @@ FFTCGROUTER.post '/login', (req, res) -> # Templates FFTCGROUTER.get '/:template.html', (req, res) -> + # redirect logged-in users to user cp if req.session.user and req.params.template == 'index' - return res.redirect '/game.html' + return res.redirect '/usercp.html' # render requested template diff --git a/src/usercp.coffee b/src/usercp.coffee new file mode 100644 index 0000000..04ae91f --- /dev/null +++ b/src/usercp.coffee @@ -0,0 +1,10 @@ +# libs +window.$ = require('jquery') + +# import bootstrap +require './style/custom.scss' +require 'bootstrap/js/dist/alert' + +# on load +$ -> + return diff --git a/views/usercp.pug b/views/usercp.pug new file mode 100644 index 0000000..8eb8ae5 --- /dev/null +++ b/views/usercp.pug @@ -0,0 +1,6 @@ +doctype html +html + head + title Crafty Things + script(src='/usercp.bundle.js') + body diff --git a/webpack.config.js b/webpack.config.js index 25512da..eb231c3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -4,8 +4,9 @@ module.exports = { mode: 'development', entry: { - index: './src/index.coffee', - game: './src/game.coffee' + index: './src/index.coffee', + game: './src/game.coffee', + usercp: './src/usercp.coffee' }, devtool: 'inline-source-map',