adds language names to projects list github style

This commit is contained in:
tiagonbotelho 2016-02-28 17:27:22 +00:00 committed by Yorick Peterse
parent 903aa7c95e
commit 73535b80b2
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -28,6 +28,9 @@
= project.name
.controls
- if project.main_language
%span
= project.main_language
- if ci_commit
%span
= render_ci_status(ci_commit)