Commit 273f4856 authored by Leo Iannacone's avatar Leo Iannacone

created user preferences

parent 2a9f4c5c
......@@ -43,6 +43,7 @@ app.configure('production', function(){
// Routes
app.get('/', routes.index);
app.get(config.routes.distribution, routes.distribution)
app.get(config.routes.preferences, routes.preferences)
var broadcast = new Broadcaster(io.sockets, status)
......
......@@ -10,13 +10,18 @@ config.debomatic.jsonfile = '/var/log/debomatic.json'
config.routes = {}
config.routes.debomatic = '/debomatic'
config.routes.distribution = '/distribution'
config.routes.preferences = '/preferences'
config.web = {}
config.web.title = "deb-o-matic web.ui"
config.web.description = "This is a web interface for debomatic"
config.web.footer = "Fork me on github.com"
config.web.autoscroll = true
// default ui settings
config.web.preferences = {}
config.web.preferences.autoscroll = true
config.web.preferences.header = true
config.web.preferences.sidebar = true
// DO NOT EDIT these ones
......
var socket = io.connect('//' + config.hostname );
new Preferences()
new Page_Generic().init(socket)
if (window.location.pathname == config.paths.distribution) {
......
function Preferences() {
// update config.preferences according with user choices
this.load = function() {
for (setting in config.preferences) {
if ((value = localStorage.getItem(setting))) {
config.preferences[setting] = JSON.parse(value)
}
}
}
this.load()
}
\ No newline at end of file
......@@ -11,4 +11,8 @@ exports.index = function(req, res){
exports.distribution = function(req, res) {
res.render('distribution', config)
};
exports.preferences = function(req, res) {
res.render('preferences', config)
}
......@@ -24,6 +24,11 @@
<div id="distributions">
<ul class="nav navbar-nav"></ul>
</div>
<div id="pages">
<ul class="nav navbar-nav pull-right">
<li><a href="/preferences">Preferences</a></li>
</ul>
</div>
</div>
</nav>
......@@ -65,6 +70,7 @@
</script>
<script src='/javascripts/utils.js'></script>
<script src='/javascripts/preferences.js'></script>
<script src='/javascripts/page_generic.js'></script>
<script src='/javascripts/page_distribution.js'></script>
<script src='/javascripts/main.js'></script>
......
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Preferences</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
\ No newline at end of file
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