Commit 73535b80 authored by tiagonbotelho's avatar tiagonbotelho Committed by Yorick Peterse

adds language names to projects list github style

parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment