Project

General

Profile

Patch #32951 » issue_statuses_sortable.diff

issues sortable patch file - Anas Al Salah, 2020-02-04 21:12

View differences:

app/controllers/issue_statuses_controller.rb
before_action :require_admin_or_api_request, :only => :index
accept_api_auth :index
helper :sort
include SortHelper
def index
@issue_statuses = IssueStatus.sorted.to_a
sort_init 'name', 'asc'
sort_update %w(name position)
@issue_statuses = IssueStatus.order(sort_clause).to_a
respond_to do |format|
format.html { render :layout => false if request.xhr? }
format.api
app/views/issue_statuses/index.html.erb
<th><%=l(:field_done_ratio)%></th>
<% end %>
<th><%=l(:field_is_closed)%></th>
<th><%=l(:field_position)%></th>
<th></th>
</tr></thead>
<tbody>
......
<td><%= status.default_done_ratio %></td>
<% end %>
<td><%= checked_image status.is_closed? %></td>
<td><%= status.position %></td>
<td class="buttons">
<%= reorder_handle(status) %>
<%= delete_link issue_status_path(status) %>
app/views/issue_statuses/index.html.erb
<table class="list issue_statuses">
<thead><tr>
<th><%=l(:field_status)%></th>
<%= sort_header_tag('name', :caption => l(:field_name)) %>
<% if Issue.use_status_for_done_ratio? %>
<th><%=l(:field_done_ratio)%></th>
<% end %>
<th><%=l(:field_is_closed)%></th>
<th><%=l(:field_position)%></th>
<%= sort_header_tag('position', :caption => l(:field_position)) %>
<th></th>
</tr></thead>
<tbody>
(1-1/2)