summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 10:30:42 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-22 10:30:42 +0000
commitbda9b98a562eba802e00781c355cbade50f3d267 (patch)
tree6a11abfde7b80e67607d75c28d4d3ff850787d38 /app/views
parentcd437b7e1dd3f2772bd712f543ce33ee16a4eff6 (diff)
downloadredmine-bda9b98a562eba802e00781c355cbade50f3d267.tar.gz
redmine-bda9b98a562eba802e00781c355cbade50f3d267.zip
Code cleanup, use named routes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11068 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/_action_menu.html.erb4
-rw-r--r--app/views/issues/_list_simple.html.erb4
-rw-r--r--app/views/issues/show.html.erb10
3 files changed, 7 insertions, 11 deletions
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb
index 69c0e2c1e..aade33970 100644
--- a/app/views/issues/_action_menu.html.erb
+++ b/app/views/issues/_action_menu.html.erb
@@ -1,7 +1,7 @@
<div class="contextual">
-<%= 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)) %>
+<%= 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? %>
<%= 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) %>
<%= watcher_tag(@issue, User.current) %>
-<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue}, :class => 'icon icon-copy' %>
+<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %>
<%= 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) %>
</div>
diff --git a/app/views/issues/_list_simple.html.erb b/app/views/issues/_list_simple.html.erb
index ae34000f1..0e4aa0731 100644
--- a/app/views/issues/_list_simple.html.erb
+++ b/app/views/issues/_list_simple.html.erb
@@ -12,12 +12,12 @@
<tr id="issue-<%= h(issue.id) %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
<td class="id">
<%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;', :id => nil) %>
- <%= link_to(h(issue.id), :controller => 'issues', :action => 'show', :id => issue) %>
+ <%= link_to issue.id, issue_path(issue) %>
</td>
<td class="project"><%= link_to_project(issue.project) %></td>
<td class="tracker"><%=h issue.tracker %></td>
<td class="subject">
- <%= link_to h(truncate(issue.subject, :length => 60)), :controller => 'issues', :action => 'show', :id => issue %> (<%=h issue.status %>)
+ <%= link_to truncate(issue.subject, :length => 60), issue_path(issue) %> (<%=h issue.status %>)
</td>
</tr>
<% end %>
diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb
index c41b7b790..83b4f56ed 100644
--- a/app/views/issues/show.html.erb
+++ b/app/views/issues/show.html.erb
@@ -61,7 +61,7 @@
end
end
if User.current.allowed_to?(:view_time_entries, @project)
- 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'
+ 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'
end
end %>
<%= render_custom_fields_rows(@issue) %>
@@ -73,11 +73,7 @@ end %>
<% if @issue.description? %>
<div class="description">
<div class="contextual">
- <%= link_to l(:button_quote),
- {:controller => 'journals', :action => 'new', :id => @issue},
- :remote => true,
- :method => 'post',
- :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
+ <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
</div>
<p><strong><%=l(:field_description)%></strong></p>
@@ -130,7 +126,7 @@ end %>
<%= render :partial => 'action_menu' %>
<div style="clear: both;"></div>
-<% if authorize_for('issues', 'edit') %>
+<% if @issue.editable? %>
<div id="update" style="display:none;">
<h3><%= l(:button_update) %></h3>
<%= render :partial => 'edit' %>