2007-03-30 04:36:52 +00:00
|
|
|
module ContextsHelper
|
2012-03-21 18:09:20 +01:00
|
|
|
|
|
|
|
|
def link_to_delete_context(context, descriptor = sanitize(context.name))
|
|
|
|
|
link_to(descriptor,
|
|
|
|
|
context_path(context, :format => 'js'),
|
|
|
|
|
{
|
|
|
|
|
:id => "delete_context_#{context.id}",
|
|
|
|
|
:class => "delete_context_button icon",
|
|
|
|
|
:x_confirm_message => t('contexts.delete_context_confirmation', :name => context.name),
|
|
|
|
|
:title => t('contexts.delete_context_title')
|
|
|
|
|
})
|
|
|
|
|
end
|
2007-03-30 04:36:52 +00:00
|
|
|
|
2012-03-21 18:09:20 +01:00
|
|
|
def link_to_edit_context (context, descriptor = sanitize(context.name))
|
2012-07-12 13:14:21 +02:00
|
|
|
link_to(descriptor, edit_context_path(context),
|
2012-03-21 18:09:20 +01:00
|
|
|
{
|
|
|
|
|
:id => "link_edit_#{dom_id(context)}",
|
|
|
|
|
:class => "context_edit_settings icon"
|
|
|
|
|
})
|
|
|
|
|
end
|
2011-05-01 12:48:32 +02:00
|
|
|
|
2012-04-19 15:31:18 +02:00
|
|
|
def context_summary(context, undone_todo_count)
|
|
|
|
|
content_tag(:p, "#{undone_todo_count}. Context is #{context.hidden? ? 'Hidden' : 'Active'}.".html_safe)
|
2012-03-21 18:09:20 +01:00
|
|
|
end
|
2007-03-30 04:36:52 +00:00
|
|
|
|
|
|
|
|
end
|