/** @jsx React.DOM */
/* scrumli --- A simple scrum web application
Copyright (C) 2013 Tom Willemse
scrumli is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
scrumli is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with scrumli. If not, see . */
var StateIcon = React.createClass({
render: function() {
var icon_names = {"TODO": "icon-check-empty",
"DOING": "icon-sign-blank",
"DONE": "icon-check"};
return ;
}
});
var AssigneeIcon = React.createClass({
render: function() {
var icon;
if (this.props.assignee)
icon = ;
else
icon = ;
return icon;
}
});
var StoryTaskRow = React.createClass({
changeState: React.autoBind(function(event) {
$.post("/tasks/state", {'id': this.props.task.id})
.done(function (data, textStatus, jqXHR) {
if (data.status == "ok")
this.setState({state: data.state});
}.bind(this));
}),
getInitialState: function () {
return {state: this.props.task.state};
},
moveUp: React.autoBind(function(event) {
$.post("/tasks/up", {'id': this.props.task.id})
.done(function (data) {
if (data.status == "ok")
this.props.onMoved(1);
}.bind(this));
}),
moveDown: React.autoBind(function(event) {
$.post("/tasks/down", {'id': this.props.task.id})
.done(function (data) {
if (data.status == "ok")
this.props.onMoved(-1);
}.bind(this));
}),
handleAssigneeClick: React.autoBind(function(event) {
this.props.onAssigneeClicked({url: "/tasks/assignee",
id: this.props.task.id,
assignee: this.props.task.assignee,
md5: this.props.task.md5});
}),
render: function() {
return (