mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-16 15:20:13 +01:00
* new menu item in view menu * js to toggle view * store setting in cookie to keep de choice of view persistent * refactor index and tag page of todos to look more alike * refactor context and project partials to look more alike
34 lines
1 KiB
Ruby
34 lines
1 KiB
Ruby
module ContextsHelper
|
|
|
|
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
|
|
|
|
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
|
|
|
|
def link_to_edit_context (context, descriptor = sanitize(context.name))
|
|
link_to(descriptor, edit_context_path(context),
|
|
{
|
|
:id => "link_edit_#{dom_id(context)}",
|
|
:class => "context_edit_settings icon"
|
|
})
|
|
end
|
|
|
|
def context_summary(context, undone_todo_count)
|
|
content_tag(:p, "#{undone_todo_count}. Context is #{context.hidden? ? 'Hidden' : 'Active'}.".html_safe)
|
|
end
|
|
|
|
end
|