Permalink
Browse files

Fixes #1562 issue status are editabe using dropdown menu instead of text

  • Loading branch information...
1 parent 6478fca commit 0382962526507c236687ca22759ec0bbe45c2b76 Mohamed Magdy committed Feb 7, 2012
@@ -61,7 +61,7 @@ def scrum_column_content(column, issue)
when :finished
IssueStatus.find_by_scrummer_caption(:finished).short_name.upcase
end
- "<div align='center' class='edit status #{value.scrummer_caption}' id='issue-#{issue.id}-status'>" + content.to_s + "</div>"
+ "<div align='center' class='status #{value.scrummer_caption}' id='issue-#{issue.id}-status'>" + content.to_s + "</div>"
elsif column.name == :subject
prefix = if issue.direct_children.blank?
"<span>&nbsp;&nbsp;</span>"
@@ -239,4 +239,13 @@ def update_issue_and_parents(page)
page.replace 'issue-' + parent.id.to_s, :partial => "issue_row", :locals => {:issue => parent, :hierarchy => params[:hierarchy] == "true", :query => @query, :level => level, :list_id => params[:list_id], :from_sprint => params[:from_sprint]}
end
end
+
+ def issue_allowed_statuses(issue)
+ statuses = "{"
+ issue.new_statuses_allowed_to(User.current).each do |status|
+ statuses += "'" + status.short_name + "':'" + status.name + "', "
+ end
+ statuses += "'selected':'" + issue.status.short_name + "'}"
+ statuses
+ end
end
@@ -38,4 +38,5 @@
<script>
initialize_editable();
+ initialize_status_editable("<%= issue_allowed_statuses(issue) %>");
</script>
@@ -53,6 +53,20 @@
ignoreResponse: true
});
}
+
+ function initialize_status_editable(data){
+ $j('.status').editable('<%= url_for :controller => :scrum_userstories, :action => :update_single_field, :params => {:project_id => @project.id, :hierarchy => hierarchy, :query => query, :list_id => list_id, :from_sprint => from_sprint}%>',
+ {
+ onblur : 'submit',
+ submitdata : {
+ authenticity_token : '<%= form_authenticity_token %>'
+ },
+ indicator : '<%= image_tag 'loading.gif'%>' ,
+ data: data,
+ type: 'select',
+ ignoreResponse: true
+ });
+ }
</script>
<% form_tag('', {:id => 'context_menu_form'}) do -%>

0 comments on commit 0382962

Please sign in to comment.