1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-24 17:31:14 +00:00
redmine/app/views/projects/_list.html.erb
Marius Balteanu 883aa3b5cc Background job for project deletion (#36691).
Due to the deletion of dependent objects (issues etc), project deletion may take a long time.

This patch moves the actual project deletion into an ActiveJob job. It also introduces a new project status (SCHEDULED_FOR_DELETION) that is used to effectively hide the project that is about to be deleted (and any potential descendant projects) from the system immediately.

A security notification is sent out to the user that deleted the project, informing about success / failure.

The projects list is extended to be able to filter for the new status, so in case of a failure, the project can still be accessed for examination.

Patch by Jens Krämer.


git-svn-id: https://svn.redmine.org/redmine/trunk@21591 e93f8b46-1217-0410-a6f0-8f06a7374b81
2022-05-17 20:45:41 +00:00

76 lines
3.1 KiB
Plaintext

<% @admin_list = User.current.admin? && controller_name == 'admin' && action_name == 'projects' %>
<%= render_query_totals(@query) %>
<%= form_tag({}, data: {cm_url: projects_context_menu_path}) do -%>
<%= hidden_field_tag 'back_url', url_for(params: request.query_parameters), id: nil %>
<div class="autoscroll">
<table class="list projects odd-even <%= @query.css_classes %>">
<thead>
<tr>
<% if @admin_list %>
<th class="checkbox hide-when-print">
<input type="checkbox" name="check_all" id="check_all" value="" class="toggle-selection" title="Check all/Uncheck all">
</th>
<% end %>
<% @query.inline_columns.each do |column| %>
<%= column_header(@query, column) %>
<% end %>
<% if @admin_list %>
<th></th>
<% end %>
</tr>
</thead>
<tbody>
<% grouped_project_list(entries, @query) do |entry, level, group_name, group_count, group_totals| -%>
<% if group_name %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= @query.inline_columns.size %>">
<span class="expander icon icon-expanded" onclick="toggleRowGroup(this);">&nbsp;</span>
<span class="name"><%= group_name %></span>
<% if group_count %>
<span class="count"><%= group_count %></span>
<% end %>
<span class="totals"><%= group_totals %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
<% if @admin_list %>
<td></td>
<% end %>
</tr>
<% end %>
<tr id="project-<%= entry.id %>" class="<%= cycle('odd', 'even') %> hascontextmenu <%= entry.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<% if @admin_list && !entry.scheduled_for_deletion? %>
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", entry.id, false, :id => nil) %></td>
<% end %>
<% @query.inline_columns.each do |column| %>
<%= content_tag('td', column_content(column, entry), :class => column.css_classes) %>
<% end %>
<% if @admin_list && !entry.scheduled_for_deletion? %>
<td class="buttons"><%= link_to_context_menu %></td>
<% end %>
</tr>
<% end -%>
</tbody>
</table>
</div>
<% end -%>
<span class="pagination"><%= pagination_links_full @entry_pages, @entry_count %></span>
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(projects_path(:format => 'csv'), :method => :get, :id => 'csv-export-form') do %>
<%= query_as_hidden_field_tags(@query) %>
<p>
<label><%= radio_button_tag 'c[]', '', true %> <%= l(:description_selected_columns) %></label><br />
<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
</p>
<%= export_csv_encoding_select_tag %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %>
<%= link_to_function l(:button_cancel), "hideModal(this);" %>
</p>
<% end %>
</div>
<%= context_menu if @admin_list %>