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 ...@@ -945,4 +945,13 @@ class Project < ActiveRecord::Base
def wiki def wiki
@wiki ||= ProjectWiki.new(self, self.owner) @wiki ||= ProjectWiki.new(self, self.owner)
end 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 end
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
= project.name = project.name
.controls .controls
- if project.main_language
%span
= project.main_language
- if ci_commit - if ci_commit
%span %span
= render_ci_status(ci_commit) = 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