To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / repositories / _related_issues.html.erb @ 1591:63650ae64bf2
History | View | Annotate | Download (1.68 KB)
| 1 | 1115:433d4f72a19b | Chris | <% manage_allowed = User.current.allowed_to?(:manage_related_issues, @repository.project) %>
|
|---|---|---|---|
| 2 | |||
| 3 | <div id="related-issues"> |
||
| 4 | <% if manage_allowed %>
|
||
| 5 | <div class="contextual"> |
||
| 6 | <%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'issue_id'} %>
|
||
| 7 | </div>
|
||
| 8 | <% end %>
|
||
| 9 | |||
| 10 | <h3><%= l(:label_related_issues) %></h3> |
||
| 11 | <ul>
|
||
| 12 | <% @changeset.issues.visible.each do |issue| %>
|
||
| 13 | <li id="<%= "related-issue-#{issue.id}" %>"><%= link_to_issue issue %> |
||
| 14 | <%= link_to(image_tag('link_break.png'),
|
||
| 15 | {:controller => 'repositories', :action => 'remove_related_issue',
|
||
| 16 | :id => @project, :repository_id => @repository.identifier_param,
|
||
| 17 | :rev => @changeset.identifier, :issue_id => issue},
|
||
| 18 | :remote => true,
|
||
| 19 | :method => :delete,
|
||
| 20 | :data => {:confirm => l(:text_are_you_sure)},
|
||
| 21 | :title => l(:label_relation_delete)) if manage_allowed %>
|
||
| 22 | </li>
|
||
| 23 | <% end %>
|
||
| 24 | </ul>
|
||
| 25 | |||
| 26 | <% if manage_allowed %>
|
||
| 27 | <%= form_for(@issue, :as => :issue, :remote => true,
|
||
| 28 | :url => {:controller => 'repositories', :action => 'add_related_issue',
|
||
| 29 | :id => @project, :repository_id => @repository.identifier_param,
|
||
| 30 | :rev => @changeset.identifier},
|
||
| 31 | :method => :post,
|
||
| 32 | :html => {:id => 'new-relation-form', :style => (@issue ? '' : 'display: none;')}) do |f| %>
|
||
| 33 | <%= l(:label_issue) %> #<%= text_field_tag 'issue_id', '', :size => 10 %> |
||
| 34 | <%= submit_tag l(:button_add) %>
|
||
| 35 | <%= toggle_link l(:button_cancel), 'new-relation-form'%>
|
||
| 36 | <% end %>
|
||
| 37 | <% end %>
|
||
| 38 | </div>
|
||
| 39 | |||
| 40 | <%= javascript_tag "observeAutocompleteField('issue_id', '#{escape_javascript auto_complete_issues_path(:project_id => @project, :scope => 'all')}')" %> |