summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-12 18:35:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-03-12 18:35:59 +0000
commit83d77619982694ed0eada9eacb04897be5ce18c2 (patch)
tree58e88fb079245aa001351346a59f27d82f2634a8
parent6d20cfe831aef5f7487e10a74dbb15ad623d651a (diff)
downloadredmine-83d77619982694ed0eada9eacb04897be5ce18c2.tar.gz
redmine-83d77619982694ed0eada9eacb04897be5ce18c2.zip
Always instanciate a relation.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11610 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/controllers/issues_controller.rb2
-rw-r--r--app/views/issue_relations/create.js.erb1
-rw-r--r--app/views/issues/_relations.html.erb2
3 files changed, 4 insertions, 1 deletions
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 %>