feature-14508.patch

Mizuki ISHIKAWA, 2021-07-09 06:46

Download (10.4 KB)

View differences:

app/views/workflows/_form.html.erb
1 1
<table class="list workflows transitions transitions-<%= name %>">
2 2
<thead>
3
  <tr>
4
    <th>
3
  <tr class='fixed-row'>
4
    <th class='fixed-column'>
5 5
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled)')",
6 6
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
7 7
                           :class => 'no-tooltip icon-only icon-checked') %>
......
9 9
    </th>
10 10
    <th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
11 11
  </tr>
12
  <tr>
13
    <td></td>
12
  <tr class='fixed-row status'>
13
    <td class='fixed-column'></td>
14 14
    <% for new_status in @statuses %>
15 15
    <td style="width:<%= 75 / @statuses.size %>%;">
16 16
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}')",
......
26 26
  <% for old_status in [nil] + @statuses %>
27 27
  <% next if old_status.nil? && name != 'always' %>
28 28
  <tr>
29
    <td class="name">
29
    <td class="name fixed-column">
30 30
      <%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}')",
31 31
                           :title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
32 32
                           :class => 'no-tooltip icon-only icon-checked') %>
app/views/workflows/edit.html.erb
33 33

  
34 34
<% if @trackers && @roles && @statuses.any? %>
35 35
  <%= form_tag workflows_path, method: :patch, id: 'workflow_form' do %>
36
    <%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
37
    <%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
38
    <%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
39
    <div class="autoscroll">
36
    <div class="sticky-table-wrapper">
37
      <%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
38
      <%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
39
      <%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
40 40
      <%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
41

  
42
      <fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
43
        <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
44
        <div id="author_workflows" style="margin: 0.5em 0 0.5em 0;">
45
          <%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
46
        </div>
47
      </fieldset>
48
      <%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
49

  
50
      <fieldset class="collapsible" style="padding: 0;">
51
        <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
52
        <div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;">
53
      <%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
54
        </div>
55
      </fieldset>
56
      <%= javascript_tag "hideFieldset($('#assignee_workflows'))" unless @workflows['assignee'].present? %>
57 41
    </div>
42

  
43
    <fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
44
      <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
45
      <div id="author_workflows" class="sticky-table-wrapper" style="margin: 0.5em 0 0.5em 0;">
46
        <%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
47
      </div>
48
    </fieldset>
49
    <%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
50

  
51
    <fieldset class="collapsible" style="padding: 0;">
52
      <legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
53
      <div id="assignee_workflows" class="sticky-table-wrapper" style="margin: 0.5em 0 0.5em 0;">
54
    <%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
55
      </div>
56
    </fieldset>
57
    <%= javascript_tag "hideFieldset($('#assignee_workflows'))" unless @workflows['assignee'].present? %>
58 58
    <%= submit_tag l(:button_save) %>
59 59
  <% end %>
60 60
<% end %>
app/views/workflows/permissions.html.erb
34 34
    <%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
35 35
    <%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
36 36
    <%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
37
    <div class="autoscroll">
37
    <div class="sticky-table-wrapper">
38 38
    <table class="list workflows fields_permissions">
39 39
    <thead>
40
      <tr>
41
        <th>
40
      <tr class='fixed-row'>
41
        <th class='fixed-column'>
42
          <%=l(:label_issue_status)%>
42 43
        </th>
43
        <th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th>
44
        <th colspan="<%= @statuses.length %>"></th>
44 45
      </tr>
45
      <tr>
46
        <td></td>
46
      <tr class='fixed-row status'>
47
        <td class='fixed-column'></td>
47 48
        <% for status in @statuses %>
48 49
        <td style="width:<%= 75 / @statuses.size %>%;">
49 50
          <%= status.name %>
......
52 53
      </tr>
53 54
    </thead>
54 55
    <tbody>
55
      <tr class="group open">
56
        <td colspan="<%= @statuses.size + 1 %>">
56
      <tr class="group open fixed-row">
57
        <td class='fixed-column'>
57 58
          <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
58 59
          <%= l(:field_core_fields) %>
59 60
        </td>
61
        <td colspan="<%= @statuses.size %>"></td>
60 62
      </tr>
61 63
      <% @fields.each do |field, name| %>
62 64
      <tr>
63
        <td class="name">
65
        <td class="name fixed-column">
64 66
          <%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
65 67
        </td>
66 68
        <% for status in @statuses -%>
......
72 74
      </tr>
73 75
      <% end %>
74 76
      <% if @custom_fields.any? %>
75
        <tr class="group open">
76
          <td colspan="<%= @statuses.size + 1 %>">
77
        <tr class="group open fixed-row">
78
          <td class='fixed-column'>
77 79
            <span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
78 80
            <%= l(:label_custom_field_plural) %>
79 81
          </td>
82
          <td colspan="<%= @statuses.size %>"></td>
80 83
        </tr>
81 84
        <% @custom_fields.each do |field| %>
82 85
        <tr>
83
          <td class="name">
86
          <td class="name fixed-column">
84 87
            <%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
85 88
          </td>
86 89
          <% for status in @statuses -%>
public/stylesheets/application.css
733 733

  
734 734
#workflow_copy_form select { width: 200px; }
735 735
table.transitions td.enabled {background: #bfb;}
736
@media screen {
737
  table.fields_permissions td {
738
    min-width: 100px;
739
  }
740
  table.transitions td {
741
    min-width: 50px;
742
  }
743
  .sticky-table-wrapper {
744
    max-height: 500px;
745
  }
746
}
747

  
748
.sticky-table-wrapper {
749
  table-layout: fixed;
750
  overflow-x: auto;
751
  margin-bottom: 1.2em;
752
  position: relative;
753
}
754

  
755
.sticky-table-wrapper table {
756
  overflow-y: scroll;
757
  overflow-x: scroll;
758
}
759
.sticky-table-wrapper table tr.fixed-row td, .sticky-table-wrapper table tr.fixed-row th {
760
  position: -webkit-sticky;
761
  position: sticky;
762
  top: 0px;
763
  z-index: 10;
764
}
765
.sticky-table-wrapper table td.fixed-column, .sticky-table-wrapper table th.fixed-column {
766
  position: -webkit-sticky;
767
  position: sticky;
768
  left: 0px;
769
  z-index: 9;
770
  border-right: 1px solid #dfe8f1;
771
}
772
.sticky-table-wrapper table.workflows tr.fixed-row.status td {
773
  top: 23px;
774
  background-color: #fff;
775
}
776
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
777
  top: 40px;
778
  background-color: #fff;
779
  border-top: 1px solid #dfe8f1;
780
}
781
.sticky-table-wrapper table.transitions tr.fixed-row.status td:not(.fixed-column) {
782
  border-bottom: 1px solid #dfe8f1;
783
}
784
.sticky-table-wrapper table.workflows thead tr td.fixed-column, .sticky-table-wrapper table.workflows thead tr th.fixed-column {
785
  z-index: 11;
786
  white-space: nowrap;
787
}
788
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td.fixed-column {
789
  z-index: 11;
790
  white-space: nowrap;
791
  border-right: none;
792
  background-color: #fff;
793
}
794
.sticky-table-wrapper table tbody td.fixed-column, .sticky-table-wrapper table tbody th.fixed-column {
795
  background-color: #fff;
796
}
797
.sticky-table-wrapper table.workflows tr:nth-child(odd) td.fixed-column {
798
  background-color: #f6f7f8;
799
}
800
/* Only Safari */
801
_::-webkit-full-page-media, _:future, :root .sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
802
  top: 0px;
803
}
804

  
736 805
#workflow_form table select {font-size:90%; max-width:100px;}
737 806
table.fields_permissions td.readonly {background:#ddd;}
738 807
table.fields_permissions td.required {background:#d88;}
......
1775 1844
  #wiki_add_attachment { display:none; }
1776 1845
  .hide-when-print, .pagination ul.pages, .pagination .per-page { display: none !important; }
1777 1846
  .autoscroll {overflow-x: visible;}
1847
  .sticky-table-wrapper table { overflow-x: visible; overflow-y: visible; }
1778 1848
  table.list {margin-top:0.5em;}
1779 1849
  table.list th, table.list td {border: 1px solid #aaa;}
1780 1850
}