gitlabhq/app/helpers/projects_helper.rb

19 lines
420 B
Ruby
Raw Normal View History

2011-10-13 03:00:00 +02:00
module ProjectsHelper
def view_mode_style(type)
cookies["project_view"] ||= "tile"
cookies["project_view"] == type ? nil : "display:none"
end
2011-10-21 19:04:41 +02:00
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
2011-10-13 03:00:00 +02:00
end