@@ -1,38 +1,40 | |||
|
1 | 1 | <% manage_allowed = User.current.allowed_to?(:manage_related_issues, @repository.project) %> |
|
2 | 2 | |
|
3 | 3 | <div id="related-issues"> |
|
4 | 4 | <% if manage_allowed %> |
|
5 | 5 | <div class="contextual"> |
|
6 | 6 | <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'issue_id'} %> |
|
7 | 7 | </div> |
|
8 | 8 | <% end %> |
|
9 | 9 | |
|
10 | 10 | <h3><%= l(:label_related_issues) %></h3> |
|
11 | 11 | <ul> |
|
12 | 12 | <% @changeset.issues.visible.each do |issue| %> |
|
13 | 13 | <li id="<%= "related-issue-#{issue.id}" %>"><%= link_to_issue issue %> |
|
14 | 14 | <%= link_to(image_tag('link_break.png'), |
|
15 | 15 | {:controller => 'repositories', :action => 'remove_related_issue', |
|
16 | 16 | :id => @project, :repository_id => @repository.identifier_param, |
|
17 | 17 | :rev => @changeset.identifier, :issue_id => issue}, |
|
18 | 18 | :remote => true, |
|
19 | 19 | :method => :delete, |
|
20 | 20 | :data => {:confirm => l(:text_are_you_sure)}, |
|
21 | 21 | :title => l(:label_relation_delete)) if manage_allowed %> |
|
22 | 22 | </li> |
|
23 | 23 | <% end %> |
|
24 | 24 | </ul> |
|
25 | 25 | |
|
26 | 26 | <% if manage_allowed %> |
|
27 | 27 | <%= form_for(@issue, :as => :issue, :remote => true, |
|
28 | 28 | :url => {:controller => 'repositories', :action => 'add_related_issue', |
|
29 | 29 | :id => @project, :repository_id => @repository.identifier_param, |
|
30 | 30 | :rev => @changeset.identifier}, |
|
31 | 31 | :method => :post, |
|
32 | 32 | :html => {:id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')}) do |f| %> |
|
33 | 33 | <%= l(:label_issue) %> #<%= text_field_tag 'issue_id', '', :size => 10 %> |
|
34 | 34 | <%= submit_tag l(:button_add) %> |
|
35 | 35 | <%= toggle_link l(:button_cancel), 'new-relation-form'%> |
|
36 | 36 | <% end %> |
|
37 | 37 | <% end %> |
|
38 | 38 | </div> |
|
39 | ||
|
40 | <%= javascript_tag "observeAutocompleteField('issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => 'all')}')" %> |
General Comments 0
You need to be logged in to leave comments.
Login now