summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-04-12 12:49:34 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2016-04-26 14:01:40 -0500
commit5ba79f49a45041f5a805de00a1f737ade5ac5832 (patch)
tree1b70d876e54ec7154d2ceee86b149cc9cacf46e8 /app
parent7f263ca1de525e44bea1f97a22d95ad947848128 (diff)
downloadgitlab-ce-5ba79f49a45041f5a805de00a1f737ade5ac5832.tar.gz
Syntax and code improvements
Diffstat (limited to 'app')
-rw-r--r--app/helpers/diff_helper.rb24
1 files changed, 13 insertions, 11 deletions
diff --git a/app/helpers/diff_helper.rb b/app/helpers/diff_helper.rb
index 06e5b95297e..5c7317bdd40 100644
--- a/app/helpers/diff_helper.rb
+++ b/app/helpers/diff_helper.rb
@@ -129,6 +129,18 @@ module DiffHelper
end
end
+ def commit_diff_whitespace_link(project, commit)
+ url = namespace_project_commit_path(project.namespace, project, commit.id, params_with_whitespace)
+ toggle_whitespace_link(url)
+ end
+
+ def diff_merge_request_whitespace_link(project, merge_request)
+ url = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, params_with_whitespace)
+ toggle_whitespace_link(url)
+ end
+
+ private
+
def hide_whitespace?
params[:w] == '1'
end
@@ -138,16 +150,6 @@ module DiffHelper
end
def toggle_whitespace_link(url)
- link_to "#{hide_whitespace? ? 'Show' : 'Hide'} whitespace changes", url, class: "btn btn-default"
- end
-
- def commit_diff_whitespace_link(project, commit)
- url = namespace_project_commit_path(project.namespace, project, commit.id, params_with_whitespace)
- toggle_whitespace_link(url)
- end
-
- def diff_merge_request_whitespace_link(project, merge_request)
- url = diffs_namespace_project_merge_request_path(project.namespace, project, merge_request, params_with_whitespace)
- toggle_whitespace_link(url)
+ link_to "#{hide_whitespace? ? 'Show' : 'Hide'} whitespace changes", url, class: 'btn btn-default'
end
end