closes #6476, closes #6546

This commit is contained in:
Barış Soner Uşaklı
2018-06-02 15:54:28 -04:00
parent af58717d9c
commit d5e85c2eb3
7 changed files with 55 additions and 29 deletions

View File

@@ -444,7 +444,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
function updateTopicsGraph(topics) {
if (!topics.length) {
topics = [{
title: 'No users browsing',
title: '[[admin/general/dashboard:no-users-browsing]]',
count: 1,
}];
}
@@ -463,15 +463,16 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
function buildTopicsLegend() {
var legend = $('#topics-legend').html('');
var html = '';
topics.forEach(function (topic, i) {
var label = topic.count === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + topic.tid + '" target="_blank"> ' + topic.title + '</a>';
legend.append('<li>' +
html += '<li>' +
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
'<span>' + label + '</span>' +
'</li>');
'</li>';
});
legend.translateHtml(html);
}
buildTopicsLegend();