gitlabhq/app/helpers/projects_helper.rb
Dmitriy Zaporozhets 6b030fd41d 1.1pre1
2011-10-21 20:04:41 +03:00

18 lines
420 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