Add Tags as a CSS class on challenge boxes (#295)

* Add Tags to challenge boxes on the chalboard
selenium-screenshot-testing
Josh Hofing 2017-06-24 15:36:02 -07:00 committed by Kevin Chung
parent 5e98a9fbdc
commit 55a59fbf7a
1 changed files with 5 additions and 0 deletions

View File

@ -230,6 +230,11 @@ function loadchals(refresh) {
var chalbutton = $("<button class='challenge-button trigger theme-background hide-text' value='{0}'></div>".format(chalinfo.id));
var chalheader = $("<h5>{0}</h5>".format(chalinfo.name));
var chalscore = $("<span>{0}</span>".format(chalinfo.value));
for (var j = 0; j < chalinfo.tags.length; j++) {
var tag = 'tag-' + chalinfo.tags[j].replace(/ /g, '-');
chalwrap.addClass(tag);
}
chalbutton.append(chalheader);
chalbutton.append(chalscore);
chalwrap.append(chalbutton);