Commit 6d3053b5 authored by Leo Iannacone's avatar Leo Iannacone

moved status icons and status classes to config in layout

parent 54e883e8
...@@ -4,16 +4,8 @@ function Page_Generic() ...@@ -4,16 +4,8 @@ function Page_Generic()
function __get_status_html(status_package) { function __get_status_html(status_package) {
classes = {} c = config.status.classes
classes.building = 'warning' i = config.status.icons
classes.successed = 'success'
classes.failed = 'danger'
icons = {}
icons.building = 'refresh'
icons.successed = ''
icons.failed = ''
s = status_package s = status_package
li = $('<li></li>') li = $('<li></li>')
...@@ -24,18 +16,17 @@ function Page_Generic() ...@@ -24,18 +16,17 @@ function Page_Generic()
button.attr('title', s.status + ': ' + s.distribution + ' > ' + s.package) button.attr('title', s.status + ': ' + s.distribution + ' > ' + s.package)
button.attr('href', config.paths.distribution + '#' + s.distribution + '/' + s.package.replace('_', '/') + '/datestamp') button.attr('href', config.paths.distribution + '#' + s.distribution + '/' + s.package.replace('_', '/') + '/datestamp')
button.html(s.package.split('_')[0]) button.html(s.package.split('_')[0])
//button.html(button.html() + ' <small class="distribution">[' + s.distribution + ']</small>')
if (s.status == 'building') { if (s.status == 'building') {
button_class = classes.building button_class = c.building
icon = icons.building icon = i.building
} }
else if (s.status == 'build-failed') { else if (s.status == 'build-failed') {
button_class = classes.failed button_class = c.failed
icon = icons.failed icon = i.failed
} }
else { else {
button_class = classes.successed button_class = c.successed
icon = icons.successed icon = i.successed
} }
button.addClass('btn-' + button_class) button.addClass('btn-' + button_class)
button.html(button.html() + ' <span class="icon glyphicon glyphicon-' + icon + '"></span>') button.html(button.html() + ' <span class="icon glyphicon glyphicon-' + icon + '"></span>')
......
...@@ -45,6 +45,18 @@ ...@@ -45,6 +45,18 @@
<script> <script>
var config = <%- JSON.stringify(web) %> var config = <%- JSON.stringify(web) %>
config.status = {}
config.status.classes = {}
config.status.classes.building = 'info'
config.status.classes.successed = 'success'
config.status.classes.failed = 'danger'
config.status.icons = {}
config.status.icons.building = 'refresh'
config.status.icons.successed = 'ok'
config.status.icons.failed = 'error'
</script> </script>
<script src='/javascripts/utils.js'></script> <script src='/javascripts/utils.js'></script>
......
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