Project

General

Profile

Feature #14508 » feature-14508.patch

Mizuki ISHIKAWA, 2021-07-09 06:46

View differences:

app/views/workflows/_form.html.erb
<table class="list workflows transitions transitions-<%= name %>">
<thead>
<tr>
<th>
<tr class='fixed-row'>
<th class='fixed-column'>
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled)')",
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
:class => 'no-tooltip icon-only icon-checked') %>
......
</th>
<th colspan="<%= @statuses.length %>"><%=l(:label_new_statuses_allowed)%></th>
</tr>
<tr>
<td></td>
<tr class='fixed-row status'>
<td class='fixed-column'></td>
<% for new_status in @statuses %>
<td style="width:<%= 75 / @statuses.size %>%;">
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).new-status-#{new_status.id}')",
......
<% for old_status in [nil] + @statuses %>
<% next if old_status.nil? && name != 'always' %>
<tr>
<td class="name">
<td class="name fixed-column">
<%= link_to_function('', "toggleCheckboxesBySelector('table.transitions-#{name} input[type=checkbox]:not(:disabled).old-status-#{old_status.try(:id) || 0}')",
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
:class => 'no-tooltip icon-only icon-checked') %>
app/views/workflows/edit.html.erb
<% if @trackers && @roles && @statuses.any? %>
<%= form_tag workflows_path, method: :patch, id: 'workflow_form' do %>
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
<div class="autoscroll">
<div class="sticky-table-wrapper">
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
<%= render :partial => 'form', :locals => {:name => 'always', :workflows => @workflows['always']} %>
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
<div id="author_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
</div>
</fieldset>
<%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
<fieldset class="collapsible" style="padding: 0;">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
<div id="assignee_workflows" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
</div>
</fieldset>
<%= javascript_tag "hideFieldset($('#assignee_workflows'))" unless @workflows['assignee'].present? %>
</div>
<fieldset class="collapsible" style="padding: 0; margin-top: 0.5em;">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_author) %></legend>
<div id="author_workflows" class="sticky-table-wrapper" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'author', :workflows => @workflows['author']} %>
</div>
</fieldset>
<%= javascript_tag "hideFieldset($('#author_workflows'))" unless @workflows['author'].present? %>
<fieldset class="collapsible" style="padding: 0;">
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed"><%= l(:label_additional_workflow_transitions_for_assignee) %></legend>
<div id="assignee_workflows" class="sticky-table-wrapper" style="margin: 0.5em 0 0.5em 0;">
<%= render :partial => 'form', :locals => {:name => 'assignee', :workflows => @workflows['assignee']} %>
</div>
</fieldset>
<%= javascript_tag "hideFieldset($('#assignee_workflows'))" unless @workflows['assignee'].present? %>
<%= submit_tag l(:button_save) %>
<% end %>
<% end %>
app/views/workflows/permissions.html.erb
<%= @trackers.map {|tracker| hidden_field_tag 'tracker_id[]', tracker.id, :id => nil}.join.html_safe %>
<%= @roles.map {|role| hidden_field_tag 'role_id[]', role.id, :id => nil}.join.html_safe %>
<%= hidden_field_tag 'used_statuses_only', params[:used_statuses_only], :id => nil %>
<div class="autoscroll">
<div class="sticky-table-wrapper">
<table class="list workflows fields_permissions">
<thead>
<tr>
<th>
<tr class='fixed-row'>
<th class='fixed-column'>
<%=l(:label_issue_status)%>
</th>
<th colspan="<%= @statuses.length %>"><%=l(:label_issue_status)%></th>
<th colspan="<%= @statuses.length %>"></th>
</tr>
<tr>
<td></td>
<tr class='fixed-row status'>
<td class='fixed-column'></td>
<% for status in @statuses %>
<td style="width:<%= 75 / @statuses.size %>%;">
<%= status.name %>
......
</tr>
</thead>
<tbody>
<tr class="group open">
<td colspan="<%= @statuses.size + 1 %>">
<tr class="group open fixed-row">
<td class='fixed-column'>
<span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
<%= l(:field_core_fields) %>
</td>
<td colspan="<%= @statuses.size %>"></td>
</tr>
<% @fields.each do |field, name| %>
<tr>
<td class="name">
<td class="name fixed-column">
<%= name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
</td>
<% for status in @statuses -%>
......
</tr>
<% end %>
<% if @custom_fields.any? %>
<tr class="group open">
<td colspan="<%= @statuses.size + 1 %>">
<tr class="group open fixed-row">
<td class='fixed-column'>
<span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
<%= l(:label_custom_field_plural) %>
</td>
<td colspan="<%= @statuses.size %>"></td>
</tr>
<% @custom_fields.each do |field| %>
<tr>
<td class="name">
<td class="name fixed-column">
<%= field.name %> <%= content_tag('span', '*', :class => 'required') if field_required?(field) %>
</td>
<% for status in @statuses -%>
public/stylesheets/application.css
#workflow_copy_form select { width: 200px; }
table.transitions td.enabled {background: #bfb;}
@media screen {
table.fields_permissions td {
min-width: 100px;
}
table.transitions td {
min-width: 50px;
}
.sticky-table-wrapper {
max-height: 500px;
}
}
.sticky-table-wrapper {
table-layout: fixed;
overflow-x: auto;
margin-bottom: 1.2em;
position: relative;
}
.sticky-table-wrapper table {
overflow-y: scroll;
overflow-x: scroll;
}
.sticky-table-wrapper table tr.fixed-row td, .sticky-table-wrapper table tr.fixed-row th {
position: -webkit-sticky;
position: sticky;
top: 0px;
z-index: 10;
}
.sticky-table-wrapper table td.fixed-column, .sticky-table-wrapper table th.fixed-column {
position: -webkit-sticky;
position: sticky;
left: 0px;
z-index: 9;
border-right: 1px solid #dfe8f1;
}
.sticky-table-wrapper table.workflows tr.fixed-row.status td {
top: 23px;
background-color: #fff;
}
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
top: 40px;
background-color: #fff;
border-top: 1px solid #dfe8f1;
}
.sticky-table-wrapper table.transitions tr.fixed-row.status td:not(.fixed-column) {
border-bottom: 1px solid #dfe8f1;
}
.sticky-table-wrapper table.workflows thead tr td.fixed-column, .sticky-table-wrapper table.workflows thead tr th.fixed-column {
z-index: 11;
white-space: nowrap;
}
.sticky-table-wrapper table.fields_permissions tr.fixed-row.group td.fixed-column {
z-index: 11;
white-space: nowrap;
border-right: none;
background-color: #fff;
}
.sticky-table-wrapper table tbody td.fixed-column, .sticky-table-wrapper table tbody th.fixed-column {
background-color: #fff;
}
.sticky-table-wrapper table.workflows tr:nth-child(odd) td.fixed-column {
background-color: #f6f7f8;
}
/* Only Safari */
_::-webkit-full-page-media, _:future, :root .sticky-table-wrapper table.fields_permissions tr.fixed-row.group td {
top: 0px;
}
#workflow_form table select {font-size:90%; max-width:100px;}
table.fields_permissions td.readonly {background:#ddd;}
table.fields_permissions td.required {background:#d88;}
......
#wiki_add_attachment { display:none; }
.hide-when-print, .pagination ul.pages, .pagination .per-page { display: none !important; }
.autoscroll {overflow-x: visible;}
.sticky-table-wrapper table { overflow-x: visible; overflow-y: visible; }
table.list {margin-top:0.5em;}
table.list th, table.list td {border: 1px solid #aaa;}
}
(4-4/7)