diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 21d6d868..39c591e4 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -120,18 +120,6 @@ module ApplicationHelper link_to( descriptor, project, :title => "View project: #{project.name}" ) end - def link_to_edit_project (project, descriptor = sanitize(project.name)) - link_to(descriptor, - url_for({:controller => 'projects', :action => 'edit', :id => project.id}), - {:id => "link_edit_#{dom_id(project)}", :class => "project_edit_settings icon"}) - end - - def link_to_edit_context (context, descriptor = sanitize(context.name)) - link_to(descriptor, - url_for({:controller => 'contexts', :action => 'edit', :id => context.id}), - {:id => "link_edit_#{dom_id(context)}", :class => "context_edit_settings"}) - end - def link_to_edit_note (note, descriptor = sanitize(note.id.to_s)) link_to(descriptor, url_for({:controller => 'notes', :action => 'edit', :id => note.id}), diff --git a/app/helpers/contexts_helper.rb b/app/helpers/contexts_helper.rb index 1b512689..10d9d9e8 100644 --- a/app/helpers/contexts_helper.rb +++ b/app/helpers/contexts_helper.rb @@ -1,30 +1,38 @@ module ContextsHelper + + def get_listing_sortable_options + { + :tag => 'div', + :handle => 'handle', + :complete => visual_effect(:highlight, 'list-contexts'), + :url => order_contexts_path + } + 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 get_listing_sortable_options - { - :tag => 'div', - :handle => 'handle', - :complete => visual_effect(:highlight, 'list-contexts'), - :url => order_contexts_path - } -end + def link_to_edit_context (context, descriptor = sanitize(context.name)) + link_to(descriptor, + url_for({:controller => 'contexts', :action => 'edit', :id => context.id}), + { + :id => "link_edit_#{dom_id(context)}", + :class => "context_edit_settings icon" + }) + 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", - :x_confirm_message => t('contexts.delete_context_confirmation', :name => context.name), - :title => t('contexts.delete_context_title') - } - ) -end - -def summary(context, undone_todo_count) - content_tag(:p, "#{undone_todo_count}. Context is #{context.hidden? ? 'Hidden' : 'Active'}.") -end + + def summary(context, undone_todo_count) + content_tag(:p, "#{undone_todo_count}. Context is #{context.hidden? ? 'Hidden' : 'Active'}.") + end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index ddab5ba2..758c9c2f 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -58,6 +58,15 @@ module ProjectsHelper ) end + def link_to_edit_project (project, descriptor = sanitize(project.name)) + link_to(descriptor, + url_for({:controller => 'projects', :action => 'edit', :id => project.id}), + { + :id => "link_edit_#{dom_id(project)}", + :class => "project_edit_settings icon" + }) + end + def summary(project) project_description = '' project_description += sanitize(markdown( project.description )) unless project.description.blank? diff --git a/app/views/contexts/_context_listing.rhtml b/app/views/contexts/_context_listing.rhtml index b98a0f51..b865bcca 100644 --- a/app/views/contexts/_context_listing.rhtml +++ b/app/views/contexts/_context_listing.rhtml @@ -1,29 +1,17 @@ -<% context = context_listing +<% +context = context_listing suppress_drag_handle ||= false suppress_edit_button ||= false +suppress_delete_button ||= false %>