diff --git a/rhodecode/public/css/tables.less b/rhodecode/public/css/tables.less --- a/rhodecode/public/css/tables.less +++ b/rhodecode/public/css/tables.less @@ -408,29 +408,11 @@ table.trending_language_tbl { .trending_language { position: relative; - width: 100%; - height: 19px; overflow: hidden; - background-color: @grey6; + color: @text-color; + width: 400px; - span, b{ - position: absolute; - display: block; - height: 12px; - margin-bottom: 0px; - white-space: pre; - padding: floor(@basefontsize/4); - top: 0; - left: 0; - } - - span{ - color: @text-color; - z-index: 0; - min-width: 20px; - } - - b { + .lang-bar { z-index: 1; overflow: hidden; background-color: @rcblue; diff --git a/rhodecode/public/js/src/rhodecode.js b/rhodecode/public/js/src/rhodecode.js --- a/rhodecode/public/js/src/rhodecode.js +++ b/rhodecode/public/js/src/rhodecode.js @@ -102,7 +102,7 @@ var showRepoStats = function(target, dat var total = 0; var no_data = true; var tbl = document.createElement('table'); - tbl.setAttribute('class', 'trending_language_tbl'); + tbl.setAttribute('class', 'trending_language_tbl rctable'); $.each(data, function(key, val){ total += val.count; @@ -120,54 +120,47 @@ var showRepoStats = function(target, dat cnt += 1; no_data = false; - var hide = cnt > 2; var tr = document.createElement('tr'); - if (hide) { - tr.setAttribute('style', 'display:none'); - tr.setAttribute('class', 'stats_hidden'); - } var key = val[0]; var obj = {"desc": val[1].desc, "count": val[1].count}; - var percentage = Math.round((obj.count / total * 100), 2); - + // meta language names var td1 = document.createElement('td'); - td1.width = 300; var trending_language_label = document.createElement('div'); - trending_language_label.innerHTML = obj.desc + " (.{0})".format(key); + trending_language_label.innerHTML = obj.desc; td1.appendChild(trending_language_label); + // extensions var td2 = document.createElement('td'); - var trending_language = document.createElement('div'); - var nr_files = obj.count +" "+ _ngettext('file', 'files', obj.count); - - trending_language.title = key + " " + nr_files; + var extension = document.createElement('div'); + extension.innerHTML = ".{0}".format(key) + td2.appendChild(extension); - trending_language.innerHTML = "" + percentage + "% " + nr_files - + "" + percentage + "% " + nr_files + ""; + // number of files + var td3 = document.createElement('td'); + var file_count = document.createElement('div'); + var percentage_num = Math.round((obj.count / total * 100), 2); + var label = _ngettext('file', 'files', obj.count); + file_count.innerHTML = "{0} {1} ({2}%)".format(obj.count, label, percentage_num) ; + td3.appendChild(file_count); - trending_language.setAttribute("class", 'trending_language'); - $('b', trending_language)[0].style.width = percentage + "%"; - td2.appendChild(trending_language); + // percentage + var td4 = document.createElement('td'); + td4.setAttribute("class", 'trending_language'); + + var percentage = document.createElement('div'); + percentage.setAttribute('class', 'lang-bar'); + percentage.innerHTML = " "; + percentage.style.width = percentage_num + '%'; + td4.appendChild(percentage); tr.appendChild(td1); tr.appendChild(td2); + tr.appendChild(td3); + tr.appendChild(td4); tbl.appendChild(tr); - if (cnt == 3) { - var show_more = document.createElement('tr'); - var td = document.createElement('td'); - lnk = document.createElement('a'); - lnk.href = '#'; - lnk.innerHTML = _gettext('Show more'); - lnk.id = 'code_stats_show_more'; - td.appendChild(lnk); - - show_more.appendChild(td); - show_more.appendChild(document.createElement('td')); - tbl.appendChild(show_more); - } }); $(container).html(tbl); diff --git a/rhodecode/templates/summary/components.mako b/rhodecode/templates/summary/components.mako --- a/rhodecode/templates/summary/components.mako +++ b/rhodecode/templates/summary/components.mako @@ -139,30 +139,21 @@ - + + ## owner, description, downloads, statistics + ## Owner
+ ## Description + ## Downloads % if show_downloads: