Project

General

Profile

Defect #36335 ยป workflow_edit_filter_statuses.patch

Add filter box to show only selected statuses when editing workflow - salman mp, 2021-12-19 15:46

View differences:

config/locales/en.yml (revision ec859e41d689ee3432113c3bd74ba48d060c9a2f) โ†’ config/locales/en.yml (date 1639924497873)
1190 1190
  text_project_destroy_confirmation: Are you sure you want to delete this project and related data?
1191 1191
  text_subprojects_destroy_warning: "Its subproject(s): %{value} will be also deleted."
1192 1192
  text_workflow_edit: Select a role and a tracker to edit the workflow
1193
  text_only_selected_status: Only show this status(es)
1193 1194
  text_are_you_sure: Are you sure?
1194 1195
  text_journal_changed: "%{label} changed from %{old} to %{new}"
1195 1196
  text_journal_changed_no_detail: "%{label} updated"
app/views/workflows/_form.html.erb (revision ec859e41d689ee3432113c3bd74ba48d060c9a2f) โ†’ app/views/workflows/_form.html.erb (date 1639922274335)
1
<% @statuses.select!{|s| params[:ss].include? s.id.to_s} if params[:ss] %>
1 2
<table class="list workflows transitions transitions-<%= name %>">
2 3
<thead>
3 4
  <tr>
app/views/workflows/edit.html.erb (revision ec859e41d689ee3432113c3bd74ba48d060c9a2f) โ†’ app/views/workflows/edit.html.erb (date 1639924497857)
29 29
  <label><%= check_box_tag 'used_statuses_only', '1', @used_statuses_only %> <%= l(:label_display_used_statuses_only) %></label>
30 30

  
31 31
</p>
32
  <fieldset class="box collapsible collapsed">
33
    <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:text_only_selected_status) %></legend>
34
    <div id="selected-statuses" style="height:10em; max-height: 20em; overflow-y:auto; display: none">
35
      <%= link_to_function('', "toggleCheckboxesBySelector('#selected-statuses input[type=checkbox]:not(:disabled)')",
36
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
37
                           :class => 'no-tooltip icon-only icon-checked') %>
38
      <%= "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
39
      <% IssueStatus.sorted.each do |status| %>
40
        <label class="block">
41
          <%= check_box_tag "ss[]", status.id, params[:ss] && params[:ss].include?(status.id.to_s) %>
42
          <%= status.name %>
43
        </label>
44
      <% end %>
45
    </div>
46
  </fieldset>
32 47
<% end %>
33 48

  
34 49
<% if @trackers && @roles && @statuses.any? %>
    (1-1/1)