From 83d77619982694ed0eada9eacb04897be5ce18c2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Tue, 12 Mar 2013 18:35:59 +0000 Subject: [PATCH] Always instanciate a relation. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11610 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/issues_controller.rb | 2 ++ app/views/issue_relations/create.js.erb | 1 + app/views/issues/_relations.html.erb | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index fb1c5765f..e1faa9b6b 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -113,6 +113,8 @@ class IssuesController < ApplicationController @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @priorities = IssuePriority.active @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) + @relation = IssueRelation.new + respond_to do |format| format.html { retrieve_previous_and_next_issue_ids diff --git a/app/views/issue_relations/create.js.erb b/app/views/issue_relations/create.js.erb index 03ba21975..0c2e036cc 100644 --- a/app/views/issue_relations/create.js.erb +++ b/app/views/issue_relations/create.js.erb @@ -4,3 +4,4 @@ $('#relations').html('<%= escape_javascript(render :partial => 'issues/relations $('#relation_issue_to_id').val(''); $('#relation_issue_to_id').focus(); <% end %> +$('#new-relation-form').show(); diff --git a/app/views/issues/_relations.html.erb b/app/views/issues/_relations.html.erb index 0cffa8f53..049d6f350 100644 --- a/app/views/issues/_relations.html.erb +++ b/app/views/issues/_relations.html.erb @@ -38,7 +38,7 @@ :as => :relation, :remote => true, :url => issue_relations_path(@issue), :method => :post, - :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')} + :html => {:id => 'new-relation-form', :style => 'display: none;'} } do |f| %> <%= render :partial => 'issue_relations/form', :locals => {:f => f}%> <% end %>