2011-10-08 17:36:38 -04:00
|
|
|
module ProjectsHelper
|
2011-10-11 16:00:00 -04:00
|
|
|
def view_mode_style(type)
|
|
|
|
cookies["project_view"] ||= "tile"
|
|
|
|
cookies["project_view"] == type ? nil : "display:none"
|
|
|
|
end
|
2011-10-18 07:33:30 -04:00
|
|
|
|
2011-10-18 10:44:43 -04:00
|
|
|
def load_note_parent(id, type, project)
|
2011-10-18 07:33:30 -04:00
|
|
|
case type
|
2011-10-18 10:44:43 -04:00
|
|
|
when "Issue" then @project.issues.find(id)
|
|
|
|
when "Commit" then @project.repo.commits(id).first
|
2011-10-19 13:41:14 -04:00
|
|
|
when "Snippet" then @project.snippets.find(id)
|
2011-10-18 07:33:30 -04:00
|
|
|
else
|
2011-10-18 10:44:43 -04:00
|
|
|
true
|
2011-10-18 07:33:30 -04:00
|
|
|
end
|
2011-10-26 09:46:25 -04:00
|
|
|
rescue
|
2011-10-18 10:44:43 -04:00
|
|
|
nil
|
2011-10-18 07:33:30 -04:00
|
|
|
end
|
2011-11-25 18:42:42 -05:00
|
|
|
|
2011-12-30 15:56:13 -05:00
|
|
|
def repository_tab_class
|
2012-02-20 01:39:03 -05:00
|
|
|
end
|
|
|
|
|
2011-10-08 17:36:38 -04:00
|
|
|
end
|