summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/application_helper.rb8
-rw-r--r--app/views/admin/projects/_form.html.haml2
-rw-r--r--app/views/projects/_form.html.haml2
3 files changed, 10 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 4d85e39464b..a69a1a0ba27 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -11,6 +11,14 @@ module ApplicationHelper
true
end
+ def request_protocol
+ request.ssl? ? "https" : "http"
+ end
+
+ def web_app_url
+ "#{request_protocol}://#{GIT_HOST["host"]}/"
+ end
+
def body_class(default_class = nil)
main = content_for(:body_class).blank? ?
default_class :
diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml
index 8e16437e39a..84cd030ec09 100644
--- a/app/views/admin/projects/_form.html.haml
+++ b/app/views/admin/projects/_form.html.haml
@@ -20,7 +20,7 @@
Code
.input
.input-prepend
- %span.add-on= "http://#{GIT_HOST["host"]}/"
+ %span.add-on= web_app_url
= f.text_field :code, :placeholder => "example"
- unless @admin_project.new_record?
diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml
index 9c39f807146..5d22f11d579 100644
--- a/app/views/projects/_form.html.haml
+++ b/app/views/projects/_form.html.haml
@@ -19,7 +19,7 @@
Code
.input
.input-prepend
- %span.add-on= "http://#{GIT_HOST["host"]}/"
+ %span.add-on= web_app_url
= f.text_field :code, :placeholder => "example"
- unless @project.new_record? || @project.heads.empty?