gitlabhq/app/helpers/projects_helper.rb
Nihad Abbasov d62200cad4 clean-up code
* Remove trailing whitespace
  * Converts hard-tabs into two-space soft-tabs
  * Remove consecutive blank lines
2011-10-26 18:46:25 +05:00

19 lines
419 B
Ruby

module ProjectsHelper
def view_mode_style(type)
cookies["project_view"] ||= "tile"
cookies["project_view"] == type ? nil : "display:none"
end
def load_note_parent(id, type, project)
case type
when "Issue" then @project.issues.find(id)
when "Commit" then @project.repo.commits(id).first
when "Snippet" then @project.snippets.find(id)
else
true
end
rescue
nil
end
end