Permalink
Browse files

Bulk commit - Clean up dashboard, fix inline bugs condensed view

  • Loading branch information...
1 parent 3766738 commit ade7e8547be64bcb3820b377345cc0bcbd52745a @den-plugins committed Jan 2, 2012
@@ -6,7 +6,7 @@
@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>
+<h2 id="taskboard-header"><%= html_title "#{@project.name} - Task board" -%></h2>
<div id="version_container">
<% form_for :state_filter, :url => {:controller => "task_boards", :action => "index"} do |f| %>
@@ -40,9 +40,9 @@ Filter by: <%= select_tag "state", options_for_select(Version::STATES.collect {|
:version_id => v.id,
:board => 2,
: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>
+ <br/>
+ <span class="total">Total Estimated Effort: <strong><%= v.total_estimated_effort%></strong> <%= l(:field_sp_hours) %></span><br/>
+ <span class="total">Total Remaining Effort: <strong><%= v.total_remaining_effort%></strong> <%= l(:field_sp_hours) %></span>
</li>
@@ -30,34 +30,53 @@
</style>
<% end %>
-
-<h2>
- <%= @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>
+<!--- START-------------------------------------------------------------------------------------------------------------->
+<h2 id="taskboard-header">
+ <%= @version.nil? ? "Product Backlog" : @version.name %>
</h2>
-<% if @version.completed? %><% elsif @version.effective_date %>
- <h4 style="border-bottom:none;margin-top:-10px;"><%= due_date_distance_in_words(@version.effective_date) if !@version.effective_date.nil? %></h4>
-<% end %>
-<div>
- <%= link_to "Features: ", :controller => "task_boards",:action => "show", :version_id => @version.id, :board => 1,:id => @project.id %>
- <%= "<span style='color: #0EA94B'>#{@version.feature_counter}</span></br>" %>
- <%= link_to "Tasks: ", :controller => "task_boards",:action => "show", :version_id => @version.id, :board => 1,:id => @project.id %>
- <%= "<span style='color:#5081AA'>#{@version.task_counter}</span>" %><br/>
- <%= link_to "Bugs: ",:controller => "task_boards",:action => "show",:version_id => @version.id,:board => 2, :id => @project.id %>
- <%= "<span style='color: red'>#{@version.bug_counter}</span><br/>" %>
- <span class='effortLabel'>Total Estimated Effort:</span> <strong><%= @version.total_estimated_effort%></strong> <span class='effortLabel'><%= l(:field_sp_hours) %></span></br>
- <span class='effortLabel'>Total Remaining Effort:</span> <strong><%= @version.total_remaining_effort %></strong> <span class='effortLabel'><%= l(:field_sp_hours) %></span></br>
-</div>
-<% unless @nodata_to_filter %>
-<div style="float:left; width: 70%; padding: 10px;">
- <span style="padding-right:20px;">
+<div class="row">
+
+ <div class="first block">
+ <strong>Target Date:</strong><%= format_date(@version.effective_date) unless @version.effective_date.nil? %><br/>
+ <% if @version.completed? %>
+ <% elsif @version.effective_date %>
+ <em><%= due_date_distance_in_words(@version.effective_date) if !@version.effective_date.nil? %></em>
+ <% end %>
+ </div>
+
+ <div class="block">
+ <span class="label">Features:</span>
+ <%= link_to "<span style='color: #0EA94B'>#{@version.feature_counter}</span>",
+ :controller => "task_boards",:action => "show", :version_id => @version.id, :board => 1,:id => @project.id %>
+ <br/>
+ <span class="label">Tasks:</span>
+ <%= link_to "<span style='color:#5081AA'>#{@version.task_counter}</span>",
+ :controller => "task_boards",:action => "show", :version_id => @version.id, :board => 1,:id => @project.id %>
+ <br/>
+ <span class="label">Bugs:</span>
+ <%= link_to "<span style='color: red'>#{@version.bug_counter}</span>",
+ :controller => "task_boards",:action => "show",:version_id => @version.id,:board => 2, :id => @project.id %>
+ </div>
+
+
+ <div class="block">
+ <span class="label">Total Estimated Effort:</span>
+ <strong><%= @version.total_estimated_effort%></strong> <%= l(:field_sp_hours) %><br/>
+ <span class="label">Total Remaining Effort:</span>
+ <strong><%= @version.total_remaining_effort %></strong> <%= l(:field_sp_hours) %>
+ </div>
+
+ <div class="filter-box-view">
+ <% unless @nodata_to_filter %>
<% 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 %>
+ <%= submit_tag 'Filter', :id => "filter_button", :style => "display: none;" %>
<% 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),
:onchange => "$('filter_button').show();" %>
+ <br/>
<% end %>
<% resource_blank = (["", "All", "Select a resource..."].member? @selected_resource)? ["Select a resource..."] : ["All"] %>
@@ -66,41 +85,40 @@
#{resource_blank}
</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 %>
- <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 %>
-<% if @featured %>
-<% form_tag({:action => 'show', :id => @project.id, :version_id =>@version.id, :board => @board,
- :selected_team => @selected_team},
- :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>",
+ <% end %>
+ <br/>
+ <% unless @error_msg %>
+ <button type="button" class="buttons activated" id="detailed">Detailed View</button>
+ <button type="button" class="buttons" id="condensed">Condensed View</button>
+ <% if !@bugs.nil? and @featured %>
+ <% unless @show_bugs %>
+ <%= link_to_if_authorized "Show Bugs",
+ { :controller => 'task_boards', :action => 'show',
+ :id => @project.id,
+ :version_id =>@version.id,
+ :board => @board,
+ :selected_team => @selected_team,
+ :show_bugs => true },
+ :id => 'showbugs', :class => "buttons" %>
+ <% else %>
+ <button type="button" class="buttons" id="hidebugs">Hide Bugs</button>
+ <% end %>
+ <% end %>
+ <%= link_to_if_authorized "Show Chart",
{ :controller => 'burndowns', :action => 'chart',
:project_id => @version.project_id,
:id => @version.id,
:issue_filter => {:tracker => @tracker, :team => @team} },
- :id => 'showchart', :style => "display: none;" %>
+ :id => 'showchart', :class => "buttons disabled" %>
+ <% end %>
-<% end %>
+ </div>
</div>
+
+<!--------------------------------------------------------------------------------------------------------------END --->
+
+
<div class="clear"></div>
<% end %>
<div id="bdchart"></div>
@@ -112,13 +130,34 @@
<%= 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">
- jtoggleAll = jQuery("#toggle_all");
- jtoggleAllLabel = jQuery("#toggle_all_label");
- jcondensedCheck = jQuery("#toggle_condensed");
+ var showbugs = <%= (@bugs and @featured) or false %>;
+ jtoggleAll = jQuery("#detailed");
+ jcondensed = jQuery("#condensed");
+
+ jQuery(".buttons").not("#showchart").click(function(){
+ if(!jQuery(this).hasClass("disabled"))
+ jQuery(this).toggleClass("activated");
+ });
+
+ jQuery("#showbugs").click(function(){
+ jQuery(this).text("Loading...").addClass("disabled").css("color", "#4e4e4e");
+ });
+
+ jQuery("#hidebugs").click(function(){
+ if(jQuery(this).html() === "Hide Bugs") {
+ jQuery(".isBug").css("display", "none");
+ jQuery(this).html("Show Bugs");
+ }
+ else {
+ var display = (jQuery("#condensed").hasClass("activated")) ? "inline-block" : "list-item";
+ jQuery(".isBug").css("display", display);
+ jQuery(this).html("Hide Bugs");
+ }
+ });
jtoggleAll.click(function(){
jtoggleDetails = jQuery('.toggle_details');
- if(jQuery(this).is(":checked"))
+ if(jQuery(this).hasClass("activated"))
{
jQuery(".current_data").show();
if (jtoggleDetails.hasClass("minimized"))
@@ -136,33 +175,32 @@
jQuery(".bulk_details").css('display', 'none');
jQuery(".taskboard_issues_list").addClass("condensed");
jQuery(".to_parent").css('display', 'none');
- toggleBugs();
+ if(showbugs)
+ jQuery(".isBug").addClass("condensed").css("display", "inline-block");
}
function normalView(){
jQuery(".bulk_details").css('display', 'block');
jQuery(".taskboard_issues_list").removeClass("condensed");
jQuery(".to_parent").css('display', 'inline');
- toggleBugs();
+ if(showbugs)
+ jQuery(".isBug").removeClass("condensed").css("display", "list-item");
}
function toggleCondensed() {
- if(jcondensedCheck.is(":checked")) {
+ if(jcondensed.hasClass("activated")) {
condensedView();
- jtoggleAll.attr('checked', false);
- jtoggleAll.attr('disabled', true);
- jtoggleAllLabel.css('color', "#a1a1a1");
+ jQuery("#detailed").attr("disabled", true).addClass("disabled");
}
else {
normalView();
- jtoggleAll.attr('disabled', false);
- jtoggleAllLabel.css('color', "#303030");
+ jQuery("#detailed").attr("disabled", false).removeClass("disabled");
if (jQuery(".current_data").is(":visible"))
- jtoggleAll.attr('checked', true);
+ jtoggleAll.addClass("activated");
}
}
- jcondensedCheck.click(toggleCondensed);
+ jcondensed.click(toggleCondensed);
</script>
<table id="task_board" cellspacing="0">
<thead>
@@ -264,41 +302,26 @@
<%= javascript_include_tag 'chart.js', :plugin => 'redmine_burndown' %>
<script type="text/javascript">
- jQuery(document).ready(function(){
- jQuery("#showchart").show();
- toggleBugs();
- });
- 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')){
if(jQuery.inArray(res_id, ["", "All", "Select a resource..."]) != -1){
jQuery('#selected_resource_blank').val('Select a resource...');
jQuery('#selected_resource_blank').text('Select a resource...');
jQuery('.task_board_data').show();
- toggleBugs();
- }else{
+ }
+ else{
jQuery('#selected_resource_blank').val('All');
jQuery('#selected_resource_blank').text('All');
jQuery('.task_board_data').hide();
jQuery('.assigned_to_' + res_id).show();
- toggleBugs();
}
filterBugs();
}else{
return "";
}
}
- function toggleBugs(){
- if (jQuery("#show_bugs").is(":checked")){
- jQuery('.isBug').show();
- }else{
- jQuery('.isBug').hide();
- }
- }
+
function filterBugs(){
var res_id = jQuery("#selected_resource option:selected").val();
if(jQuery.inArray(res_id, ["", "All", "Select a resource..."]) == -1){
@@ -7,17 +7,10 @@ function th_resize(count)
}
jQuery(function( $ ){
- //show/hide bugs
- jQuery("#show_bugs").click(function() {
- console.log("show_bugs_clicked");
- if (jQuery(this).is(":checked")) {
- jQuery('.isBug').show();
- }
- else {
- jQuery('.isBug').hide();
- }
- filterBugs();
- });
+ //enable show chart
+ jQuery("#showchart").attr("disabled", false).removeClass("disabled").colorbox({opacity: 0.5, onComplete:function() {
+ plot_chart(jQuery.parseJSON(jQuery("#hidden_chart_data").val()));
+ }});
// 'Recreate' the table header since attributing a thead with position: fixed causes empty <td>s to lose their width
var jmark = jQuery( "#task_board thead" );
var jheader = jQuery( "#fixed_table_header" );
Oops, something went wrong.

0 comments on commit ade7e85

Please sign in to comment.