Module: ProjectsHelper

Defined in:
app/helpers/projects_helper.rb

Instance Method Summary collapse

Instance Method Details



47
48
49
# File 'app/helpers/projects_helper.rb', line 47

def link_to_delete_project(project, descriptor = sanitize(project.name))
  link_to_delete(:project, project, descriptor)
end


51
52
53
# File 'app/helpers/projects_helper.rb', line 51

def link_to_edit_project (project, descriptor = sanitize(project.name))
  link_to_edit(:project, project, descriptor)
end

#needsreview_class(item) ⇒ Object



42
43
44
45
# File 'app/helpers/projects_helper.rb', line 42

def needsreview_class(item)
  raise "item must be a Project " unless item.kind_of? Project
  return item.needs_review?(current_user) ? "needsreview" : "needsnoreview"
end

#project_next_prevObject



17
18
19
20
21
22
23
24
25
# File 'app/helpers/projects_helper.rb', line 17

def project_next_prev
  (:div, :id=>"project-next-prev") do
    html = ""
    html << link_to_project(@previous_project, "&laquo; #{@previous_project.shortened_name}".html_safe) if @previous_project
    html << " | " if @previous_project && @next_project
    html << link_to_project(@next_project, "#{@next_project.shortened_name} &raquo;".html_safe) if @next_project
    html.html_safe
  end
end

#project_next_prev_mobileObject



27
28
29
30
31
32
# File 'app/helpers/projects_helper.rb', line 27

def project_next_prev_mobile
  prev_project,next_project= "", ""
  prev_project = (:li, link_to_project_mobile(@previous_project, "5", @previous_project.shortened_name), :class=>"prev") if @previous_project
  next_project = (:li, link_to_project_mobile(@next_project, "6", @next_project.shortened_name), :class=>"next") if @next_project
  return (:ul, "#{prev_project}#{next_project}".html_safe, :class=>"next-prev-project")
end

#project_summary(project) ⇒ Object



34
35
36
37
38
39
40
# File 'app/helpers/projects_helper.rb', line 34

def project_summary(project)
  project_description = ''
  project_description += Tracks::Utils.render_text( project.description ) if project.description.present?
  project_description += (:p,
    "#{count_undone_todos_phrase(p)}. #{t('projects.project_state', :state => project.state)}".html_safe
    )
end

#show_project_name(project) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/projects_helper.rb', line 3

def show_project_name(project)
  if source_view_is :project
    (:span, :id => "project_name"){project.name}
  else
    link_to_project( project )
  end
end

#show_project_settings(project) ⇒ Object



11
12
13
14
15
# File 'app/helpers/projects_helper.rb', line 11

def show_project_settings(project)
  (:div, :id => dom_id(project, "container"), :class=>"list") do
    render :partial => "projects/project_settings", :object => project
  end
end