add rebuild project button

This commit is contained in:
Vladimir Polyakov 2015-05-10 00:47:01 +03:00
parent 399e0992e3
commit d53744bab7
2 changed files with 8 additions and 3 deletions

View File

@ -13,7 +13,8 @@ mixin statusText(build)
.build(class="build__#{build.status}") .build(class="build__#{build.status}")
.pull-right .pull-right
div div
a(href="javascript:void(0);", onClick=this.onBuildSelect(build.id), style={marginRight: '5px'}) show console a(href="javascript:void(0);", onClick=this.onBuildSelect(build.id), style={marginRight: '5px'})
i.fa.fa-2x.fa-repeat(title="Rebuild", style={marginTop: '5px'}, onClick=this.onRebuildProject(build.project.name))
.build_header .build_header
span # span #
span= build.id span= build.id

View File

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