Module: RecurringTodosHelper

Defined in:
app/helpers/recurring_todos_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_tag_for_deleteObject (private)



40
41
42
# File 'app/helpers/recurring_todos_helper.rb', line 40

def image_tag_for_delete
  image_tag("blank.png", :title =>t('todos.delete_action'), :class=>"delete_item")
end

#image_tag_for_edit(todo) ⇒ Object (private)



44
45
46
# File 'app/helpers/recurring_todos_helper.rb', line 44

def image_tag_for_edit(todo)
  image_tag("blank.png", :title =>t('todos.edit_action'), :class=>"edit_item", :id=> dom_id(todo, 'edit_icon'))
end

#recurring_todo_remote_delete_iconObject



11
12
13
14
15
# File 'app/helpers/recurring_todos_helper.rb', line 11

def recurring_todo_remote_delete_icon
  link_to( image_tag_for_delete,
    recurring_todo_path(@recurring_todo), :id => "delete_icon_"+@recurring_todo.id.to_s,
    :class => "icon delete_icon", :title => t('todos.delete_recurring_action_title'), :x_confirm_message => t('todos.delete_recurring_action_confirm', :description => @recurring_todo.description))
end

#recurring_todo_remote_edit_iconObject



23
24
25
26
27
28
29
30
31
32
# File 'app/helpers/recurring_todos_helper.rb', line 23

def recurring_todo_remote_edit_icon
  if !@recurring_todo.completed?
    str = link_to( image_tag_for_edit(@recurring_todo),
      edit_recurring_todo_path(@recurring_todo),
      :class => "icon edit_icon", :id => "link_edit_recurring_todo_#{@recurring_todo.id}")
  else
    str = (:a, image_tag("blank.png"), :class => "icon")
  end
  str
end

#recurring_todo_remote_star_iconObject



17
18
19
20
21
# File 'app/helpers/recurring_todos_helper.rb', line 17

def recurring_todo_remote_star_icon
  link_to( image_tag_for_star(@recurring_todo),
    toggle_star_recurring_todo_path(@recurring_todo), :id => "star_icon_"+@recurring_todo.id.to_s,
    :class => "icon star_item", :title => t('todos.star_action'))
end

#recurring_todo_remote_toggle_checkboxObject



34
35
36
# File 'app/helpers/recurring_todos_helper.rb', line 34

def recurring_todo_remote_toggle_checkbox
  return check_box_tag("check_#{@recurring_todo.id}", toggle_check_recurring_todo_path(@recurring_todo), @recurring_todo.completed?, :class => 'item-checkbox')
end

#recurring_todo_tag_listObject



3
4
5
6
7
8
9
# File 'app/helpers/recurring_todos_helper.rb', line 3

def recurring_todo_tag_list
  tags_except_starred = @recurring_todo.tags.reject{|t| t.name == Todo::STARRED_TAG_NAME}
  tag_list = tags_except_starred.
    collect{|t| (:span,link_to(t.name, tag_path(t.name)), :class => "tag #{t.label}")}.
    join('')
  return  :span, tag_list.html_safe, :class => "tags"
end