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