Commit 171c4c74 authored by Leo Iannacone's avatar Leo Iannacone

update html5 structure

parent 13af9a0b
var config = {} var config = {}
config.host = 'localhost'
config.port = 3000
config.debomatic = {} config.debomatic = {}
config.debomatic.path = '/srv/debomatic-amd64' config.debomatic.path = '/srv/debomatic-amd64'
config.debomatic.webpath = '/debomatic' config.debomatic.webpath = '/debomatic'
config.host = 'localhost'
config.port = 3000
config.web = {} config.web = {}
config.web.title = "deb-o-matic web.ui" config.web.title = "deb-o-matic web.ui"
config.web.description = "This is a web interface for debomatic" config.web.description = "This is a web interface for debomatic"
config.web.footer = "Fork me on github.com"
module.exports = config module.exports = config
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
* GET home page. * GET home page.
*/ */
var config = require('../config.js')
exports.index = function(req, res){ exports.index = function(req, res){
res.render('index', { title: 'Express' }) res.render('index', config.web)
}; };
\ No newline at end of file
<h1><%= title %></h1> <header>
<p>Welcome to <%= title %></p> <h1><%= title %></h1>
<p><%= description %></p>
</header>
<nav id="distributions">
<h1>Availabe distributions:</h1>
<ul></ul>
</nav>
<aside>
<nav id="packages">
<h1>Packages</h1>
<ul></ul>
</nav>
<section>
<nav id="files">
<ul></ul>
</nav>
<nav id="archives">
<ul></ul>
</nav>
<nav id="debs">
<ul></ul>
</nav>
</section>
</aside>
<section>
<header>
</header>
<pre id="file"></pre>
</section>
<footer><%= footer %></footer>
...@@ -30,24 +30,24 @@ ...@@ -30,24 +30,24 @@
var socket = io.connect('//localhost:3000'); var socket = io.connect('//localhost:3000');
socket.on('distributions', function(distributions) { socket.on('distributions', function(distributions) {
$('#distributions').html(''); $('#distributions ul').html('');
distributions.forEach(function (name){ distributions.forEach(function (name){
$('#distributions').append('<li><a href="#' + name + '">' + name + '</li>'); $('#distributions ul').append('<li><a href="#' + name + '">' + name + '</li>');
}); });
}); });
socket.on('distribution_packages', function(data){ socket.on('distribution_packages', function(data){
$('#packages').html('') $('#packages ul').html('')
data.distribution.packages.forEach(function(p){ data.distribution.packages.forEach(function(p){
div = $('#packages').append('<li><a href="#' + data.distribution.name + '/' + p.name + '/'+ p.version + '">'+ p.name + ' <span>'+p.version+'</span></a></li>') div = $('#packages ul').append('<li><a href="#' + data.distribution.name + '/' + p.name + '/'+ p.version + '">'+ p.name + ' <span>'+p.version+'</span></a></li>')
}) })
}) })
socket.on('package_file_list', function(data){ socket.on('package_file_list', function(data){
$('#files').html(''); $('#files ul').html('');
data.package.files.forEach(function(f){ data.package.files.forEach(function(f){
p = data.package p = data.package
$('#files').append('<li><a href="#' + data.distribution.name + '/' + p.name + '/'+ p.version + '/' + f.name + '">' + f.name + '</a></li>') $('#files ul').append('<li><a href="#' + data.distribution.name + '/' + p.name + '/'+ p.version + '/' + f.name + '">' + f.name + '</a></li>')
}) })
}) })
...@@ -72,11 +72,6 @@ ...@@ -72,11 +72,6 @@
</script> </script>
</head> </head>
<body> <body>
<ul id='messages'></ul>
<ul id="distributions"></ul>
<ul id="packages"></ul>
<ul id="files"></ul>
<pre id="file"></pre>
<%- body %> <%- body %>
</body> </body>
</html> </html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment