Changeset - ef23fa832ab2
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2012-01-22 02:33:43
marcin@python-works.com
fixed percentage in stats
fixed menu css
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/css/style.css
Show inline comments
 
@@ -376,97 +376,97 @@ div.options a {
 
	padding: 10px 12px 8px;
 
}
 
 
#header #header-inner #quick li span.icon {
 
	top: 0;
 
	left: 0;
 
	border-left: none;
 
	border-right: 1px solid #2e5c89;
 
	padding: 8px 6px 4px;
 
}
 
 
#header #header-inner #quick li span.icon_short {
 
	top: 0;
 
	left: 0;
 
	border-left: none;
 
	border-right: 1px solid #2e5c89;
 
	padding: 8px 6px 4px;
 
}
 
 
#header #header-inner #quick li span.icon img,#header #header-inner #quick li span.icon_short img
 
	{
 
	margin: 0px -2px 0px 0px;
 
}
 
 
#header #header-inner #quick li a:hover {
 
	background: #4e4e4e no-repeat top left;
 
}
 
 
#header #header-inner #quick li a:hover span {
 
	border-left: 1px solid #545454;
 
}
 
 
#header #header-inner #quick li a:hover span.icon,#header #header-inner #quick li a:hover span.icon_short
 
	{
 
	border-left: none;
 
	border-right: 1px solid #464646;
 
}
 
 
#header #header-inner #quick ul {
 
	top: 29px;
 
	right: 0;
 
	min-width: 200px;
 
	display: none;
 
	position: absolute;
 
	background: #FFF;
 
	border: 1px solid #666;
 
	border-top: 1px solid #003367;
 
	z-index: 100;
 
	margin: 2px 0px 0px 0px;
 
	margin: 0px 0px 0px 0px;
 
	padding: 0;
 
}
 
 
#header #header-inner #quick ul.repo_switcher {
 
	max-height: 275px;
 
	overflow-x: hidden;
 
	overflow-y: auto;
 
}
 
 
#header #header-inner #quick ul.repo_switcher li.qfilter_rs {
 
	float: none;
 
	margin: 0;
 
	border-bottom: 2px solid #003367;
 
}
 
 
#header #header-inner #quick .repo_switcher_type {
 
	position: absolute;
 
	left: 0;
 
	top: 9px;
 
}
 
 
#header #header-inner #quick li ul li {
 
	border-bottom: 1px solid #ddd;
 
}
 
 
#header #header-inner #quick li ul li a {
 
	width: 182px;
 
	height: auto;
 
	display: block;
 
	float: left;
 
	background: #FFF;
 
	color: #003367;
 
	font-weight: 400;
 
	margin: 0;
 
	padding: 7px 9px;
 
}
 
 
#header #header-inner #quick li ul li a:hover {
 
	color: #000;
 
	background: #FFF;
 
}
 
 
#header #header-inner #quick ul ul {
 
	top: auto;
 
}
 
 
#header #header-inner #quick li ul ul {
 
	right: 200px;
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -254,99 +254,100 @@ YUE.on('clone_by_name','click',function(
 
    YUD.setStyle('clone_url_id','display','none');
 

	
 
})
 
YUE.on('clone_by_id','click',function(e){
 

	
 
	// show url by id and hide id button
 
	YUD.setStyle('clone_by_id','display','none');
 
    YUD.setStyle('clone_url_id','display','');
 

	
 
    // hide url by name and show id button
 
	YUD.setStyle('clone_by_name','display','');
 
	YUD.setStyle('clone_url','display','none');
 
})
 

	
 

	
 
var tmpl_links = {};
 
%for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
 
  tmpl_links["${archive['type']}"] = '${h.link_to('__NAME__', h.url('files_archive_home',repo_name=c.dbrepo.repo_name, fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_='archive_icon ui-btn')}';
 
%endfor
 

	
 
YUE.on(['download_options','archive_subrepos'],'change',function(e){
 
   var sm = YUD.get('download_options');
 
   var new_cs = sm.options[sm.selectedIndex];
 

	
 
   for(k in tmpl_links){
 
       var s = YUD.get(k+'_link');
 
       if(s){
 
         var title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
 
         title_tmpl= title_tmpl.replace('__CS_NAME__',new_cs.text);
 
         title_tmpl = title_tmpl.replace('__CS_EXT__',k);
 

	
 
         var url = tmpl_links[k].replace('__CS__',new_cs.value);
 
         var subrepos = YUD.get('archive_subrepos').checked;
 
         url = url.replace('__SUB__',subrepos);
 
         url = url.replace('__NAME__',title_tmpl);
 
         s.innerHTML = url
 
       }
 
   }
 
});
 
</script>
 
%if c.show_stats:
 
<script type="text/javascript">
 
var data = ${c.trending_languages|n};
 
var total = 0;
 
var no_data = true;
 
var tbl = document.createElement('table');
 
tbl.setAttribute('class','trending_language_tbl');
 
var cnt = 0;
 

	
 
for (var i=0;i<data.length;i++){
 
    total += data[i][1].count;
 
}
 
for (var i=0;i<data.length;i++){
 
    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 k = data[i][0];
 
    var obj = data[i][1];
 
    var percentage = Math.round((obj.count/total*100),2);
 

	
 
    var td1 = document.createElement('td');
 
    td1.width = 150;
 
    var trending_language_label = document.createElement('div');
 
    trending_language_label.innerHTML = obj.desc+" ("+k+")";
 
    td1.appendChild(trending_language_label);
 

	
 
    var td2 = document.createElement('td');
 
    td2.setAttribute('style','padding-right:14px !important');
 
    var trending_language = document.createElement('div');
 
    var nr_files = obj.count+" ${_('files')}";
 

	
 
    trending_language.title = k+" "+nr_files;
 

	
 
    if (percentage>22){
 
        trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";
 
    }
 
    else{
 
        trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
 
    }
 

	
 
    trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
 
    trending_language.style.width=percentage+"%";
 
    td2.appendChild(trending_language);
 

	
 
    tr.appendChild(td1);
 
    tr.appendChild(td2);
 
    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 = "${_('show more')}";
 
        lnk.id='code_stats_show_more';
0 comments (0 inline, 0 general)