Feature #3319 » add_copy_query.diff
| app/controllers/queries_controller.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
end
|
||
|
|
||
|
def copy
|
||
|
@query.name = "Copy of " + @query.name
|
||
|
end
|
||
|
def destroy
|
||
|
@query.destroy if request.post?
|
||
| app/views/issues/index.rhtml | ||
|---|---|---|
|
<div class="contextual">
|
||
|
<% 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_copy), {:controller => 'queries', :action => 'copy', :id => @query}, :class => 'icon icon-copy' %>
|
||
|
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
||
|
<% end %>
|
||
|
</div>
|
||
| app/views/queries/copy.rhtml | ||
|---|---|---|
|
<h2><%= l(:label_query_copy) %></h2>
|
||
|
<% form_tag({:action => 'new', :project_id => @query.project}, :onsubmit => 'selectAllOptions("selected_columns");') do %>
|
||
|
<%= render :partial => 'form', :locals => {:query => @query} %>
|
||
|
<%= submit_tag l(:button_save) %>
|
||
|
<% end %>
|
||
| config/locales/en.yml | ||
|---|---|---|
|
label_query: Custom query
|
||
|
label_query_plural: Custom queries
|
||
|
label_query_new: New query
|
||
|
label_query_copy: New cloned query
|
||
|
label_filter_add: Add filter
|
||
|
label_filter_plural: Filters
|
||
|
label_equals: is
|
||