builds list improvements

This commit is contained in:
Vladimir Polyakov 2015-05-10 00:36:17 +03:00
parent 9f3a194bd8
commit 399e0992e3
8 changed files with 82 additions and 21 deletions

View File

@ -1 +1 @@
@font-size-base: 13px;
@font-size-base: 14px;

View File

@ -1,5 +1,7 @@
.build {
padding: 25px;
.clearfix;
padding: 15px;
margin-bottom: 3px;
&__in-progress {
background: lighten(@brand-info, 40%);
@ -7,4 +9,9 @@
&__done {
background: lighten(@brand-success, 50%);
}
&_info {
display: inline-block;
margin-right: 10px;
}
}

View File

@ -1,20 +1,48 @@
mixin statusText(build)
span #
span= build.id
span
if build.status === 'in-progress'
span current step is:
span= build.currentStep
span in progress
if build.status === 'queued'
span build queued
span queued
if build.status === 'done'
span build done
span done
- var build = this.props.build;
.build(class="build__#{build.status}")
.pull-right
span= build.project.name
div
a(href="javascript:void(0);", onClick=this.onBuildSelect(build.id), style={marginRight: '5px'}) show console
.build_header
+ statusText(build)
a.pull-right(href="javascript:void(0);", onClick=onBuildSelect(build.id), style={marginRight: '5px'}) show console output
span #
span= build.id
span
a(href="javascript:void(0)")= build.project.name
div
if build.scm
span.build_info
i.fa.fa-fw.fa-code-fork
span= build.scm.rev.id
span.build_info
i.fa.fa-fw.fa-comment-o
|
span= build.scm.rev.comment
if build.endDate
span.build_info
i.fa.fa-fw.fa-clock-o
| builded at
DateTime(date=new Date(build.createDate))
else
if build.startDate
span.build_info
i.fa.fa-fw.fa-clock-o
| started at
DateTime(date=new Date(build.createDate))
else
span.build_info
i.fa.fa-fw.fa-clock-o
| queued at
DateTime(date=new Date(build.createDate))

View File

@ -1,19 +1,20 @@
'use strict';
define([
'react', 'app/actions/build', 'templates/app/components/builds/item'
], function(React, BuildActions, template) {
'react', 'app/actions/build', 'templates/app/components/builds/item',
'app/components/common/index'
], function(React, BuildActions, template, CommonComponents) {
template = template.locals({
DateTime: CommonComponents.DateTime
});
console.log(CommonComponents.DateTime);
var Component = React.createClass({
onBuildSelect: function(buildId) {
console.log('on build select');
BuildActions.readConsoleOutput(buildId);
},
render: function() {
return template({
build: this.props.build,
onBuildSelect: this.onBuildSelect
});
}
render: template
});
return Component;

View File

@ -0,0 +1,15 @@
'use strict';
define([
'react',
'templates/app/components/common/dateTime/template'
], function(React, template) {
var Component = React.createClass({
propTypes: {
date: React.PropTypes.instanceOf(Date)
},
render: template
});
return Component;
});

View File

@ -0,0 +1 @@
span= this.props.date.toLocaleDateString() + ' ' + this.props.date.toLocaleTimeString()

View File

@ -0,0 +1,9 @@
'use strict';
define([
'./dateTime/index'
], function(DateTime) {
return {
DateTime: DateTime
};
});

View File

@ -1,7 +1,7 @@
'use strict';
define([
'react', 'app/actions/project', 'templates/app/components/projects/item'
'react', 'app/actions/project', 'templates/app/components/projects/item',
], function(React, ProjectActions, template) {
var Component = React.createClass({
onProjectSelect: function(projectName) {