summaryrefslogtreecommitdiff
path: root/app/views/projects/pages/_pages_settings.html.haml
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/projects/pages/_pages_settings.html.haml')
-rw-r--r--app/views/projects/pages/_pages_settings.html.haml15
1 files changed, 8 insertions, 7 deletions
diff --git a/app/views/projects/pages/_pages_settings.html.haml b/app/views/projects/pages/_pages_settings.html.haml
index 2db44528d51..15fb5755b61 100644
--- a/app/views/projects/pages/_pages_settings.html.haml
+++ b/app/views/projects/pages/_pages_settings.html.haml
@@ -1,11 +1,12 @@
+- can_edit_max_page_size=can?(current_user, :update_max_pages_size)
+- can_enforce_https_only=Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
+
+- return unless can_edit_max_page_size || can_enforce_https_only
= form_for @project, url: project_pages_path(@project), html: { class: 'inline', title: pages_https_only_title } do |f|
- - if can?(current_user, :update_max_pages_size)
+ - if can_edit_max_page_size
= render_if_exists 'shared/pages/max_pages_size_input', form: f
- .gl-mt-3
- = f.submit s_('GitLabPages|Save changes'), class: 'btn btn-confirm gl-button'
-
- - if Gitlab.config.pages.external_http || Gitlab.config.pages.external_https
+ - if can_enforce_https_only
.form-group
.form-check
= f.check_box :pages_https_only, class: 'form-check-input', disabled: pages_https_only_disabled?
@@ -17,5 +18,5 @@
%p
= s_("GitLabPages|When enabled, all attempts to visit your website through HTTP are automatically redirected to HTTPS using a response with status code 301. Requires a valid certificate for all domains. %{docs_link_start}Learn more.%{link_end}").html_safe % { docs_link_start: docs_link_start, link_end: link_end }
- .gl-mt-3
- = f.submit s_('GitLabPages|Save changes'), class: 'btn btn-confirm gl-button'
+ .gl-mt-3
+ = f.submit s_('GitLabPages|Save changes'), class: 'btn btn-confirm gl-button'