gitlabhq/app/helpers/projects_helper.rb

19 lines
509 B
Ruby
Raw Normal View History

2011-10-08 23:36:38 +02:00
module ProjectsHelper
2011-10-11 22:00:00 +02:00
def view_mode_style(type)
cookies["project_view"] ||= "tile"
cookies["project_view"] == type ? nil : "display:none"
end
2011-10-18 13:33:30 +02:00
def noteable_link(id, type, project)
case type
when "Issue"
link_to "Issue ##{id}", project_issue_path(project, id)
when "Commit"
commit = project.repo.commits(id).first
link_to truncate(commit.id,:length => 10), project_commit_path(project, id)
else
link_to "Wall", wall_project_path(project)
end
end
2011-10-08 23:36:38 +02:00
end