diff options
Diffstat (limited to 'app/views/issues/index.html.erb')
-rw-r--r-- | app/views/issues/index.html.erb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 4c2caa7ff..beff2fef6 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -1,7 +1,7 @@ <div class="contextual"> <% if !@query.new_record? && @query.editable_by?(User.current) %> - <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %> - <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> + <%= link_to l(:button_edit), @query.project_id ? edit_project_query_path(:project_id => @query.project, :id => @query) : edit_query_path(@query), :class => 'icon icon-edit' %> + <%= link_to l(:button_delete), @query.project_id ? project_query_path(:project_id => @query.project, :id => @query) : query_path(@query), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> <% end %> </div> @@ -38,7 +38,7 @@ <%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %> <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> <% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %> - <%= link_to_function l(:button_save), "$('query_form').action='#{ url_for :controller => 'queries', :action => 'new', :project_id => @project }'; submit_query_form('query_form')", :class => 'icon icon-save' %> + <%= link_to_function l(:button_save), "$('query_form').action='#{ @project ? new_project_query_path(@project) : new_query_path }'; submit_query_form('query_form')", :class => 'icon icon-save' %> <% end %> </p> <% end %> |