From 8f96f0c40d8032e4787f2548e0f0fd7da7e36a07 Mon Sep 17 00:00:00 2001 From: Etienne Massip Date: Mon, 24 Oct 2011 20:19:26 +0000 Subject: Refactor : convert queries to REST resources (also fixes #9108). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7649 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/queries/_form.html.erb | 1 - app/views/queries/edit.html.erb | 2 +- app/views/queries/index.html.erb | 6 +++--- app/views/queries/new.html.erb | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) (limited to 'app/views/queries') diff --git a/app/views/queries/_form.html.erb b/app/views/queries/_form.html.erb index 2d9d81d28..806944359 100644 --- a/app/views/queries/_form.html.erb +++ b/app/views/queries/_form.html.erb @@ -1,5 +1,4 @@ <%= error_messages_for 'query' %> -<%= hidden_field_tag 'confirm', 1 %>
diff --git a/app/views/queries/edit.html.erb b/app/views/queries/edit.html.erb index 1c99ac077..46a530f16 100644 --- a/app/views/queries/edit.html.erb +++ b/app/views/queries/edit.html.erb @@ -1,6 +1,6 @@

<%= l(:label_query) %>

-<% form_tag({:action => 'edit', :id => @query}, :onsubmit => 'selectAllOptions("selected_columns");') do %> +<% form_tag(@query.project_id ? project_query_path(:project_id => @query.project, :id => @query) : query_path(@query), :onsubmit => 'selectAllOptions("selected_columns");', :method => :put) do %> <%= render :partial => 'form', :locals => {:query => @query} %> <%= submit_tag l(:button_save) %> <% end %> diff --git a/app/views/queries/index.html.erb b/app/views/queries/index.html.erb index 066f30edb..b03ac6216 100644 --- a/app/views/queries/index.html.erb +++ b/app/views/queries/index.html.erb @@ -1,5 +1,5 @@
-<%= link_to_if_authorized l(:label_query_new), {:controller => 'queries', :action => 'new', :project_id => @project}, :class => 'icon icon-add' %> +<%= link_to_if_authorized l(:label_query_new), new_project_query_path(:project_id => @project), :class => 'icon icon-add' %>

<%= l(:label_query_plural) %>

@@ -16,8 +16,8 @@ <% if 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), edit_query_path(query), :class => 'icon icon-edit' %> + <%= link_to l(:button_delete), query_path(query), :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %> <% end %> diff --git a/app/views/queries/new.html.erb b/app/views/queries/new.html.erb index a980d04ab..b5809fb88 100644 --- a/app/views/queries/new.html.erb +++ b/app/views/queries/new.html.erb @@ -1,6 +1,6 @@

<%= l(:label_query_new) %>

-<% form_tag({:action => 'new', :project_id => @query.project}, :onsubmit => 'selectAllOptions("selected_columns");') do %> +<% form_tag(@project ? project_queries_path(:project_id => @project) : queries_path, :onsubmit => 'selectAllOptions("selected_columns");') do %> <%= render :partial => 'form', :locals => {:query => @query} %> <%= submit_tag l(:button_save) %> <% end %> -- cgit v1.2.3