Mercurial > hg > soundsoftware-site
comparison app/controllers/issue_relations_controller.rb @ 511:107d36338b70 live
Merge from branch "cannam"
author | Chris Cannam |
---|---|
date | Thu, 14 Jul 2011 10:43:07 +0100 |
parents | 0c939c159af4 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
451:a9f6345cb43d | 511:107d36338b70 |
---|---|
1 # redMine - project management software | 1 # Redmine - project management software |
2 # Copyright (C) 2006-2007 Jean-Philippe Lang | 2 # Copyright (C) 2006-2007 Jean-Philippe Lang |
3 # | 3 # |
4 # This program is free software; you can redistribute it and/or | 4 # This program is free software; you can redistribute it and/or |
5 # modify it under the terms of the GNU General Public License | 5 # modify it under the terms of the GNU General Public License |
6 # as published by the Free Software Foundation; either version 2 | 6 # as published by the Free Software Foundation; either version 2 |
26 end | 26 end |
27 @relation.save if request.post? | 27 @relation.save if request.post? |
28 respond_to do |format| | 28 respond_to do |format| |
29 format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } | 29 format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } |
30 format.js do | 30 format.js do |
31 @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
31 render :update do |page| | 32 render :update do |page| |
32 page.replace_html "relations", :partial => 'issues/relations' | 33 page.replace_html "relations", :partial => 'issues/relations' |
33 if @relation.errors.empty? | 34 if @relation.errors.empty? |
34 page << "$('relation_delay').value = ''" | 35 page << "$('relation_delay').value = ''" |
35 page << "$('relation_issue_to_id').value = ''" | 36 page << "$('relation_issue_to_id').value = ''" |
45 relation.destroy | 46 relation.destroy |
46 @issue.reload | 47 @issue.reload |
47 end | 48 end |
48 respond_to do |format| | 49 respond_to do |format| |
49 format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } | 50 format.html { redirect_to :controller => 'issues', :action => 'show', :id => @issue } |
50 format.js { render(:update) {|page| page.replace_html "relations", :partial => 'issues/relations'} } | 51 format.js { |
52 @relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? } | |
53 render(:update) {|page| page.replace_html "relations", :partial => 'issues/relations'} | |
54 } | |
51 end | 55 end |
52 end | 56 end |
53 | 57 |
54 private | 58 private |
55 def find_issue | 59 def find_issue |