wn.pages['latest-updates'].onload = function(wrapper) {
wn.ui.make_app_page({
parent: wrapper,
title: 'Latest Updates',
single_column: true
});
var parent = $(wrapper).find(".layout-main");
parent.html('
')
return wn.call({
method:"home.page.latest_updates.latest_updates.get",
callback: function(r) {
parent.empty();
$("Report issues at\
GitHub Issues
\
Commit Log
")
.appendTo(parent);
var $tbody = $('')
.appendTo(parent).find("tbody");
$.each(r.message, function(i, log) {
if(log.message.indexOf("minor")===-1
&& log.message.indexOf("docs")===-1
&& log.message.indexOf("[")!==-1) {
log.message = log.message.replace(/(\[[^\]]*\])/g,
function(match, p1, offset, string) {
match = match.toLowerCase();
var color_class = "";
$.each(["bug", "fix"], function(i, v) {
if(!color_class && match.indexOf(v)!==-1)
color_class = "label-danger";
});
return '' + p1.slice(1,-1) + ' '
});
log.repo = log.repo==="lib" ? "wnframework" : "erpnext";
$(repl('\
%(message)s\
By %(author)s on %(date)s |
', log)).appendTo($tbody);
}
})
}
})
};