35373-1.patch

Felix Schäfer, 2021-06-08 15:10

Download (1.09 KB)

View differences:

app/controllers/projects_controller.rb
235 235
    unless @project.archive
236 236
      flash[:error] = l(:error_can_not_archive_project)
237 237
    end
238
    redirect_to_referer_or admin_projects_path(:status => params[:status])
238
    redirect_to admin_projects_path(:status => params[:status])
239 239
  end
240 240

  
241 241
  def unarchive
app/views/projects/destroy.html.erb
26 26

  
27 27
<p>
28 28
  <%= submit_tag l(:button_delete) %>
29
  <% if User.current.admin? and !@project_to_destroy.archived? %>
30
    <%= link_to l(:button_archive), archive_project_path(@project_to_destroy), method: :post, class: 'btn' %>
31
  <% end %>
29 32
  <%= link_to l(:button_cancel), User.current.admin? ? admin_projects_path : projects_path %>
30 33
</p>
31 34
<% end %>