Always instanciate a relation.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11610 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-03-12 18:35:59 +00:00
parent 6d20cfe831
commit 83d7761998
3 changed files with 4 additions and 1 deletions

View File

@ -113,6 +113,8 @@ class IssuesController < ApplicationController
@edit_allowed = User.current.allowed_to?(:edit_issues, @project) @edit_allowed = User.current.allowed_to?(:edit_issues, @project)
@priorities = IssuePriority.active @priorities = IssuePriority.active
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
@relation = IssueRelation.new
respond_to do |format| respond_to do |format|
format.html { format.html {
retrieve_previous_and_next_issue_ids retrieve_previous_and_next_issue_ids

View File

@ -4,3 +4,4 @@ $('#relations').html('<%= escape_javascript(render :partial => 'issues/relations
$('#relation_issue_to_id').val(''); $('#relation_issue_to_id').val('');
$('#relation_issue_to_id').focus(); $('#relation_issue_to_id').focus();
<% end %> <% end %>
$('#new-relation-form').show();

View File

@ -38,7 +38,7 @@
:as => :relation, :remote => true, :as => :relation, :remote => true,
:url => issue_relations_path(@issue), :url => issue_relations_path(@issue),
:method => :post, :method => :post,
:html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')} :html => {:id => 'new-relation-form', :style => 'display: none;'}
} do |f| %> } do |f| %>
<%= render :partial => 'issue_relations/form', :locals => {:f => f}%> <%= render :partial => 'issue_relations/form', :locals => {:f => f}%>
<% end %> <% end %>