[Fix #3] First paj

pull/16/head
sundowndev 2018-07-30 18:14:28 +02:00
parent 777736de59
commit e4784422e3
7 changed files with 147 additions and 1672 deletions

1658
client/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -7,11 +7,12 @@
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"build:prod": "webpack --config webpack.config.prod.js", "build:prod": "webpack --config webpack.config.prod.js",
"build:dev": "webpack --config webpack.config.js", "build:dev": "webpack --config webpack.config.js",
"watch": "webpack-watch-server --config webpack.config.js" "dev": "tsc-watch src/index.ts --outDir ./dist --onSuccess 'node ./dist/index.js' --onFailure 'echo Beep! Compilation Failed'"
}, },
"author": "Dr. Patrick Bartsch", "author": "Dr. Patrick Bartsch",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"tsc-watch": "^1.0.26",
"uglifyjs-webpack-plugin": "^1.1.6", "uglifyjs-webpack-plugin": "^1.1.6",
"webpack": "^3.10.0" "webpack": "^3.10.0"
}, },
@ -20,7 +21,6 @@
"express": "^4.16.2", "express": "^4.16.2",
"ts-loader": "^3.2.0", "ts-loader": "^3.2.0",
"twig": "^1.12.0", "twig": "^1.12.0",
"typescript": "^2.6.2", "typescript": "^2.6.2"
"webpack-watch-server": "^1.2.1"
} }
} }

View File

@ -6,8 +6,15 @@ const http = require("http");
let app = express(); let app = express();
app.set('view engine', 'twig'); app.set('view engine', 'twig');
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');
app.use(express.static(__dirname + 'public'));
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.render('index', { title: 'Hey', message: 'Hello there!' }); res.render('index');
});
app.get('/login', (req, res) => {
res.render('login');
});
app.get('/register', (req, res) => {
res.render('register');
}); });
app.get('/task/{id}', (req, res) => { app.get('/task/{id}', (req, res) => {
//res.render('index', {title: 'Hey', message: 'Hello there!'}); //res.render('index', {title: 'Hey', message: 'Hello there!'});

View File

@ -7,9 +7,18 @@ let app: express.Application = express();
app.set('view engine', 'twig'); app.set('view engine', 'twig');
app.set('views', __dirname + '/views'); app.set('views', __dirname + '/views');
app.use(express.static(__dirname + 'public'));
app.get('/', (req: Request, res: Response) => { app.get('/', (req: Request, res: Response) => {
res.render('index', {title: 'Hey', message: 'Hello there!'}); res.render('index');
});
app.get('/login', (req: Request, res: Response) => {
res.render('login');
});
app.get('/register', (req: Request, res: Response) => {
res.render('register');
}); });
app.get('/task/{id}', (req: Request, res: Response) => { app.get('/task/{id}', (req: Request, res: Response) => {

View File

@ -1,123 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="/favicon.ico">
<title>Project manager</title>
<!-- Bootstrap core CSS -->
<link href="https://getbootstrap.com/docs/4.1/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="https://getbootstrap.com/docs/4.1/examples/offcanvas/offcanvas.css" rel="stylesheet">
</head>
<body class="bg-light">
<nav class="navbar navbar-expand-lg fixed-top navbar-dark bg-dark">
<a class="navbar-brand mr-auto mr-lg-0" href="#">Project manager</a>
<button class="navbar-toggler p-0 border-0" type="button" data-toggle="offcanvas">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse offcanvas-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Sign in</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Register</a>
</li>
</ul>
</div>
</nav>
<div class="nav-scroller bg-white box-shadow">
<nav class="nav nav-underline">
<a class="nav-link" href="#">Tasks</a>
<a class="nav-link" href="#">Users</a>
</nav>
</div>
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<strong>Holy guacamole!</strong> You should check in on some of those fields below.
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<main role="main" class="container">
<div class="d-flex align-items-center p-3 my-3 text-white-50 bg-info rounded box-shadow">
<img class="mr-3" src="https://image.flaticon.com/icons/svg/138/138839.svg" alt="" width="48" height="48">
<div class="lh-100">
<h6 class="mb-0 text-white lh-100">Task manager</h6>
<small>https://github.com/Sundowndev/interview-v1</small>
</div>
</div>
<div class="my-3 p-3 bg-white rounded box-shadow">
<form action="#">
<div class="form-group">
<label for="title">Title</label>
<input type="text" name="title" id="title" class="form-control">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea name="description" id="description" class="form-control"></textarea>
</div>
<button type="submit" class="btn btn-success">Create task</button>
</form>
</div>
<div class="my-3 p-3 bg-white rounded box-shadow">
<h6 class="border-bottom border-gray pb-2 mb-0">All tasks</h6>
<div class="media text-muted pt-3">
<img src="https://dummyimage.com/32x32/54bf22/fff.jpg&text=+" alt="" class="mr-2 rounded">
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<a href=""><strong class="text-gray-dark">Faire rapport de stage</strong></a>
<span class="badge badge-pill badge-primary">Open</span>
</div>
<span class="d-block">Je dois faire ça lààààà</span>
</div>
</div>
<div class="media text-muted pt-3">
<img src="https://dummyimage.com/32x32/54bf22/fff.jpg&text=+" alt="" class="mr-2 rounded">
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<a href=""><strong class="text-gray-dark">Faire rapport de stage</strong></a>
<span class="badge badge-pill badge-primary">Open</span>
</div>
<span class="d-block">Je dois faire ça lààààà</span>
</div>
</div>
<div class="media text-muted pt-3">
<img src="https://dummyimage.com/32x32/54bf22/fff.jpg&text=+" alt="" class="mr-2 rounded">
<div class="media-body pb-3 mb-0 small lh-125 border-bottom border-gray">
<div class="d-flex justify-content-between align-items-center w-100">
<a href=""><strong class="text-gray-dark">Faire rapport de stage</strong></a>
<span class="badge badge-pill badge-primary">Open</span>
</div>
<span class="d-block">Je dois faire ça lààààà</span>
</div>
</div>
</div>
</main>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js" integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em" crossorigin="anonymous"></script>
<script>
$(".close").on('click', () => {
$(".close").alert('close');
});
</script>
</body>
</html>

View File

@ -1,8 +1,8 @@
var webpack = require('webpack'); let webpack = require('webpack');
var path = require('path'); let path = require('path');
var fs = require('fs'); let fs = require('fs');
var nodeModules = {}; let nodeModules = {};
fs.readdirSync('node_modules') fs.readdirSync('node_modules')
.filter(function (x) { .filter(function (x) {
return ['.bin'].indexOf(x) === -1; return ['.bin'].indexOf(x) === -1;
@ -33,5 +33,9 @@ module.exports = {
node: { node: {
__filename: true, __filename: true,
__dirname: true __dirname: true
},
watchOptions: {
ignored: /node_modules/,
poll: 2000 // Check for changes every second
} }
}; };