summaryrefslogtreecommitdiffstats
path: root/app/views/gantts/show.html.erb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2019-05-16 21:54:33 +0000
committerGo MAEDA <maeda@farend.jp>2019-05-16 21:54:33 +0000
commit0328b5671abc0fdfce1a97bde4897f7a72d9dcd4 (patch)
tree38e76c1130181c7297e0176803bfd19510a97940 /app/views/gantts/show.html.erb
parent774e8b1d44ce3545e13d791ab27116081cd662a6 (diff)
downloadredmine-0328b5671abc0fdfce1a97bde4897f7a72d9dcd4.tar.gz
redmine-0328b5671abc0fdfce1a97bde4897f7a72d9dcd4.zip
Show selected columns in gantt chart (#27672).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@18171 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/gantts/show.html.erb')
-rw-r--r--app/views/gantts/show.html.erb53
1 files changed, 45 insertions, 8 deletions
diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb
index 476c86025..999f8f816 100644
--- a/app/views/gantts/show.html.erb
+++ b/app/views/gantts/show.html.erb
@@ -27,6 +27,20 @@
<tr>
<td>
<fieldset>
+ <legend>
+ <%= l(:field_column_names) %>
+ </legend>
+ <label for="draw_selected_columns">
+ <%= check_box 'query', 'draw_selected_columns', :id => 'draw_selected_columns', 'data-enables' => 'span.query-columns select, span.query-columns input' %>
+ <%= l(:label_display) %>
+ </label>
+ <%= render_query_columns_selection(@query) %>
+ </fieldset>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <fieldset>
<legend><%= l(:label_related_issues) %></legend>
<label for="draw_relations">
<%= check_box 'query', 'draw_relations', :id => 'draw_relations' %>
@@ -125,16 +139,16 @@
<p class="warning"><%= l(:notice_gantt_chart_truncated, :max => @gantt.max_rows) %></p>
<% end %>
-<table style="width:100%; border:0; border-collapse: collapse;">
+<table class='gantt-table'>
<tr>
-<td style="width:<%= subject_width %>px; padding:0px;" class="gantt_subjects_column">
+<td style="width:<%= subject_width %>px;" class="gantt_subjects_column">
<%
style = ""
style += "position:relative;"
style += "height: #{t_height + 24}px;"
- style += "width: #{subject_width + 1}px;"
+ style += "width: #{subject_width}px;"
%>
- <%= content_tag(:div, :style => style, :class => "gantt_subjects_container") do %>
+ <%= content_tag(:div, :style => style, :class => "gantt_subjects_container #{'draw_selected_columns' if @query.draw_selected_columns}") do %>
<%
style = ""
style += "width: #{subject_width + 1}px;"
@@ -147,7 +161,6 @@
style += "z-index: 1;"
style += "width: #{subject_width}px;"
style += "height: #{t_height}px;"
- style += 'border-left: 1px solid #c0c0c0;'
style += 'overflow: hidden;'
%>
<%= content_tag(:div, "", :style => style, :class => "gantt_hdr") %>
@@ -158,7 +171,30 @@
<% end %>
<% end %>
</td>
-
+<% @query.columns.each do |column| %>
+ <% next if Redmine::Helpers::Gantt::UNAVAILABLE_COLUMNS.include?(column.name) %>
+ <td class="gantt_<%= column.name %>_column gantt_selected_column <%= 'last_gantt_selected_column' if @query.columns.last == column %>" id="<%= column.name %>">
+ <%
+ style = "position: relative;"
+ style += "height: #{t_height + 24}px;"
+ %>
+ <%= content_tag(:div, :style => style, :class => "gantt_#{column.name}_container gantt_selected_column_container") do %>
+ <%
+ style = "height: #{t_height}px;"
+ style += 'overflow: hidden;'
+ %>
+ <%= content_tag(:div, '', :style => style, :class => "gantt_hdr") %>
+ <%
+ style = "height: #{headers_height}px;"
+ style += 'background: #eee;'
+ %>
+ <%= content_tag(:div, content_tag(:p, column.caption, :class => 'gantt_hdr_selected_column_name'), :style => style, :class => "gantt_hdr") %>
+ <%= content_tag(:div, :class => "gantt_#{column.name} gantt_selected_column_content") do %>
+ <%= @gantt.selected_column_content({:column => column, :top => headers_height + 8, :zoom => zoom, :g_width => g_width}).html_safe %>
+ <% end %>
+ <% end %>
+ </td>
+<% end %>
<td>
<div style="position:relative;height:<%= t_height + 24 %>px;overflow:auto;" id="gantt_area">
<%
@@ -372,10 +408,11 @@
<%= javascript_tag do %>
var issue_relation_type = <%= raw Redmine::Helpers::Gantt::DRAW_TYPES.to_json %>;
$(function() {
+ disable_unavailable_columns('<%= Redmine::Helpers::Gantt::UNAVAILABLE_COLUMNS.map(&:to_s).join(',') %>'.split(','));
drawGanttHandler();
resizableSubjectColumn();
- $("#draw_relations").change(drawGanttHandler);
- $("#draw_progress_line").change(drawGanttHandler);
+ drawSelectedColumns();
+ $("#draw_relations, #draw_progress_line, #draw_selected_columns").change(drawGanttHandler);
$('div.gantt_subjects .expander').on('click', ganttEntryClick);
});
$(window).resize(function() {