Skip to content

Commit a63834f

Browse files
juno-nishizakiRedmine Patch Meetup
authored and
Redmine Patch Meetup
committed
patched 14508.patch
1 parent 50770a9 commit a63834f

File tree

4 files changed

+112
-39
lines changed

4 files changed

+112
-39
lines changed

app/views/workflows/_form.html.erb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<table class="list workflows transitions transitions-<%= name %>">
22
<thead>
3-
<tr>
4-
<th>
3+
<tr class='fixed-row'>
4+
<th class='fixed-column'>
55
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled)')",
66
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
77
:class => 'no-tooltip icon-only icon-checked') %>
88
<%=l(:label_current_status)%>
99
</th>
1010
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
1111
</tr>
12-
<tr>
13-
<td></td>
12+
<tr class='fixed-row status'>
13+
<td class='fixed-column'></td>
1414
<% for new_status in @statuses %>
1515
<td style="width:<%= 75 / @statuses.size %>%;">
1616
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}')",
@@ -26,7 +26,7 @@
2626
<% for old_status in [nil] + @statuses %>
2727
<% next if old_status.nil? && name != 'always' %>
2828
<tr>
29-
<td class="name">
29+
<td class="name fixed-column">
3030
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}')",
3131
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
3232
:class => 'no-tooltip icon-only icon-checked') %>

app/views/workflows/edit.html.erb

+20-20
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@
3333

3434
<% if @trackers && @roles && @statuses.any? %>
3535
<%= 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 %>
4040
<%= 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? %>
5741
</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? %>
5858
<%= submit_tag l(:button_save) %>
5959
<% end %>
6060
<% end %>

app/views/workflows/permissions.html.erb

+17-14
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@
3434
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
3535
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
3636
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
37-
<div class="autoscroll">
37+
<div class="sticky-table-wrapper">
3838
<table class="list workflows fields_permissions">
3939
<thead>
40-
<tr>
41-
<th>
40+
<tr class='fixed-row'>
41+
<th class='fixed-column'>
42+
<%=l(:label_issue_status)%>
4243
</th>
43-
<th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th>
44+
<th colspan="<%= @statuses.length %>"></th>
4445
</tr>
45-
<tr>
46-
<td></td>
46+
<tr class='fixed-row status'>
47+
<td class='fixed-column'></td>
4748
<% for status in @statuses %>
4849
<td style="width:<%= 75 / @statuses.size %>%;">
4950
<%= status.name %>
@@ -52,15 +53,16 @@
5253
</tr>
5354
</thead>
5455
<tbody>
55-
<tr class="group open">
56-
<td colspan="<%= @statuses.size + 1 %>">
57-
<span class="expander icon icon-expanded" onclick="toggleRowGroup(this);">&nbsp;</span>
56+
<tr class="group open fixed-row">
57+
<td class='fixed-column'>
58+
<span class="expander icon icon-expanded" onclick="toggleRowGroup(this);">&nbsp;</span>
5859
<%= l(:field_core_fields) %>
5960
</td>
61+
<td colspan="<%= @statuses.size %>"></td>
6062
</tr>
6163
<% @fields.each do |field, name| %>
6264
<tr>
63-
<td class="name">
65+
<td class="name fixed-column">
6466
<%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
6567
</td>
6668
<% for status in @statuses -%>
@@ -72,15 +74,16 @@
7274
</tr>
7375
<% end %>
7476
<% if @custom_fields.any? %>
75-
<tr class="group open">
76-
<td colspan="<%= @statuses.size + 1 %>">
77-
<span class="expander icon icon-expanded" onclick="toggleRowGroup(this);">&nbsp;</span>
77+
<tr class="group open fixed-row">
78+
<td class='fixed-column'>
79+
<span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
7880
<%= l(:label_custom_field_plural) %>
7981
</td>
82+
<td colspan="<%= @statuses.size %>"></td>
8083
</tr>
8184
<% @custom_fields.each do |field| %>
8285
<tr>
83-
<td class="name">
86+
<td class="name fixed-column">
8487
<%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
8588
</td>
8689
<% for status in @statuses -%>

public/stylesheets/application.css

+70
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,75 @@ ul.properties li span {font-style:italic;}
766766

767767
#workflow_copy_form select { width: 200px; }
768768
table.transitions td.enabled {background: #bfb;}
769+
@media screen {
770+
table.fields_permissions td {
771+
min-width: 100px;
772+
}
773+
table.transitions td {
774+
min-width: 50px;
775+
}
776+
.sticky-table-wrapper {
777+
max-height: 500px;
778+
}
779+
}
780+
781+
.sticky-table-wrapper {
782+
table-layout: fixed;
783+
overflow-x: auto;
784+
margin-bottom: 1.2em;
785+
position: relative;
786+
}
787+
788+
.sticky-table-wrapper table {
789+
overflow-y: scroll;
790+
overflow-x: scroll;
791+
}
792+
.sticky-table-wrapper table tr.fixed-row td, .sticky-table-wrapper table tr.fixed-row th {
793+
position: -webkit-sticky;
794+
position: sticky;
795+
top: 0px;
796+
z-index: 10;
797+
}
798+
.sticky-table-wrapper table td.fixed-column, .sticky-table-wrapper table th.fixed-column {
799+
position: -webkit-sticky;
800+
position: sticky;
801+
left: 0px;
802+
z-index: 9;
803+
border-right: 1px solid #dfe8f1;
804+
}
805+
.sticky-table-wrapper table.workflows tr.fixed-row.status td {
806+
top: 23px;
807+
background-color: #fff;
808+
}
809+
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
810+
top: 40px;
811+
background-color: #fff;
812+
border-top: 1px solid #dfe8f1;
813+
}
814+
.sticky-table-wrapper table.transitions tr.fixed-row.status td:not(.fixed-column) {
815+
border-bottom: 1px solid #dfe8f1;
816+
}
817+
.sticky-table-wrapper table.workflows thead tr td.fixed-column, .sticky-table-wrapper table.workflows thead tr th.fixed-column {
818+
z-index: 11;
819+
white-space: nowrap;
820+
}
821+
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td.fixed-column {
822+
z-index: 11;
823+
white-space: nowrap;
824+
border-right: none;
825+
background-color: #fff;
826+
}
827+
.sticky-table-wrapper table tbody td.fixed-column, .sticky-table-wrapper table tbody th.fixed-column {
828+
background-color: #fff;
829+
}
830+
.sticky-table-wrapper table.workflows tr:nth-child(odd) td.fixed-column {
831+
background-color: #f6f7f8;
832+
}
833+
/* Only Safari */
834+
_::-webkit-full-page-media, _:future, :root .sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
835+
top: 0px;
836+
}
837+
769838
#workflow_form table select {font-size:90%; max-width:100px;}
770839
table.fields_permissions td.readonly {background:#ddd;}
771840
table.fields_permissions td.required {background:#d88;}
@@ -1819,6 +1888,7 @@ img.filecontent.image {background-image: url(../images/transparent.png);}
18191888
#wiki_add_attachment { display:none; }
18201889
.hide-when-print, .pagination ul.pages, .pagination .per-page { display: none !important; }
18211890
.autoscroll {overflow-x: visible;}
1891+
.sticky-table-wrapper table { overflow-x: visible; overflow-y: visible; }
18221892
table.list {margin-top:0.5em;}
18231893
table.list th, table.list td {border: 1px solid #aaa;}
18241894
}

0 commit comments

Comments
 (0)