adds language names to projects list github style
This commit is contained in:
parent
903aa7c95e
commit
73535b80b2
2 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue