提交 73535b80 编写于 作者: T tiagonbotelho 提交者: Yorick Peterse

adds language names to projects list github style

上级 903aa7c9
......@@ -945,4 +945,13 @@ class Project < ActiveRecord::Base
def wiki
@wiki ||= ProjectWiki.new(self, self.owner)
end
def main_language
if !empty_repo?
languages = Linguist::Repository.new(
@repository.rugged,
@repository.rugged.head.target_id).languages
return languages.key(languages.values.max)
end
end
end
......@@ -28,6 +28,9 @@
= project.name
.controls
- if project.main_language
%span
= project.main_language
- if ci_commit
%span
= render_ci_status(ci_commit)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册