Repo has an icon, team has none
This commit is contained in:
parent
57c7ee588b
commit
c5f6a2c004
|
@ -28,12 +28,20 @@
|
||||||
float: left;
|
float: left;
|
||||||
width: 40px;
|
width: 40px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
background-color: #ddd;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-size: 100% auto;
|
background-size: 100% 100%;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
border-radius: 2px;
|
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 {
|
.info-block h1 {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
|
|
|
@ -21,10 +21,6 @@
|
||||||
.barchart g:hover .bar {
|
.barchart g:hover .bar {
|
||||||
opacity: .8;
|
opacity: .8;
|
||||||
}
|
}
|
||||||
.barchart .label {
|
|
||||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
.barchart .label_underlay {
|
.barchart .label_underlay {
|
||||||
fill: rgba(255, 255, 255, .7);
|
fill: rgba(255, 255, 255, .7);
|
||||||
}
|
}
|
||||||
|
@ -138,6 +134,7 @@
|
||||||
color: #444;
|
color: #444;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
|
height: 72px; /* 3*line-height */
|
||||||
}
|
}
|
||||||
|
|
||||||
.whatsgoingon em {
|
.whatsgoingon em {
|
||||||
|
|
|
@ -8,7 +8,7 @@ var Storage = {
|
||||||
|
|
||||||
get: function(category, key) {
|
get: function(category, key) {
|
||||||
var val = window.localStorage.getItem(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(){
|
render: function(){
|
||||||
var p = this.getParams(),
|
var p = this.getParams(),
|
||||||
infoImage, infoTitle,
|
infoImage, infoImageClass, infoTitle,
|
||||||
bcApi, bcItems,
|
bcApi, bcItems,
|
||||||
sacApi, sacItems;
|
sacApi, sacItems;
|
||||||
|
|
||||||
if (p.team) {
|
if (p.team) {
|
||||||
infoTitle = p.team;
|
infoTitle = p.team +' Team';
|
||||||
|
infoImageClass = 'team';
|
||||||
bcApi = '/api/stat/teams/top';
|
bcApi = '/api/stat/teams/top';
|
||||||
bcItems = ['repo', 'user'],
|
bcItems = ['repo', 'user'],
|
||||||
sacApi = '/api/stat/teams/activity';
|
sacApi = '/api/stat/teams/activity';
|
||||||
|
@ -164,6 +165,7 @@ var Dashboard = React.createClass({
|
||||||
sacItems = ['repo'];
|
sacItems = ['repo'];
|
||||||
} else if (p.repo) {
|
} else if (p.repo) {
|
||||||
infoTitle = p.repo;
|
infoTitle = p.repo;
|
||||||
|
infoImageClass = 'repo';
|
||||||
bcApi = '/api/stat/repos/top';
|
bcApi = '/api/stat/repos/top';
|
||||||
bcItems = ['user', 'team'],
|
bcItems = ['user', 'team'],
|
||||||
sacApi = '/api/stat/repos/activity';
|
sacApi = '/api/stat/repos/activity';
|
||||||
|
@ -180,7 +182,7 @@ var Dashboard = React.createClass({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="content">
|
<div className="content">
|
||||||
<InfoBlock image={infoImage} title={infoTitle} />
|
<InfoBlock image={infoImage} className={infoImageClass} title={infoTitle} />
|
||||||
<BarChart api={bcApi} params={this.getParams()} items={bcItems} />
|
<BarChart api={bcApi} params={this.getParams()} items={bcItems} />
|
||||||
<StackedAreaChart api={sacApi} params={this.getParams()} items={sacItems} />
|
<StackedAreaChart api={sacApi} params={this.getParams()} items={sacItems} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -208,8 +210,8 @@ var InfoBlock = React.createClass({
|
||||||
render: function() {
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<div className="info-block">
|
<div className="info-block">
|
||||||
<div className={'img'+ (this.props.image ? '' : ' empty')}
|
<div className={'img'+ (this.props.image ? '' : ' empty') +' '+ this.props.className}
|
||||||
style={{backgroundImage: "url("+ (this.props.image || '') +")"}} />
|
style={this.props.image ? {backgroundImage: "url("+ this.props.image +")"} : null} />
|
||||||
<h1>{this.props.title}</h1>
|
<h1>{this.props.title}</h1>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue