Revision 1298:4f746d8966dd app/views/issues

View differences:

app/views/issues/_action_menu.html.erb
1 1
<div class="contextual">
2
<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
2
<%= link_to l(:button_update), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
3 3
<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue), :class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
4
<%= watcher_tag(@issue, User.current) %>
5
<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue}, :class => 'icon icon-copy' %>
4
<%= watcher_link(@issue, User.current) %>
5
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
6 6
<%= link_to l(:button_delete), issue_path(@issue), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'icon icon-del' if User.current.allowed_to?(:delete_issues, @project) %>
7 7
</div>
app/views/issues/_list.html.erb
9 9
                              :onclick => 'toggleIssuesSelection(this); return false;',
10 10
                              :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
11 11
      </th>
12
      <%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %>
13 12
      <% query.inline_columns.each do |column| %>
14 13
        <%= column_header(column) %>
15 14
      <% end %>
......
32 31
  <% end %>
33 32
  <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
34 33
    <td class="checkbox hide-when-print"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>
35
    <td class="id"><%= link_to issue.id, issue_path(issue) %></td>
36 34
    <%= raw query.inline_columns.map {|column| "<td class=\"#{column.css_classes}\">#{column_content(column, issue)}</td>"}.join %>
37 35
  </tr>
38 36
  <% @query.block_columns.each do |column|
39 37
       if (text = column_content(column, issue)) && text.present? -%>
40 38
  <tr class="<%= current_cycle %>">
41
    <td colspan="<%= @query.inline_columns.size + 2 %>" class="<%= column.css_classes %>"><%= text %></td>
39
    <td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>"><%= text %></td>
42 40
  </tr>
43 41
  <% end -%>
44 42
  <% end -%>
app/views/issues/_list_simple.html.erb
12 12
    <tr id="issue-<%= h(issue.id) %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
13 13
      <td class="id">
14 14
        <%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;', :id => nil) %>
15
        <%= link_to(h(issue.id), :controller => 'issues', :action => 'show', :id => issue) %>
15
        <%= link_to issue.id, issue_path(issue) %>
16 16
      </td>
17 17
      <td class="project"><%= link_to_project(issue.project) %></td>
18 18
      <td class="tracker"><%=h issue.tracker %></td>
19 19
      <td class="subject">
20
        <%= link_to h(truncate(issue.subject, :length => 60)), :controller => 'issues', :action => 'show', :id => issue %> (<%=h issue.status %>)
20
        <%= link_to truncate(issue.subject, :length => 60), issue_path(issue) %> (<%=h issue.status %>)
21 21
      </td>
22 22
    </tr>
23 23
    <% end %>
app/views/issues/_relations.html.erb
10 10
<form>
11 11
<table class="list issues">
12 12
<% @relations.each do |relation| %>
13
<tr class="issue hascontextmenu" id="relation-<%= relation.id %>">
14
<td class="checkbox"><%= check_box_tag("ids[]", relation.other_issue(@issue).id, false, :id => nil) %></td>
15
<td class="subject"><%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
16
    <%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
17
    <%= link_to_issue(relation.other_issue(@issue), :truncate => 60) %>
18
</td>
19
<td class="status"><%=h relation.other_issue(@issue).status.name %></td>
20
<td class="start_date"><%= format_date(relation.other_issue(@issue).start_date) %></td>
21
<td class="due_date"><%= format_date(relation.other_issue(@issue).due_date) %></td>
22
<td class="buttons"><%= link_to image_tag('link_break.png'),
23
                                {:controller => 'issue_relations', :action => 'destroy', :id => relation},
24
                                :remote => true,
25
                                :method => :delete,
26
                                :data => {:confirm => l(:text_are_you_sure)},
27
                                :title => l(:label_relation_delete) if User.current.allowed_to?(:manage_issue_relations, @project) %></td>
28
</tr>
13
  <% other_issue = relation.other_issue(@issue) -%>
14
  <tr class="issue hascontextmenu" id="relation-<%= relation.id %>">
15
  <td class="checkbox"><%= check_box_tag("ids[]", other_issue.id, false, :id => nil) %></td>
16
  <td class="subject">
17
    <%= l(relation.label_for(@issue)) %>
18
    <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
19
    <%= h(other_issue.project) + ' - ' if Setting.cross_project_issue_relations? %>
20
    <%= link_to_issue(other_issue, :truncate => 60) %>
21
  </td>
22
  <td class="status"><%=h other_issue.status.name %></td>
23
  <td class="start_date"><%= format_date(other_issue.start_date) %></td>
24
  <td class="due_date"><%= format_date(other_issue.due_date) %></td>
25
  <td class="buttons"><%= link_to image_tag('link_break.png'),
26
                                  relation_path(relation),
27
                                  :remote => true,
28
                                  :method => :delete,
29
                                  :data => {:confirm => l(:text_are_you_sure)},
30
                                  :title => l(:label_relation_delete) if User.current.allowed_to?(:manage_issue_relations, @project) %></td>
31
  </tr>
29 32
<% end %>
30 33
</table>
31 34
</form>
......
33 36

  
34 37
<%= form_for @relation, {
35 38
                 :as => :relation, :remote => true,
36
                 :url => {:controller => 'issue_relations', :action => 'create', :issue_id => @issue},
39
                 :url => issue_relations_path(@issue),
37 40
                 :method => :post,
38 41
                 :html => {:id => 'new-relation-form', :style => (@relation ? '' : 'display: none;')}
39 42
               } do |f| %>
app/views/issues/_sidebar.html.erb
1 1
<h3><%= l(:label_issue_plural) %></h3>
2
<%= link_to l(:label_issue_view_all), { :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 } %><br />
2
<%= link_to l(:label_issue_view_all), _project_issues_path(@project, :set_filter => 1) %><br />
3 3
<% if @project %>
4
<%= link_to l(:field_summary), :controller => 'reports', :action => 'issue_report', :id => @project %><br />
4
<%= link_to l(:field_summary), project_issues_report_path(@project) %><br />
5 5
<% end %>
6 6
<%= call_hook(:view_issues_sidebar_issues_bottom) %>
7 7

  
8 8
<% if User.current.allowed_to?(:view_calendar, @project, :global => true) %>
9
  <%= link_to(l(:label_calendar), :controller => 'calendars', :action => 'show', :project_id => @project) %><br />
9
  <%= link_to l(:label_calendar), _project_calendar_path(@project) %><br />
10 10
<% end %>
11 11
<% if User.current.allowed_to?(:view_gantt, @project, :global => true) %>
12
  <%= link_to(l(:label_gantt), :controller => 'gantts', :action => 'show', :project_id => @project) %><br />
12
  <%= link_to l(:label_gantt), _project_gantt_path(@project) %><br />
13 13
<% end %>
14 14
<%= call_hook(:view_issues_sidebar_planning_bottom) %>
15 15

  
app/views/issues/_update_form.js.erb
1
$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>');
2

  
3
<% if User.current.allowed_to?(:log_time, @issue.project) %>
4
  $('#log_time').show();
5
<% else %>
6
  $('#log_time').hide();
7
<% end %>
app/views/issues/bulk_edit.html.erb
1 1
<h2><%= @copy ? l(:button_copy) : l(:label_bulk_edit_selected_issues) %></h2>
2 2

  
3
<ul><%= @issues.collect {|i|
4
            content_tag('li',
5
                        link_to(h("#{i.tracker} ##{i.id}"),
6
                                { :action => 'show', :id => i }
7
                            ) + h(": #{i.subject}"))
8
         }.join("\n").html_safe %></ul>
3
<ul id="bulk-selection">
4
<% @issues.each do |issue| %>
5
  <%= content_tag 'li', link_to_issue(issue) %>
6
<% end %>
7
</ul>
9 8

  
10
<%= form_tag({:action => 'bulk_update'}, :id => 'bulk_edit_form') do %>
9
<%= form_tag(bulk_update_issues_path, :id => 'bulk_edit_form') do %>
11 10
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id)}.join("\n").html_safe %>
12 11
<div class="box tabular">
13 12
<fieldset class="attributes">
app/views/issues/index.api.rsb
23 23

  
24 24
      api.created_on issue.created_on
25 25
      api.updated_on issue.updated_on
26
      api.closed_on  issue.closed_on
26 27

  
27 28
      api.array :relations do
28 29
        issue.relations.each do |relation|
app/views/issues/index.html.erb
24 24
        <table>
25 25
          <tr>
26 26
            <td><%= l(:field_column_names) %></td>
27
            <td><%= render :partial => 'queries/columns', :locals => {:query => @query} %></td>
27
            <td><%= render_query_columns_selection(@query) %></td>
28 28
          </tr>
29 29
          <tr>
30 30
            <td><label for='group_by'><%= l(:field_group_by) %></label></td>
app/views/issues/show.api.rsb
22 22

  
23 23
  api.created_on @issue.created_on
24 24
  api.updated_on @issue.updated_on
25
  api.closed_on @issue.closed_on
25 26

  
26 27
  render_api_issue_children(@issue, api) if include_in_api_response?('children')
27 28

  
......
64 65
      end
65 66
    end
66 67
  end if include_in_api_response?('journals')
68

  
69
  api.array :watchers do
70
    @issue.watcher_users.each do |user|
71
      api.user :id => user.id, :name => user.name
72
    end
73
  end if include_in_api_response?('watchers') && User.current.allowed_to?(:view_issue_watchers, @issue.project)
67 74
end
app/views/issues/show.html.erb
61 61
    end
62 62
  end
63 63
  if User.current.allowed_to?(:view_time_entries, @project)
64
    rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? (link_to l_hours(@issue.total_spent_hours), {:controller => 'timelog', :action => 'index', :project_id => @project, :issue_id => @issue}) : "-"), :class => 'spent-time'
64
    rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), project_issue_time_entries_path(@project, @issue)) : "-"), :class => 'spent-time'
65 65
  end
66 66
end %>
67 67
<%= render_custom_fields_rows(@issue) %>
......
73 73
<% if @issue.description? %>
74 74
<div class="description">
75 75
  <div class="contextual">
76
  <%= link_to l(:button_quote),
77
              {:controller => 'journals', :action => 'new', :id => @issue},
78
              :remote => true,
79
              :method => 'post',
80
              :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
76
  <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
81 77
  </div>
82 78

  
83 79
  <p><strong><%=l(:field_description)%></strong></p>
......
130 126
<%= render :partial => 'action_menu' %>
131 127

  
132 128
<div style="clear: both;"></div>
133
<% if authorize_for('issues', 'edit') %>
129
<% if @issue.editable? %>
134 130
  <div id="update" style="display:none;">
135 131
  <h3><%= l(:button_update) %></h3>
136 132
  <%= render :partial => 'edit' %>
app/views/issues/update_form.js.erb
1
$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>');
2

  
3
<% if User.current.allowed_to?(:log_time, @issue.project) %>
4
  $('#log_time').show();
5
<% else %>
6
  $('#log_time').hide();
7
<% end %>

Also available in: Unified diff