1
0
Fork 0

Repo has an icon, team has none

This commit is contained in:
Gregory Eremin 2015-03-18 01:56:10 +07:00
parent 57c7ee588b
commit c5f6a2c004
3 changed files with 19 additions and 12 deletions

View File

@ -28,12 +28,20 @@
float: left;
width: 40px;
height: 40px;
background-color: #ddd;
background-repeat: no-repeat;
background-position: center;
background-size: 100% auto;
background-size: 100% 100%;
margin-right: 10px;
border-radius: 2px;
}
.info-block .img.repo {
background-size: 30px 40px;
/* Source: https://github.com/github/octicons/blob/master/svg/repo.svg */
background-image: url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwMjQiIHdpZHRoPSI3NjgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTMyMCAyNTZoLTY0djY0aDY0di02NHogbTAtMTI4aC02NHY2NGg2NHYtNjR6IG0zODQtMTI4Yy0zMiAwLTYwOCAwLTY0MCAwcy02NCAzMi02NCA2NCAwIDczNiAwIDc2OCAzMiA2NCA2NCA2NCAxMjggMCAxMjggMHYxMjhsOTYtOTYgOTYgOTZ2LTEyOHMyODggMCAzMjAgMCA2NC0zMiA2NC02NCAwLTczNiAwLTc2OC0zMi02NC02NC02NHogbTAgODAwYzAgMTYtMTUgMzItMzIgMzJzLTI4OCAwLTI4OCAwdi02NGgtMTkydjY0cy03OSAwLTk2IDAtMzItMTctMzItMzIgMC05NiAwLTk2aDY0MHMwIDgwIDAgOTZ6IG0wLTE2MGgtNTEydi01NzZoNTEzbC0xIDU3NnogbS0zODQtMTI4aC02NHY2NGg2NHYtNjR6IG0wLTEyOGgtNjR2NjRoNjR2LTY0eiIgLz4KPC9zdmc+);
}
.info-block .img.team {
display: none;
}
.info-block h1 {
font-size: 30px;

View File

@ -21,10 +21,6 @@
.barchart g:hover .bar {
opacity: .8;
}
.barchart .label {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 16px;
}
.barchart .label_underlay {
fill: rgba(255, 255, 255, .7);
}
@ -138,6 +134,7 @@
color: #444;
margin-bottom: 20px;
line-height: 24px;
height: 72px; /* 3*line-height */
}
.whatsgoingon em {

View File

@ -8,7 +8,7 @@ var Storage = {
get: function(category, key) {
var val = window.localStorage.getItem(category +'-'+ key);
return val === null ? null : JSON.parse(val);
return val === null ? {} : JSON.parse(val);
}
};
@ -144,12 +144,13 @@ var Dashboard = React.createClass({
render: function(){
var p = this.getParams(),
infoImage, infoTitle,
infoImage, infoImageClass, infoTitle,
bcApi, bcItems,
sacApi, sacItems;
if (p.team) {
infoTitle = p.team;
infoTitle = p.team +' Team';
infoImageClass = 'team';
bcApi = '/api/stat/teams/top';
bcItems = ['repo', 'user'],
sacApi = '/api/stat/teams/activity';
@ -164,6 +165,7 @@ var Dashboard = React.createClass({
sacItems = ['repo'];
} else if (p.repo) {
infoTitle = p.repo;
infoImageClass = 'repo';
bcApi = '/api/stat/repos/top';
bcItems = ['user', 'team'],
sacApi = '/api/stat/repos/activity';
@ -180,7 +182,7 @@ var Dashboard = React.createClass({
return (
<div className="content">
<InfoBlock image={infoImage} title={infoTitle} />
<InfoBlock image={infoImage} className={infoImageClass} title={infoTitle} />
<BarChart api={bcApi} params={this.getParams()} items={bcItems} />
<StackedAreaChart api={sacApi} params={this.getParams()} items={sacItems} />
</div>
@ -208,8 +210,8 @@ var InfoBlock = React.createClass({
render: function() {
return (
<div className="info-block">
<div className={'img'+ (this.props.image ? '' : ' empty')}
style={{backgroundImage: "url("+ (this.props.image || '') +")"}} />
<div className={'img'+ (this.props.image ? '' : ' empty') +' '+ this.props.className}
style={this.props.image ? {backgroundImage: "url("+ this.props.image +")"} : null} />
<h1>{this.props.title}</h1>
</div>
)