Commit d75cc7eafd980198e6f7484ded56c148ea96479f
Committed by
Sytse Sijbrandij
1 parent
2ff36e74
Exists in
master
and in
4 other branches
Display https as repo clone indicator and prevent modification of web_protocol variable.
Rewrite build_url, use web_protocol for repo indicator. Explicitly initialize custom port to make the logic obvious.
Showing
3 changed files
with
11 additions
and
9 deletions
Show diff stats
app/views/blame/_head.html.haml
| ... | ... | @@ -6,5 +6,5 @@ |
| 6 | 6 | %li.right |
| 7 | 7 | .input-prepend.project_clone_holder |
| 8 | 8 | %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH |
| 9 | - %button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP | |
| 9 | + %button{class: "btn small", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.web_protocol.upcase | |
| 10 | 10 | = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" | ... | ... |
app/views/projects/_clone_panel.html.haml
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | .form-horizontal |
| 5 | 5 | .input-prepend.project_clone_holder |
| 6 | 6 | %button{class: "btn small active", :"data-clone" => @project.ssh_url_to_repo} SSH |
| 7 | - %button{class: "btn small", :"data-clone" => @project.http_url_to_repo} HTTP | |
| 7 | + %button{class: "btn small", :"data-clone" => @project.http_url_to_repo}= Gitlab.config.web_protocol.upcase | |
| 8 | 8 | = text_field_tag :project_clone, @project.url_to_repo, class: "one_click_select span5" |
| 9 | 9 | .span4.right |
| 10 | 10 | .right | ... | ... |
config/initializers/1_settings.rb
| ... | ... | @@ -31,15 +31,17 @@ class Settings < Settingslogic |
| 31 | 31 | end |
| 32 | 32 | |
| 33 | 33 | def build_url |
| 34 | - raw_url = self.web_protocol | |
| 35 | - raw_url << "://" | |
| 36 | - raw_url << web_host | |
| 37 | - | |
| 38 | 34 | if web_custom_port? |
| 39 | - raw_url << ":#{web_port}" | |
| 35 | + custom_port = ":#{web_port}" | |
| 36 | + else | |
| 37 | + custom_port = nil | |
| 40 | 38 | end |
| 41 | - | |
| 42 | - raw_url | |
| 39 | + [ | |
| 40 | + web_protocol, | |
| 41 | + "://", | |
| 42 | + web_host, | |
| 43 | + custom_port | |
| 44 | + ].join('') | |
| 43 | 45 | end |
| 44 | 46 | |
| 45 | 47 | def ssh_port | ... | ... |