Commit e241d1e6700f88ecd5aef481596fa1cc782841f0
1 parent
52d8ed9e
Exists in
master
and in
4 other branches
Fix form label for ssl requests
Showing
3 changed files
with
10 additions
and
2 deletions
Show diff stats
app/helpers/application_helper.rb
@@ -11,6 +11,14 @@ module ApplicationHelper | @@ -11,6 +11,14 @@ module ApplicationHelper | ||
11 | true | 11 | true |
12 | end | 12 | end |
13 | 13 | ||
14 | + def request_protocol | ||
15 | + request.ssl? ? "https" : "http" | ||
16 | + end | ||
17 | + | ||
18 | + def web_app_url | ||
19 | + "#{request_protocol}://#{GIT_HOST["host"]}/" | ||
20 | + end | ||
21 | + | ||
14 | def body_class(default_class = nil) | 22 | def body_class(default_class = nil) |
15 | main = content_for(:body_class).blank? ? | 23 | main = content_for(:body_class).blank? ? |
16 | default_class : | 24 | default_class : |
app/views/admin/projects/_form.html.haml
@@ -20,7 +20,7 @@ | @@ -20,7 +20,7 @@ | ||
20 | Code | 20 | Code |
21 | .input | 21 | .input |
22 | .input-prepend | 22 | .input-prepend |
23 | - %span.add-on= "http://#{GIT_HOST["host"]}/" | 23 | + %span.add-on= web_app_url |
24 | = f.text_field :code, :placeholder => "example" | 24 | = f.text_field :code, :placeholder => "example" |
25 | 25 | ||
26 | - unless @admin_project.new_record? | 26 | - unless @admin_project.new_record? |
app/views/projects/_form.html.haml
@@ -19,7 +19,7 @@ | @@ -19,7 +19,7 @@ | ||
19 | Code | 19 | Code |
20 | .input | 20 | .input |
21 | .input-prepend | 21 | .input-prepend |
22 | - %span.add-on= "http://#{GIT_HOST["host"]}/" | 22 | + %span.add-on= web_app_url |
23 | = f.text_field :code, :placeholder => "example" | 23 | = f.text_field :code, :placeholder => "example" |
24 | 24 | ||
25 | - unless @project.new_record? || @project.heads.empty? | 25 | - unless @project.new_record? || @project.heads.empty? |