small refactorings

This commit is contained in:
Reinier Balt 2012-07-12 13:14:21 +02:00
parent 7d0c716366
commit 82bb67f518
6 changed files with 61 additions and 130 deletions

View file

@ -1,22 +1,5 @@
module ProjectsHelper
def get_listing_sortable_options(list_container_id)
{
:tag => 'div',
:handle => 'handle',
:complete => visual_effect(:highlight, list_container_id),
:url => order_projects_path
}
end
def set_element_visible(id,test)
if (test)
page.show id
else
page.hide id
end
end
def project_next_prev
html = ""
if @previous_project
@ -33,11 +16,11 @@ module ProjectsHelper
def project_next_prev_mobile
prev_project,next_project= "", ""
unless @previous_project.nil?
if @previous_project
project_name = truncate(@previous_project.name, :length => 40, :omission => "...")
prev_project = content_tag(:li, link_to_project_mobile(@previous_project, "5", project_name), :class=>"prev")
end
unless @next_project.nil?
if @next_project
project_name = truncate(@next_project.name, :length => 40, :omission => "...")
next_project = content_tag(:li, link_to_project_mobile(@next_project, "6", project_name), :class=>"next")
end
@ -58,8 +41,7 @@ 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}),
link_to(descriptor, edit_project_path(project),
{
:id => "link_edit_#{dom_id(project)}",
:class => "project_edit_settings icon"
@ -72,7 +54,6 @@ module ProjectsHelper
project_description += content_tag(:p,
"#{count_undone_todos_phrase(p)}. #{t('projects.project_state', :state => project.state)}".html_safe
)
raw project_description
end
def needsreview_class(item)