From d53744bab7d7592358dacd3f1056c0d46d0c37fd Mon Sep 17 00:00:00 2001 From: Vladimir Polyakov Date: Sun, 10 May 2015 00:47:01 +0300 Subject: [PATCH] add rebuild project button --- static/js/app/components/builds/item.jade | 3 ++- static/js/app/components/builds/item.js | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/static/js/app/components/builds/item.jade b/static/js/app/components/builds/item.jade index 15e14db..61c8755 100644 --- a/static/js/app/components/builds/item.jade +++ b/static/js/app/components/builds/item.jade @@ -13,7 +13,8 @@ mixin statusText(build) .build(class="build__#{build.status}") .pull-right 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 span # span= build.id diff --git a/static/js/app/components/builds/item.js b/static/js/app/components/builds/item.js index 019e4f2..374d2e6 100644 --- a/static/js/app/components/builds/item.js +++ b/static/js/app/components/builds/item.js @@ -1,15 +1,19 @@ 'use strict'; 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' -], function(React, BuildActions, template, CommonComponents) { +], function(React, ProjectActions, BuildActions, template, CommonComponents) { template = template.locals({ DateTime: CommonComponents.DateTime }); console.log(CommonComponents.DateTime); var Component = React.createClass({ + onRebuildProject: function(projectName) { + ProjectActions.run(projectName) + }, onBuildSelect: function(buildId) { console.log('on build select'); BuildActions.readConsoleOutput(buildId);