Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "hide done tasks" checkbox on the taskboard #1054

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/views/rb_taskboards/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<%- end %>

<%- content_for :view_specific_links do %>
<span id="hide_done"><input id="hide_done_cb" name="hide_done" type="checkbox"/> <%= l(:label_hide_done) %></span>
<% if @sprint.has_burndown? %>
<a id='show_charts'><%= l(:label_burndown) %></a>
<% end %>
Expand Down
29 changes: 29 additions & 0 deletions assets/javascripts/taskboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ RB.Taskboard = RB.Object.create({
self.updateColWidths();
RB.$("#col_width input").bind('keyup', function(e){ if(e.which==13) self.updateColWidths(); });

RB.$( "#hide_done_cb" ).change(function() {
self.showHideDoneTasks(RB.$("#hide_done_cb").is(":checked"));
});
$( document ).ready(function() {
self.initShowHideDoneTasks();
});

//initialize mouse handling for drop handling
j.bind('mousedown.taskboard', function(e) { return self.onMouseDown(e); });
j.bind('mouseup.taskboard', function(e) { return self.onMouseUp(e); });
Expand Down Expand Up @@ -205,6 +212,28 @@ RB.Taskboard = RB.Object.create({
RB.$("#col_width input").val(w);
RB.UserPreferences.set('taskboardColWidth', w);
RB.$(".swimlane").width(this.colWidthUnit * w).css('min-width', this.colWidthUnit * w);
},

showHideDoneTasks: function(cbValue){
var display = 'none';
if (! cbValue) {
display = "block";
}
RB.$(".story-swimlane .swimlane .closed").css('display',display);
RB.UserPreferences.set('hideDoneTasks', cbValue);
},

initShowHideDoneTasks: function(){
var val = RB.UserPreferences.get('hideDoneTasks');
if (!val) { // 0, null, undefined.
val = false;
RB.UserPreferences.set('hideDoneTasks', val);
}
var hideDoneTasks = val == 'true' ? true : false;

$('#hide_done_cb').prop('checked', hideDoneTasks);

this.showHideDoneTasks(hideDoneTasks);
}
});

Expand Down
1 change: 1 addition & 0 deletions config/locales/en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ en-GB:
label_close_completed_sprints: "Close completed Sprints"
label_closed_releases: "Closed releases"
label_column_width: "Column width"
label_hide_done: "Hide 'Done' Tasks"
label_download_sprint: Download
label_filter_tasks: "Filter by user"
label_filter_tasks_my_tasks: "Filter by user - my tasks"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ en:
label_close_completed_sprints: "Close completed Sprints"
label_closed_releases: "Closed releases"
label_column_width: "Column width"
label_hide_done: "Hide 'Done' Tasks"
label_download_sprint: Download
label_filter_tasks: "Filter by user"
label_filter_tasks_my_tasks: "Filter by user - my tasks"
Expand Down