Commit e241d1e6700f88ecd5aef481596fa1cc782841f0

Authored by Dmitriy Zaporozhets
1 parent 52d8ed9e

Fix form label for ssl requests

app/helpers/application_helper.rb
... ... @@ -11,6 +11,14 @@ module ApplicationHelper
11 11 true
12 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 22 def body_class(default_class = nil)
15 23 main = content_for(:body_class).blank? ?
16 24 default_class :
... ...
app/views/admin/projects/_form.html.haml
... ... @@ -20,7 +20,7 @@
20 20 Code
21 21 .input
22 22 .input-prepend
23   - %span.add-on= "http://#{GIT_HOST["host"]}/"
  23 + %span.add-on= web_app_url
24 24 = f.text_field :code, :placeholder => "example"
25 25  
26 26 - unless @admin_project.new_record?
... ...
app/views/projects/_form.html.haml
... ... @@ -19,7 +19,7 @@
19 19 Code
20 20 .input
21 21 .input-prepend
22   - %span.add-on= "http://#{GIT_HOST["host"]}/"
  22 + %span.add-on= web_app_url
23 23 = f.text_field :code, :placeholder => "example"
24 24  
25 25 - unless @project.new_record? || @project.heads.empty?
... ...