Skip to content

Commit 56e0205

Browse files
patched 14508.patch
1 parent 7a6d552 commit 56e0205

File tree

4 files changed

+110
-37
lines changed

4 files changed

+110
-37
lines changed

app/views/workflows/_form.html.erb

Lines changed: 5 additions & 5 deletions
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

Lines changed: 20 additions & 20 deletions
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

Lines changed: 15 additions & 12 deletions
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 %>">
56+
<tr class="group open fixed-row">
57+
<td class='fixed-column'>
5758
<span class="expander icon icon-expended" 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+
<tr class="group open fixed-row">
78+
<td class='fixed-column'>
7779
<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

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,75 @@ ul.properties li span {font-style:italic;}
738738

739739
#workflow_copy_form select { width: 200px; }
740740
table.transitions td.enabled {background: #bfb;}
741+
@media screen {
742+
table.fields_permissions td {
743+
min-width: 100px;
744+
}
745+
table.transitions td {
746+
min-width: 50px;
747+
}
748+
.sticky-table-wrapper {
749+
max-height: 500px;
750+
}
751+
}
752+
753+
.sticky-table-wrapper {
754+
table-layout: fixed;
755+
overflow-x: auto;
756+
margin-bottom: 1.2em;
757+
position: relative;
758+
}
759+
760+
.sticky-table-wrapper table {
761+
overflow-y: scroll;
762+
overflow-x: scroll;
763+
}
764+
.sticky-table-wrapper table tr.fixed-row td, .sticky-table-wrapper table tr.fixed-row th {
765+
position: -webkit-sticky;
766+
position: sticky;
767+
top: 0px;
768+
z-index: 10;
769+
}
770+
.sticky-table-wrapper table td.fixed-column, .sticky-table-wrapper table th.fixed-column {
771+
position: -webkit-sticky;
772+
position: sticky;
773+
left: 0px;
774+
z-index: 9;
775+
border-right: 1px solid #dfe8f1;
776+
}
777+
.sticky-table-wrapper table.workflows tr.fixed-row.status td {
778+
top: 23px;
779+
background-color: #fff;
780+
}
781+
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
782+
top: 40px;
783+
background-color: #fff;
784+
border-top: 1px solid #dfe8f1;
785+
}
786+
.sticky-table-wrapper table.transitions tr.fixed-row.status td:not(.fixed-column) {
787+
border-bottom: 1px solid #dfe8f1;
788+
}
789+
.sticky-table-wrapper table.workflows thead tr td.fixed-column, .sticky-table-wrapper table.workflows thead tr th.fixed-column {
790+
z-index: 11;
791+
white-space: nowrap;
792+
}
793+
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td.fixed-column {
794+
z-index: 11;
795+
white-space: nowrap;
796+
border-right: none;
797+
background-color: #fff;
798+
}
799+
.sticky-table-wrapper table tbody td.fixed-column, .sticky-table-wrapper table tbody th.fixed-column {
800+
background-color: #fff;
801+
}
802+
.sticky-table-wrapper table.workflows tr:nth-child(odd) td.fixed-column {
803+
background-color: #f6f7f8;
804+
}
805+
/* Only Safari */
806+
_::-webkit-full-page-media, _:future, :root .sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
807+
top: 0px;
808+
}
809+
741810
#workflow_form table select {font-size:90%; max-width:100px;}
742811
table.fields_permissions td.readonly {background:#ddd;}
743812
table.fields_permissions td.required {background:#d88;}
@@ -1780,6 +1849,7 @@ img.filecontent.image {background-image: url(../images/transparent.png);}
17801849
#wiki_add_attachment { display:none; }
17811850
.hide-when-print, .pagination ul.pages, .pagination .per-page { display: none !important; }
17821851
.autoscroll {overflow-x: visible;}
1852+
.sticky-table-wrapper table { overflow-x: visible; overflow-y: visible; }
17831853
table.list {margin-top:0.5em;}
17841854
table.list th, table.list td {border: 1px solid #aaa;}
17851855
}

0 commit comments

Comments
 (0)