summaryrefslogtreecommitdiff
path: root/app/views/projects/pages
diff options
context:
space:
mode:
authorRob Watson <rob@mixlr.com>2018-01-03 08:07:03 +0000
committerRob Watson <rob@mixlr.com>2018-03-22 19:58:36 +0100
commit9d45951fcaeda4f01a2e4be2480d980a3e7cd37e (patch)
tree536b456729edad79ba718d987a39f235587d4dfb /app/views/projects/pages
parent53d352aaf4ce7f0d2bcaf04cce5252b753ef7938 (diff)
downloadgitlab-ce-9d45951fcaeda4f01a2e4be2480d980a3e7cd37e.tar.gz
Add HTTPS-only pages
Closes #28857
Diffstat (limited to 'app/views/projects/pages')
-rw-r--r--app/views/projects/pages/_https_only.html.haml10
-rw-r--r--app/views/projects/pages/show.html.haml3
2 files changed, 13 insertions, 0 deletions
diff --git a/app/views/projects/pages/_https_only.html.haml b/app/views/projects/pages/_https_only.html.haml
new file mode 100644
index 00000000000..6a3ffce949f
--- /dev/null
+++ b/app/views/projects/pages/_https_only.html.haml
@@ -0,0 +1,10 @@
+= form_for @project, url: namespace_project_pages_path(@project.namespace.becomes(Namespace), @project), html: { class: 'inline', title: pages_https_only_title } do |f|
+ = f.check_box :pages_https_only, class: 'pull-left', disabled: pages_https_only_disabled?
+
+ .prepend-left-20
+ = f.label :pages_https_only, class: pages_https_only_label_class do
+ %strong Force domains with SSL certificates to use HTTPS
+
+ - unless pages_https_only_disabled?
+ .prepend-top-10
+ = f.submit 'Save', class: 'btn btn-success'
diff --git a/app/views/projects/pages/show.html.haml b/app/views/projects/pages/show.html.haml
index 04e647c0dc6..f17d9d24db6 100644
--- a/app/views/projects/pages/show.html.haml
+++ b/app/views/projects/pages/show.html.haml
@@ -13,6 +13,9 @@
Combined with the power of GitLab CI and the help of GitLab Runner
you can deploy static pages for your individual projects, your user or your group.
+- if Gitlab.config.pages.external_https
+ = render 'https_only'
+
%hr.clearfix
= render 'access'