Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2017-07-31 16:23:05 +0300
committerJacob Vosmaer <jacob@gitlab.com>2017-08-01 11:48:46 +0300
commit67de82cf5fa5a6408621cbf955c730e2825d9c39 (patch)
tree82b65479cc85b0426d09045d88f6d68d09cdcaf7 /app/controllers/projects
parente99564568b2fefab8973ce571594aaa888cf8494 (diff)
Add option to use CommitLanguages RPC
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/graphs_controller.rb18
1 files changed, 1 insertions, 17 deletions
diff --git a/app/controllers/projects/graphs_controller.rb b/app/controllers/projects/graphs_controller.rb
index 57372f9e79d..475d4c86294 100644
--- a/app/controllers/projects/graphs_controller.rb
+++ b/app/controllers/projects/graphs_controller.rb
@@ -43,23 +43,7 @@ class Projects::GraphsController < Projects::ApplicationController
end
def get_languages
- @languages = Linguist::Repository.new(@repository.rugged, @repository.rugged.head.target_id).languages
- total = @languages.map(&:last).sum
-
- @languages = @languages.map do |language|
- name, share = language
- color = Linguist::Language[name].color || "##{Digest::SHA256.hexdigest(name)[0...6]}"
- {
- value: (share.to_f * 100 / total).round(2),
- label: name,
- color: color,
- highlight: color
- }
- end
-
- @languages.sort! do |x, y|
- y[:value] <=> x[:value]
- end
+ @languages = @project.repository.languages
end
def fetch_graph