2012-02-05 14:56:27 +04:00
|
|
|
<% manage_allowed = User.current.allowed_to?(:manage_related_issues, @repository.project) %>
|
|
|
|
|
|
|
|
<div id="related-issues">
|
|
|
|
<% if manage_allowed %>
|
|
|
|
<div class="contextual">
|
|
|
|
<%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'issue_id'} %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<h3><%= l(:label_related_issues) %></h3>
|
|
|
|
<ul>
|
|
|
|
<% @changeset.issues.visible.each do |issue| %>
|
|
|
|
<li id="<%= "related-issue-#{issue.id}" %>"><%= link_to_issue issue %>
|
2012-07-18 20:31:36 +04:00
|
|
|
<%= link_to(image_tag('link_break.png'),
|
|
|
|
{:controller => 'repositories', :action => 'remove_related_issue',
|
|
|
|
:id => @project, :repository_id => @repository.identifier_param,
|
|
|
|
:rev => @changeset.identifier, :issue_id => issue},
|
|
|
|
:remote => true,
|
|
|
|
:method => :delete,
|
|
|
|
:data => {:confirm => l(:text_are_you_sure)},
|
|
|
|
:title => l(:label_relation_delete)) if manage_allowed %>
|
2012-02-05 14:56:27 +04:00
|
|
|
</li>
|
|
|
|
<% end %>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<% if manage_allowed %>
|
2012-04-29 06:43:42 +04:00
|
|
|
<%= form_for(@issue, :as => :issue, :remote => true,
|
2012-02-06 03:51:26 +04:00
|
|
|
:url => {:controller => 'repositories', :action => 'add_related_issue',
|
|
|
|
:id => @project, :repository_id => @repository.identifier_param,
|
|
|
|
:rev => @changeset.identifier},
|
2012-02-05 14:56:27 +04:00
|
|
|
:method => :post,
|
|
|
|
:html => {:id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')}) do |f| %>
|
|
|
|
<%= l(:label_issue) %> #<%= text_field_tag 'issue_id', '', :size => 10 %>
|
|
|
|
<%= submit_tag l(:button_add) %>
|
|
|
|
<%= toggle_link l(:button_cancel), 'new-relation-form'%>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2012-08-09 20:46:13 +04:00
|
|
|
|
|
|
|
<%= javascript_tag "observeAutocompleteField('issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => 'all')}')" %>
|