diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-29 23:25:04 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-06 00:54:22 +0300 |
commit | 29c50c53159333bdd124d4d3584ae826f49c28ad (patch) | |
tree | 4f8e56e18100c64186f0e819a5b0112effcaab27 /app/helpers | |
parent | fbaabb3911c6fec25edc25bfffad94ae2a7c0e28 (diff) |
Default Git access protocol to `web`
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_settings_helper.rb | 10 | ||||
-rw-r--r-- | app/helpers/branches_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/button_helper.rb | 8 |
3 files changed, 8 insertions, 12 deletions
diff --git a/app/helpers/application_settings_helper.rb b/app/helpers/application_settings_helper.rb index 6b0dde5dfe6..92166461462 100644 --- a/app/helpers/application_settings_helper.rb +++ b/app/helpers/application_settings_helper.rb @@ -44,19 +44,15 @@ module ApplicationSettingsHelper end end - def enabled_project_tooltip(project, protocol) + def enabled_project_button(project, protocol) case protocol when 'ssh' - sanitize_clone_button(ssh_clone_button(project, 'bottom')) + ssh_clone_button(project, 'bottom', false) else - sanitize_clone_button(http_clone_button(project, 'bottom')) + http_clone_button(project, 'bottom', false) end end - def sanitize_clone_button(input) - sanitize(input, tags: %w(a), attributes: %w(id class title data-html data-container data-placement data-title data-original-title aria-describedby)) - end - # Return a group of checkboxes that use Bootstrap's button plugin for a # toggle button effect. def restricted_level_checkboxes(help_block_id) diff --git a/app/helpers/branches_helper.rb b/app/helpers/branches_helper.rb index 601df5c18df..c533659b600 100644 --- a/app/helpers/branches_helper.rb +++ b/app/helpers/branches_helper.rb @@ -12,7 +12,7 @@ module BranchesHelper def can_push_branch?(project, branch_name) return false unless project.repository.branch_exists?(branch_name) - ::Gitlab::GitAccess.new(current_user, project, 'web').can_push_to_branch?(branch_name) + ::Gitlab::GitAccess.new(current_user, project).can_push_to_branch?(branch_name) end def project_branches diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index a64e96eaec9..7fd20d13010 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -40,7 +40,7 @@ module ButtonHelper type: :button end - def http_clone_button(project, placement = 'right') + def http_clone_button(project, placement = 'right', append_link = true) klass = 'http-selector' klass << ' has-tooltip' if current_user.try(:require_password?) @@ -48,7 +48,7 @@ module ButtonHelper content_tag :a, protocol, class: klass, - href: project.http_url_to_repo, + href: (project.http_url_to_repo if append_link), data: { html: true, placement: placement, @@ -57,13 +57,13 @@ module ButtonHelper } end - def ssh_clone_button(project, placement = 'right') + def ssh_clone_button(project, placement = 'right', append_link = true) klass = 'ssh-selector' klass << ' has-tooltip' if current_user.try(:require_ssh_key?) content_tag :a, 'SSH', class: klass, - href: project.ssh_url_to_repo, + href: (project.ssh_url_to_repo if append_link), data: { html: true, placement: placement, |