Skip to content

Commit

Permalink
Added 'for' labels to tasks sidebar checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dvorkin committed Aug 29, 2010
1 parent cb6037d commit 9a99d45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/helpers/tasks_helper.rb
Expand Up @@ -23,7 +23,7 @@ module TasksHelper
def task_filter_checbox(view, filter, count)
name = "filter_by_task_#{view}"
checked = (session[name] ? session[name].split(",").include?(filter.to_s) : count > 0)
check_box_tag("filters[]", filter, checked, :onclick => remote_function(:url => { :action => :filter, :view => view }, :with => "{filter: this.value, checked:this.checked}" ))
check_box_tag("filters[]", filter, checked, :id => "filter_#{filter}", :onclick => remote_function(:url => { :action => :filter, :view => view }, :with => "{filter: this.value, checked:this.checked}" ))
end

#----------------------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions app/views/tasks/_sidebar_index.html.haml
Expand Up @@ -5,13 +5,15 @@
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
= @task_total[key]
= task_filter_checbox(@view, key, @task_total[key]) << " " << t(value)
= task_filter_checbox(@view, key, @task_total[key])
= label_tag("filter_#{key}", t(value))
- else # @view == "completed"
- Setting.unroll(:task_completed).each do |value, key|
.check_box{:style => "border-bottom: 1px silver dotted;"}
%div{:style => "float:right;"}
= @task_total[key]
= task_filter_checbox(@view, key, @task_total[key]) << " " << t(value)
= task_filter_checbox(@view, key, @task_total[key])
= label_tag("filter_#{key}", t(value))
.check_box
%div{:style => "float:right;"}
%b= @task_total[:all]
Expand Down

0 comments on commit 9a99d45

Please sign in to comment.