module ProjectsHelper

File

projects_helper.rb

(C)

Hipposoft 2008

Purpose

Support functions for views related to Project objects. See controllers/projects_controller.rb for more.


04-Jan-2008 (ADH): Created.

Public Instance Methods

projecthelp_actions( project ) click to toggle source

Return list actions appropriate for the given project

# File app/helpers/projects_helper.rb, line 23
def projecthelp_actions( project )
  if ( @current_user.admin? or ( project.active and @current_user.manager? ) )
    actions = [ 'edit', 'delete' ]
  else
    actions = []
  end

  actions.push( 'show' )
  return actions
end
projecthelp_customer( project ) click to toggle source

Return a name of a given project’s associated customer, for use in list views.

# File app/helpers/projects_helper.rb, line 16
def projecthelp_customer( project )
  return '-'.html_safe() if ( project.customer.nil? )
  return apphelp_augmented_link( project.customer )
end