Commit 449f9e8a authored by Leo Iannacone's avatar Leo Iannacone

get icon html from Utils

parent 90da97a5
...@@ -12,9 +12,10 @@ function Page_Generic() ...@@ -12,9 +12,10 @@ 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])
var info = utils.get_status_icon_and_class(s) var info = Utils.get_status_icon_and_class(s)
button.addClass('btn-' + info.className) button.addClass('btn-' + info.className)
button.html(button.html() + ' <span class="icon glyphicon glyphicon-' + info.icon + '"></span>') // add icon
button.html(button.html() + ' ' + Utils.get_status_icon_html(s))
li.html(button) li.html(button)
var result = $('<div></div>') var result = $('<div></div>')
result.html(li) result.html(li)
......
...@@ -51,14 +51,14 @@ var Utils = { ...@@ -51,14 +51,14 @@ var Utils = {
get_status_icon_and_class: function (status_data) { get_status_icon_and_class: function (status_data) {
var _c = config.status.className var _c = config.status.className
var _i = config.status.icons var _i = config.status.icons
var _s = status_data
var className = null var className = null
var icon = null var icon = null
var s = status_package if (_s.status == config.status.package.building) {
if (s.status == config.status.package.building) {
className = _c.building className = _c.building
icon = _i.building icon = _i.building
} }
else if (s.status == config.status.package.failed) { else if (_s.status == config.status.package.failed) {
className = _c.failed className = _c.failed
icon = _i.failed icon = _i.failed
} }
...@@ -71,4 +71,9 @@ var Utils = { ...@@ -71,4 +71,9 @@ var Utils = {
icon: icon icon: icon
} }
}, },
get_status_icon_html: function (status_data) {
info = Utils.get_status_icon_and_class(status_data)
return '<span class="icon glyphicon glyphicon-' + info.icon + '"></span>'
}
} }
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