Skip to content
Snippets Groups Projects
Commit 14878da2 authored by Josefine Wegert's avatar Josefine Wegert
Browse files

bootstrap and spinner added to views

parent 773845e7
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ var fsReaddir = require('fs-readdir');
var JSZip = require('jszip');
var exphbs = require('express-handlebars');
// global.jQuery = require('jquery');
// const bootstrap = require('bootstrap');
//initializer
var initGitRepos = require('./initializers/gitRepos.js');
//load names of available download files
......@@ -55,7 +56,7 @@ app.use(bodyParser.json());
});
app.get('/download', function(req, res){
app.get('/download', function(req, res, next){
//holds promises for backend and/or frontend
const promiseArray = []
const checkedFiles = req.query.checkedFiles.split(',');
......@@ -141,6 +142,7 @@ function createZip(zip){
}).on('finish', function () {
console.log('explorviz-builds.zip written.');
res.download('explorviz-builds.zip');
//how to redirect to home page?
});
})
......
......@@ -10,14 +10,17 @@
"license": "Apache-2.0",
"dependencies": {
"body-parser": "^1.17.1",
"bootstrap": "^3.3.7",
"child_process": "^1.0.2",
"express": "^4.15.2",
"express-handlebars": "^3.0.0",
"fs": "0.0.1-security",
"fs-readdir": "0.0.3",
"jquery": "^3.2.1",
"jszip": "^3.1.3",
"node-zip": "^1.1.1",
"path": "^0.12.7"
"path": "^0.12.7",
"spinkit": "^1.2.5"
},
"devDependencies": {
"eslint": "^4.1.1",
......
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Downloading</title>
<!-- Bootstrap -->
<link src="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
.sk-circle {
margin: 40px auto;
......@@ -118,6 +120,9 @@
-webkit-transform: scale(1);
transform: scale(1); } }
</style>
<!-- Bootstrap -->
<!--<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="container">
......@@ -136,14 +141,16 @@
<div class="sk-circle12 sk-child"></div>
</div>
<div class="row">
<div class="col-md-3"></div><div class="col-md-6"> Your download is being prepared. This may take a moment. Do not close the window.</div><div class="col-md-3"></div>
<div class="col-md-3"></div><div class="col-md-6"> Your download is being prepared. This may take a moment. Do not close the window.</div>
</div>
{{#each checkedFiles as |file|}}
{{/each}}
<script> location.href="/download?checkedFiles={{checkedFiles}}" </script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- <script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>Download</title>
<!-- Bootstrap -->
<!--<link href="../node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="row">
<div class="col-md-3"></div>
<div class="container">
<h3>Choose which files to compile into your custom build of ExplorViz:</h3>
<form action="/" method="post">
Choose which files to compile into your custom build of ExplorViz:<br>
<div class ="form-group">
<div class="checkbox">
<label>
{{#each downloadFiles as |item|}}
<input type="checkbox" name={{item}} value={{item}}>{{item}}<br>
{{/each}}
<br>
<button type="submit">Create Build and Download Zip</button>
</label>
</div>
<button type="submit" class="btn btn-primary">Create Build and Download Zip</button>
</div>
</form>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- <script src="../node_modules/bootstrap/dist/js/bootstrap.min.js"></script>-->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment