Merge pull request #1605 from dosire/repo_clone_indicator

Rewrite build_url, use web_protocol for repo indicator.
This commit is contained in:
Dmitriy Zaporozhets 2012-10-21 07:24:59 -07:00
commit 4e363c6136
3 changed files with 11 additions and 9 deletions

View file

@ -6,5 +6,5 @@
%li.right %li.right
.input-prepend.project_clone_holder .input-prepend.project_clone_holder
%button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH
%button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP %button{class: "btn small", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.web_protocol.upcase
= text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"

View file

@ -4,7 +4,7 @@
.form-horizontal .form-horizontal
.input-prepend.project_clone_holder .input-prepend.project_clone_holder
%button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH
%button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP %button{class: "btn small", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.web_protocol.upcase
= text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5"
.span4.right .span4.right
.right .right

View file

@ -31,15 +31,17 @@ class Settings < Settingslogic
end end
def build_url def build_url
raw_url = self.web_protocol
raw_url << "://"
raw_url << web_host
if web_custom_port? if web_custom_port?
raw_url << ":#{web_port}" custom_port = ":#{web_port}"
else
custom_port = nil
end end
[
raw_url web_protocol,
"://",
web_host,
custom_port
].join('')
end end
def ssh_port def ssh_port