2007-03-30 04:36:52 +00:00
|
|
|
module ContextsHelper
|
2013-03-05 14:04:01 +01:00
|
|
|
def show_context_name(context)
|
|
|
|
|
if source_view_is :context
|
|
|
|
|
content_tag(:span, :id => "context_name"){context.name}
|
|
|
|
|
else
|
|
|
|
|
link_to_context( context )
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-08-14 21:05:05 -05:00
|
|
|
|
2012-03-21 18:09:20 +01:00
|
|
|
def link_to_delete_context(context, descriptor = sanitize(context.name))
|
2014-08-14 21:05:05 -05:00
|
|
|
link_to_delete(:context, context, descriptor)
|
2012-03-21 18:09:20 +01:00
|
|
|
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))
|
2013-05-05 20:32:32 +02:00
|
|
|
link_to_edit(:context, context, descriptor)
|
2012-03-21 18:09:20 +01:00
|
|
|
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
|