Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Delegate condensed view to javascript

  • Loading branch information...
commit aa9a113c51cc229feb417a49a6dc373aa3c4da6e 1 parent 4c77082
@den-plugins authored
View
35 app/controllers/task_boards_controller.rb
@@ -17,14 +17,13 @@ def index
Version.tmp_features = nil
Version.tmp_tasks = nil
if params[:state].nil?
- @versions = @project.versions.all(:conditions => ["state = ?", 2],:order => 'effective_date IS NULL, effective_date DESC')
+ @versions = @project.versions.all(:conditions => ["state = ?", 2], :order => 'effective_date IS NULL, effective_date DESC')
else
- @versions = @project.versions.all(:conditions => ["state = ?", params[:state]],:order => 'effective_date IS NULL, effective_date DESC')
+ @versions = @project.versions.all(:conditions => ["state = ?", params[:state]], :order => 'effective_date IS NULL, effective_date DESC')
end
end
def show
- @condensed = params[:condensed] ? true : false
@show_bugs = params[:show_bugs] ? true : false
@statuses = IssueStatus.all(:order => "position asc")
@version = Version.find params[:version_id]
@@ -52,7 +51,7 @@ def show
else
@features = @version.features
@tasks = @version.tasks
-
+
@nodata_to_filter = (@features.empty? and @tasks.empty?)? true : false
unless ["", "All", "Select a team..."].member? @selected_team
@features = @features.select {|f| not f.custom_values.first(:conditions => "value = '#{@selected_team}'").nil? }
@@ -94,33 +93,32 @@ def show
@parent_bugs = @bugs.map do |b|
b if !b.version_descendants.empty? and b.parent.nil?
end
-
+
#puts @parent_bugs.inspect
@bugs.reject!.each do |b|
b if !b.version_descendants.empty? or (!b.parent.nil? and b.parent.issue_from.bug?) #and not (b.parent.issue_from.feature? or b.parent.issue_from.task?)
end
-
+
@bugged = @bugs.empty? ? false : true
@error_msg = "There are no Bugs." if not @bugged
end
-
+
@error_msg = "There are no issues for this version." if @version.fixed_issues.empty?
end
-
+
def update_issue_status
get_project
@status = IssueStatus.find(params[:status_id])
@issue = Issue.find(params[:issue_id])
@issue.init_journal(User.current, "")
- @condensed = params[:condensed] ? true : false
@selected_resource = params[:selected_resource] ? params[:selected_resource] : ""
attrs = {:status_id => @status.id}
@issue.update_attributes(attrs)
parents = @issue.update_parents
-
+
@status_grouped = (params[:board].to_i.eql?(1) ? IssueStatusGroup::TASK_GROUPED : IssueStatusGroup::BUG_GROUPED)
-
+
render :update do |page|
page.remove dom_id(@issue)
story = @issue.feature_child? ? @issue.parent.issue_from : @issue.task_parent unless @issue.parent.nil?
@@ -144,7 +142,7 @@ def update_issue_status
#page.complete "Element.show('#{task_board_dom_id(story, @status, 'list')}')"
end
end
-
+
def update_issue
#TODO Permissions trapping - view
get_project
@@ -152,10 +150,10 @@ def update_issue
@issue.init_journal(User.current, '')
@issue.update_attributes(params[:issue])
@selected_resource = params[:selected_resource] ? params[:selected_resource] : ""
-
+
parents = @issue.update_parents
@status_grouped = (params[:board].to_i.eql?(1) ? IssueStatusGroup::TASK_GROUPED : IssueStatusGroup::BUG_GROUPED)
-
+
render :update do |page|
page.update_sticky_note dom_id(@issue), @issue, params[:board].to_i
#show_bug = {:bug => true} if @issue.bug? and params[:board].to_i.eql?(1)
@@ -188,20 +186,20 @@ def add_comment
page.replace_html "#{@issue.id}_tip".to_sym, page.task_board_tooltip(@issue)
end
end
-
+
private
def get_project
@project = Project.find(params[:id])
end
-
+
def get_version
@version = Version.find params[:version_id]
end
-
+
def ordered_keys(values)
values.keys.sort{|x,y| values[x][:order] <=> values[y][:order]}
end
-
+
def parented_sort(tasks)
psorted = tasks.sort_by {|t| -t.children.count }
sorted = psorted.select {|p| p.parent.nil? && p.children.any?}
@@ -216,3 +214,4 @@ def parented_sort(tasks)
sorted
end
end
+
View
29 app/helpers/task_boards_helper.rb
@@ -9,33 +9,33 @@ def task_board_drop_receiving_element(dom_id, status, statuses)
drop_receiving_element(dom_id,
:accept => statuses.collect {|s| s.class_name},
:hoverclass => 'hovered',
- :url => {:controller => 'task_boards', :action => 'update_issue_status', :selected_resource => @selected_resource,
- :condensed => (@condensed ? @condensed : nil)},
- :with => "'issue_id=' + (element.id.split('_').last()) + '&status_id=#{status.id}&id=#{@project.id}&board=#{params[:board]}'")
+ :url => {:controller => 'task_boards', :action => 'update_issue_status', :selected_resource => @selected_resource},
+ :with => "'issue_id=' + (element.id.split('_').last()) + '&status_id=#{status.id}&id=#{@project.id}&board=#{params[:board]}'",
+ :complete => "toggleCondensed()")
end
-
+
def task_board_dom_id(issue, status, suffix='')
element_id = dom_id(issue || Issue.new, status.class_name)
element_id += "_#{suffix}" if suffix
element_id
end
-
+
def task_board_border_class issue
klass = ""
- if issue.task? : klass = "task_board_task_data"
- elsif issue.feature? : klass = "task_board_feature_data"
+ if issue.task? : klass = "task_board_task_data"
+ elsif issue.feature? : klass = "task_board_feature_data"
elsif issue.bug? : klass = "task_board_bug_data"
- elsif issue.support? : klass = "task_board_support_data"
+ elsif issue.support? : klass = "task_board_support_data"
end
klass += " no_drag" if !issue.version_descendants.empty? or issue.feature?
klass
end
-
+
def select_assigned_to f, issue
members = @project.members.find(:all, :include => [:user], :order => "users.firstname ASC")
f.select :assigned_to_id, (members.collect {|p| [p.name, p.user.id]}), :selected => (issue.assigned_to.nil? ? '' : issue.assigned_to.id), :include_blank => true
end
-
+
def select_status f, issue
group = @status_grouped
x = group.keys.detect {|k| group[k][:statuses].include? issue.status }
@@ -43,7 +43,7 @@ def select_status f, issue
f.select :status_id, group[x][:statuses].collect {|k| [k.name, k.id]}, :selected => issue.status.id
end
end
-
+
def link_to_issue(issue, options={})
options[:class] ||= ''
options[:class] << ' issue'
@@ -53,10 +53,10 @@ def link_to_issue(issue, options={})
end
link_to "#{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options
end
-
+
def update_sticky_note container, issue, board=nil
if issue.feature?
- page.replace_html "#{container}", :partial => 'feature', :locals => {:feature => issue }
+ page.replace_html "#{container}", :partial => 'feature', :locals => {:feature => issue }
classname = "task_board_data #{ task_board_border_class(issue) } assigned_to_#{issue.assigned_to_id} task_board_feature_parent"
else
page.replace_html "#{container}", :partial => 'issue_show', :locals => {:issue => issue}
@@ -72,7 +72,7 @@ def update_sticky_note container, issue, board=nil
page[container.to_sym].className = classname
page.visual_effect(:highlight, "#{container}")
end
-
+
def task_board_tooltip(ticket)
content = "<strong>#{l(:field_subject)}</strong>: #{textilizable ticket.subject}<br />" +
"<strong>#{l(:field_description)}</strong>: #{textilizable ticket.description}<br />" +
@@ -92,3 +92,4 @@ def get_journals(ticket)
end
end
+
View
20 app/views/task_boards/_feature.rhtml
@@ -1,12 +1,12 @@
<div class="issue_number">
- <%= link_to "#{feature.parent.issue_from_id} &raquo; ", "##{dom_id(feature.parent.issue_from)}",
- :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if !feature.parent.nil? and !@condensed %>
+ <%= link_to "#{feature.parent.issue_from_id} &raquo; ", "##{dom_id(feature.parent.issue_from)}",
+ :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if !feature.parent.nil? %>
<div class="tooltip">
<%= link_to_issue feature %><span id="<%= feature.id %>_tip" class="tip"><%= task_board_tooltip(feature) %></span>
</div>
</div>
-<% unless @condensed %>
+<div class="bulk_details">
<div class="initial_controls" style="display: none;">
<div class="edit" title="Edit">Edit</div>
<div class="toggle_details" title="Show Details">Show Details</div>
@@ -29,9 +29,9 @@
<div class="talk_here" style="display:none">
<div class="cancel" title="Cancel">Cancel</div>
<div class="comment_form_panel">
- <% remote_form_for :issue, feature, :url => {:action => "add_comment", :controller => "task_boards",
+ <% remote_form_for :issue, feature, :url => {:action => "add_comment", :controller => "task_boards",
:id => @project, :issue_id => feature }, :html => {:id => "#{feature.id}_comment_form", :class => "comment_form"},
- :complete => "$('text_comment_#{feature.id}').clear();
+ :complete => "$('text_comment_#{feature.id}').clear();
var barheight = getbarHeight(jQuery('##{feature.id}_discussion'), 30);
jQuery('.slimScrollBar').css({height: barheight + 'px'});
" do |f| %>
@@ -45,16 +45,10 @@
</div>
</div>
</div>
+</div>
<script type="text/javascript">
sticky_note("<%= dom_id(feature) %>", "<%= feature.assigned_to_id %>", "<%= feature.status_id %>");
- if (jQuery("#toggle_all").is(":checked")){
- jQuery('.toggle_details').addClass("maximized").removeClass("minimized");
- jQuery('.current_data').show();
- }else{
- jQuery('.toggle_details').addClass("minimized").removeClass("maximized");
- jQuery('.current_data').hide();
- }
jQuery(function(){
jQuery("#<%= feature.id %>_discussion").slimScroll({
height: '150px',
@@ -67,4 +61,4 @@
if(jQuery(this).val() == "Type your comment here...") jQuery(this).val("");
});
</script>
-<% end%>
+
View
23 app/views/task_boards/_issue_show.rhtml
@@ -1,17 +1,17 @@
<div class="issue_number">
<% if params[:board].to_i.eql? 1 %>
<%= link_to "#{issue.parent.issue_from_id} &raquo; ", "##{dom_id(issue.parent.issue_from)}",
- :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if (!issue.parent.nil? and !issue.parent.issue_from.feature?) and not issue.task_parent? and !@condensed %>
+ :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if (!issue.parent.nil? and !issue.parent.issue_from.feature?) and not issue.task_parent? %>
<% elsif params[:board].to_i.eql? 2 %>
<%= link_to "#{issue.parent.issue_from_id} &raquo; ", "##{dom_id(issue.parent.issue_from)}",
- :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if !issue.parent.nil? and !@condensed %>
+ :class => "to_parent", :style => "color: orange;", :title => "Jump to parent." if !issue.parent.nil? %>
<% end %>
<div class="tooltip">
<%= link_to_issue issue %><span id="<%= issue.id %>_tip" class="tip"><%= task_board_tooltip(issue) %></span>
</div>
</div>
-<% unless @condensed %>
+<div class="bulk_details">
<div class="initial_controls" style="display: none;">
<div class="edit" title="Edit">Edit</div>
<div class="toggle_details" title="Show Details">Show Details</div>
@@ -28,16 +28,6 @@
<%= progress_bar issue.done_ratio, :width =>'100%' %>
</div>
- <script type='text/javascript'>
- if (jQuery("#toggle_all").is(":checked")){
- jQuery('.toggle_details').addClass("maximized").removeClass("minimized");
- jQuery('.current_data').show();
- }else{
- jQuery('.toggle_details').addClass("minimized").removeClass("maximized");
- jQuery('.current_data').hide();
- }
- </script>
-
<div class="edit_here" style="display:none;">
<div class="cancel" title="Cancel">Cancel</div>
<div class="submit_link" title="Save">Save</div>
@@ -49,9 +39,9 @@
<div class="talk_here" style="display:none">
<div class="cancel" title="Cancel">Cancel</div>
<div class="comment_form_panel">
- <% remote_form_for :issue, issue, :url => {:action => "add_comment", :controller => "task_boards",
+ <% remote_form_for :issue, issue, :url => {:action => "add_comment", :controller => "task_boards",
:id => @project, :issue_id => issue }, :html => {:id => "#{issue.id}_comment_form", :class => "comment_form"},
- :complete => "jQuery('#text_comment_#{issue.id}').val('Type your comment here...');
+ :complete => "jQuery('#text_comment_#{issue.id}').val('Type your comment here...');
var barheight = getbarHeight(jQuery('##{issue.id}_discussion'), 30);
jQuery('.slimScrollBar').css({height: barheight + 'px'});
" do |f| %>
@@ -65,6 +55,7 @@
</div>
</div>
</div>
+</div>
<script type="text/javascript" id="stickynotejs_<%= issue.id %>" class="stickynotejs">
sticky_note('<%= dom_id(issue) %>', '<%= issue.assigned_to_id %>', '<%= issue.status_id %>');
@@ -80,8 +71,8 @@
});
});
</script>
-<% end %>
<% if issue.version_descendants.empty? %>
<%= draggable_element(dom_id(issue), :revert => '"failure"', :constraint => "'horizontal'")%>
<% end %>
+
View
3  app/views/task_boards/_row.html.erb
@@ -22,7 +22,7 @@
<% default = @status_grouped[k][:default] %>
<% statuses = @status_grouped[k][:statuses] %>
<td id="<%= task_board_dom_id(feature, default) %>" style="<%= border %>">
- <ul id="<%= task_board_dom_id(feature, default, 'list') %>" class="taskboard_issues_list <%= @condensed ? 'condensed' : '' %>">
+ <ul id="<%= task_board_dom_id(feature, default, 'list') %>" class="taskboard_issues_list ">
<% statuses.each do |status| %>
<% if feature.task_parent? %>
<%= render :partial => 'issue', :collection => Array(feature.version_descendants_filtered.group_by(&:status)[status]) %>
@@ -48,3 +48,4 @@
jQuery('.assigned_to_<%= feature.assigned_to_id %>').hide();
<% end %>
</script>
+
View
14 app/views/task_boards/index.html.erb
@@ -2,15 +2,17 @@
<%= stylesheet_link_tag 'task_board', :plugin => 'scrum_task_board' %>
<% end %>
<% cond = @project.project_condition(Setting.display_subprojects_issues?)
-
+
@open_issues_by_tracker = Issue.visible.count(:group => :tracker,
:include => [:project, :status, :tracker],
:conditions => ["(#{cond}) AND #{IssueStatus.table_name}.is_closed=?", false]) %>
<h2><%= html_title "#{@project.name} - Task board" -%></h2>
+
+<div id="version_container">
<% form_for :state_filter, :url => {:controller => "task_boards", :action => "index"} do |f| %>
Filter by: <%= select_tag "state", options_for_select(Milestone::STATES, "state"),:onchange => "$('filter_button').show();" %><%= submit_tag 'Filter', :id => "filter_button", :style => "display: none;" %>
<% end %>
-<div id="version_container">
+
<% unless @project.versions.empty? %>
<ul class="version_holder">
<% @versions.each do |v| %>
@@ -21,9 +23,9 @@ Filter by: <%= select_tag "state", options_for_select(Milestone::STATES, "state"
<% end %><br/>
<span>Date: <strong><%= v.effective_date.nil? ? 'none' : format_date(v.effective_date) %></strong></span>
<br/>
- <span>Issues: <strong><%= v.fixed_issues.count %></strong></span>
+ <span>Issues: <strong><%= v.fixed_issues.count %></strong></span>
<br/><br/>
-
+
<%= link_to "Features: <span style='color: #0EA94B'>#{v.feature_counter}</span><br/>Tasks: <span style='color:#5081AA'>#{v.task_counter}</span>",
:controller => "task_boards",
:action => "show",
@@ -31,13 +33,13 @@ Filter by: <%= select_tag "state", options_for_select(Milestone::STATES, "state"
:board => 1,
:id => @project.id %>
<br/>
-
+
<%= link_to "Bugs: <span style='color: red'>#{v.bug_counter}</span>",
:controller => "task_boards",
:action => "show",
:version_id => v.id,
:board => 2,
- :id => @project.id %>
+ :id => @project.id %>
</br>
<span class='effortLabel'>Total Estimated Effort:</span> <strong><%= v.total_estimated_effort%></strong> <span class='effortLabel'><%= l(:field_sp_hours) %></span></br>
<span class='effortLabel'>Total Remaining Effort:</span> <strong><%= v.total_remaining_effort%></strong> <span class='effortLabel'><%= l(:field_sp_hours) %></span>
View
112 app/views/task_boards/show.html.erb
@@ -1,8 +1,5 @@
-<%# html_title "#{@version.nil? ? "Issues with no version" : @version.name} - Task board" -%>
-
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'colorbox', :plugin => 'scrum_task_board' %>
- <!-- <link type="text/css" media="screen" rel="stylesheet" href="http://dl.getdropbox.com/u/2863383/js/colorbox132/example5/colorbox.css" /> -->
<%= stylesheet_link_tag 'task_board', :plugin => 'scrum_task_board' %>
<style type="text/css">
.clearfix:after {
@@ -35,7 +32,7 @@
<h2>
- <%= @version.nil? ? "Product Backlog" : @version.name %> Task Board
+ <%= @version.nil? ? "Product Backlog" : @version.name %> Task Board
<span style="float:right"><%= "Target Date: " + format_date(@version.effective_date) unless @version.effective_date.nil? %></span>
</h2>
<% if @version.completed? %><% elsif @version.effective_date %>
@@ -55,57 +52,51 @@
<div style="float:left; width: 70%; padding: 10px;">
<span style="padding-right:20px;">
- <% form_for :team_filter, :url => {:controller => "task_boards", :action => "show", :version_id => @version.id,
+ <% form_for :team_filter, :url => {:controller => "task_boards", :action => "show", :version_id => @version.id,
:board => @board, :id => @project.id}, :html => {:id => "form_sort_team"} do |f| %>
<% if @teams.projects.member? @project %>
<% team_blank = (["", "All", "Select a team..."].member? @selected_team)? ["Select a team..."] : ["All"] %>
- <%= select_tag "selected_team", options_for_select(team_blank + @teams.possible_values, @selected_team),
+ <%= select_tag "selected_team", options_for_select(team_blank + @teams.possible_values, @selected_team),
:onchange => "$('filter_button').show();" %>
<% end %>
<% resource_blank = (["", "All", "Select a resource..."].member? @selected_resource)? ["Select a resource..."] : ["All"] %>
- <%= check_box_tag 'condensed', @condensed, @condensed, :hidden => true %>
- <%= select_tag "selected_resource",
+
+ <%= select_tag "selected_resource",
"<option id='selected_resource_blank' value='#{resource_blank}'>
#{resource_blank}
- </option>" + options_from_collection_for_select(@project.members.sort_by(&:name), "user_id", "name", @selected_resource.to_i),
+ </option>" + options_from_collection_for_select(@project.members.sort_by(&:name), "user_id", "name", @selected_resource.to_i),
:onchange => "filterByResource();" %>
<%= submit_tag 'Filter', :id => "filter_button", :style => "display: none;" %>
<% end %>
</span>
<% unless @error_msg %>
-
-<% unless @condensed %>
- <input type="checkbox" id="toggle_all" checked/><label>Show Issue Details</label>
-<% end %>
-
+ <input type="checkbox" id="toggle_all" checked="checked"/><label id="toggle_all_label">Show Issue Details</label>
+ <input type="checkbox" id="toggle_condensed" /><label>Condensed View</label>
<%# if @featured and !@bugs.empty? %>
<!--<input type="checkbox" id="show_bugs" /><label>Show Bugs</label>-->
<%# end %>
-
-<% form_tag({:action => 'show', :id => @project.id, :version_id =>@version.id, :board => @board,
+<% if @featured %>
+<% form_tag({:action => 'show', :id => @project.id, :version_id =>@version.id, :board => @board,
:selected_team => @selected_team},
- :id => 'condensed_view_form') do %>
- <%= check_box_tag 'condensed', !@condensed, @condensed, :onchange => "$('condensed_view_form').submit();" %>
- <%= label_tag 'Condensed View' %>
- <% if @featured %>
- <%= check_box_tag 'show_bugs', !@show_bugs, @show_bugs, :id => "show_bugs",
- :onchange => (@bugs.nil? ? "$('condensed_view_form').submit();" : "") %>
+ :id => 'show_bugs_form') do %>
+ <%= check_box_tag 'show_bugs', !@show_bugs, @show_bugs, :id => "show_bugs",
+ :onchange => (@bugs.nil? ? "$('show_bugs_form').submit();" : "") %>
<%= label_tag 'Show Bugs' %>
<% end %>
<% end %>
</div>
<div style="float:right; min-width: 90px; padding: 10px;">
-
+
<%= link_to_if_authorized "<span>
#{image_tag('/plugin_assets/redmine_burndown/chart.png', :size => '20x20') }
</span>
- <span style='float: right; padding-top: 3px; padding-right: 5px;'>Show Chart </span>",
- { :controller => 'burndowns', :action => 'chart',
- :project_id => @version.project_id,
- :id => @version.id,
- :issue_filter => {:tracker => @tracker, :team => @team} },
+ <span style='float: right; padding-top: 3px; padding-right: 5px;'>Show Chart </span>",
+ { :controller => 'burndowns', :action => 'chart',
+ :project_id => @version.project_id,
+ :id => @version.id,
+ :issue_filter => {:tracker => @tracker, :team => @team} },
:id => 'showchart', :style => "display: none;" %>
<% end %>
@@ -120,7 +111,57 @@
<%= javascript_include_tag 'sticky_note', :plugin => 'scrum_task_board' %>
<%= javascript_include_tag 'jquery-ui-1.8.16.custom.js', :plugin => 'scrum_task_board' %>
<%= javascript_include_tag 'slimScroll.js', :plugin => 'scrum_task_board' %>
+ <script type="text/javascript">
+ jtoggleDetails = jQuery('.toggle_details');
+ jtoggleAll = jQuery("#toggle_all");
+ jtoggleAllLabel = jQuery("#toggle_all_label");
+ jcondensedCheck = jQuery("#toggle_condensed");
+
+ jtoggleAll.click(function(){
+ if(jQuery(this).is(":checked"))
+ {
+ jQuery(".current_data").show();
+ if (jtoggleDetails.hasClass("minimized"))
+ jtoggleDetails.removeClass("minimized").addClass("maximized");
+ }
+ else {
+ jQuery(".current_data").hide();
+ if (jtoggleDetails.hasClass("maximized"))
+ jtoggleDetails.removeClass("maximized").addClass("minimized");
+ }
+ });
+
+ //setting css() seems to be faster than hide() and show()
+ function condensedView(){
+ jQuery(".bulk_details").css('display', 'none');
+ jQuery(".taskboard_issues_list").addClass("condensed");
+ jQuery(".to_parent").css('display', 'none');
+ }
+
+ function normalView(){
+ jQuery(".bulk_details").css('display', 'block');
+ jQuery(".taskboard_issues_list").removeClass("condensed");
+ jQuery(".to_parent").css('display', 'inline');
+ }
+
+ function toggleCondensed() {
+ if(jcondensedCheck.is(":checked")) {
+ condensedView();
+ jtoggleAll.attr('checked', false);
+ jtoggleAll.attr('disabled', true);
+ jtoggleAllLabel.css('color', "#a1a1a1");
+ }
+ else {
+ normalView();
+ jtoggleAll.attr('disabled', false);
+ jtoggleAllLabel.css('color', "#303030");
+ if (jQuery(".current_data").is(":visible"))
+ jtoggleAll.attr('checked', true);
+ }
+ }
+ jcondensedCheck.click(toggleCondensed);
+ </script>
<table id="task_board" cellspacing="0">
<thead>
<tr>
@@ -149,7 +190,7 @@
<%= render :partial => "row", :locals => { :feature => child, :color => color } %>
<% end %>
<% end %>
-
+
<% unless @tasks.empty? %>
<tr id="other_issues" style="background: #cacaca">
<td><strong>Other Issues</strong></td>
@@ -157,7 +198,7 @@
<% default = @status_grouped[k][:default] %>
<% statuses = @status_grouped[k][:statuses] %>
<td id="<%= task_board_dom_id(nil, default) %>">
- <ul id="<%= task_board_dom_id(nil, default, 'list') %>" class="taskboard_issues_list <%= @condensed ? 'condensed' : '' %>">
+ <ul id="<%= task_board_dom_id(nil, default, 'list') %>" class="taskboard_issues_list ">
<% statuses.each do |status| %>
<%= render :partial => 'issue', :collection => Array(@tasks.group_by(&:status)[status]) %>
<% if @show_bugs %>
@@ -170,7 +211,7 @@
<% end %>
</tr>
<% end %>
-
+
<% else %>
<% unless @parent_bugs.compact.empty? %>
<% @parent_bugs.compact.each do |bug| %>
@@ -179,7 +220,7 @@
<% default = @status_grouped[k][:default] %>
<% statuses = @status_grouped[k][:statuses] %>
<td id="<%= task_board_dom_id(bug, default) %>">
- <ul id="<%= task_board_dom_id(bug, default, 'list') %>" class="taskboard_issues_list <%= @condensed ? 'condensed' : '' %>">
+ <ul id="<%= task_board_dom_id(bug, default, 'list') %>" class="taskboard_issues_list ">
<% statuses.each do |status| %>
<%= render :partial => 'issue', :collection => Array(bug.version_descendants(true).group_by(&:status)[status]),
:locals => {:descendant => true} %>
@@ -196,7 +237,7 @@
<% default = @status_grouped[k][:default] %>
<% statuses = @status_grouped[k][:statuses] %>
<td id="<%= task_board_dom_id(nil, default) %>">
- <ul id="<%= task_board_dom_id(nil, default, 'list') %>" class="taskboard_issues_list <%= @condensed ? 'condensed' : '' %>">
+ <ul id="<%= task_board_dom_id(nil, default, 'list') %>" class="taskboard_issues_list ">
<% statuses.each do |status| %>
<%= render :partial => 'issue', :collection => Array(@bugs.group_by(&:status)[status]) %>
<% end %>
@@ -205,7 +246,7 @@
</td>
<% end %>
</tr>
-
+
<% end %>
</tbody>
</table>
@@ -227,6 +268,7 @@
jQuery("#showchart").colorbox({opacity: 0.5, onComplete:function(){
plot_chart(jQuery.parseJSON(jQuery("#hidden_chart_data").val()));
}});
+
function filterByResource(){
var res_id = jQuery("#selected_resource option:selected").val();
if(jQuery("#filter_button").is(':hidden')){
@@ -264,7 +306,6 @@
});
}
}
-
</script>
<script type='text/javascript'>
//===========TOOLTIP===========
@@ -298,3 +339,4 @@
<% else %>
<p class="nodata"><%= @error_msg %></p>
<% end %>
+
View
85 assets/javascripts/fixedtableheader.js
@@ -1,33 +1,12 @@
function th_resize(count)
{
- var $item = jQuery("#task_board th:eq(" + count + ")");
- var width = $item.css('width');
- var height = $item.css('height');
+ var jitem = jQuery("#task_board th:eq(" + count + ")");
+ var width = jitem.css('width');
+ var height = jitem.css('height');
jQuery(".status-item:eq(" + count + ")").css('width', width).css('height', height);
}
jQuery(function( $ ){
-
- jToggleDetails = jQuery('.toggle_details');
- jQuery("#toggle_all").click(function(){
- if(jQuery(this).is(":checked"))
- {
- jQuery(".current_data").show();
- if (jToggleDetails.hasClass("minimized"))
- jToggleDetails.removeClass("minimized").addClass("maximized");
-// jQuery("#task_board ul.taskboard_issues_list").removeClass("min_ul");
-// jQuery("#task_board ul.taskboard_issues_list li.task_board_data").removeClass("min_li");
- }
- else
- {
- jQuery(".current_data").hide();
- if (jToggleDetails.hasClass("maximized"))
- jToggleDetails.removeClass("maximized").addClass("minimized");
-// jQuery("#task_board .taskboard_issues_list").addClass("min_ul");
-// jQuery("#task_board .taskboard_issues_list li.task_board_data").addClass("min_li");
- }
- });
-
//show/hide bugs
jQuery("#show_bugs").click(function() {
console.log("show_bugs_clicked");
@@ -40,71 +19,71 @@ jQuery(function( $ ){
filterBugs();
});
// 'Recreate' the table header since attributing a thead with position: fixed causes empty <td>s to lose their width
- var $mark = jQuery( "#task_board thead" );
- var $header = jQuery( "#fixed_table_header" );
-
+ var jmark = jQuery( "#task_board thead" );
+ var jheader = jQuery( "#fixed_table_header" );
+
var count = 0;
- var leftInit = $header.offset().left;
-
+ var leftInit = jheader.offset().left;
+
jQuery("#task_board th").each(function(){
- $header.append('<div class="status-item">'+ jQuery("#task_board th:eq("+ count +")").text() + '</div>');
+ jheader.append('<div class="status-item">'+ jQuery("#task_board th:eq("+ count +")").text() + '</div>');
th_resize(count);
count++;
});
-
+
//Declare the ff. 3 statements in that order
- var $first_item = jQuery('.status-item:eq(0)');
-
- function first_item_padding() { $first_item.css('padding-right', '0'); }
-
+ var jfirst_item = jQuery('.status-item:eq(0)');
+
+ function first_item_padding() { jfirst_item.css('padding-right', '0'); }
+
first_item_padding();
-
- var $view = $( window );
-// Adjusts the fixed header;call this when window is resized or when a DOM element is inserted or removed
- function th_adjust()
+
+ var jview = $( window );
+// Adjusts the fixed header;call this when window is resized or when a DOM element is inserted or removed
+ function th_adjust()
{
var count = 0
jQuery("#task_board th").each(function(){
th_resize(count);
count++;
});
-
+
first_item_padding();
}
// Bind to the window scroll and resize events. Remember, resizing can also change the scroll of the page.
- $view.bind(
+ jview.bind(
"scroll resize",
function(){
// Get the current offset of the marker(<thead>).
- var markTop = $mark.offset().top;
+ var markTop = jmark.offset().top;
// Get the current scroll of the window.
- var viewTop = $view.scrollTop();
-
+ var viewTop = jview.scrollTop();
+
// Check to see if the view had scroll down past the top of the marker
if (viewTop > markTop)
{
- $header.show();
- }
+ jheader.show();
+ }
// Check to see if the view has scroll back up above the message
else if (viewTop <= markTop)
{
- $header.hide();
+ jheader.hide();
}
-// Allow the fixed header to scroll horizontally
- $header.offset({
+// Allow the fixed header to scroll horizontally
+ jheader.offset({
left: leftInit + 12
});
}
);
////Resize window
-$view.resize(function(){
+jview.resize(function(){
th_adjust();
});
-///Jump to row
+///Jump to row
jQuery(".to_parent").click(function()
{
var tr = jQuery(this).attr('href');
@@ -118,10 +97,10 @@ $view.resize(function(){
}, 200);
});
-// DOM element is inserted or removed(http://stackoverflow.com/questions/4979738/fire-jquery-event-on-div-change)
+// DOM element is inserted or removed(http://stackoverflow.com/questions/4979738/fire-jquery-event-on-div-change)
jQuery("#task_board").bind('DOMNodeInserted DOMNodeRemoved', function(event) {
th_adjust();
- });
+ });
});
// script modified from http://www.bennadel.com/blog/1810-Creating-A-Sometimes-Fixed-Position-Element-With-jQuery.htm
Please sign in to comment.
Something went wrong with that request. Please try again.