Commit fd1f61c0 authored by Annabel Dunstone Gray's avatar Annabel Dunstone Gray

Update UI of admin appearance settings

Updates the layout of the admin appearance settings to be consistent
with other settings pages across GitLab
parent d7a3f875
= form_for @appearance, url: admin_appearances_path do |f| = form_for @appearance, url: admin_appearances_path, html: { class: 'prepend-top-default' } do |f|
= form_errors(@appearance) = form_errors(@appearance)
%fieldset.app_logo
%legend .row
Navigation bar: .col-lg-4.profile-settings-sidebar
.form-group.row %h4.prepend-top-0 Navigation bar
= f.label :header_logo, 'Header logo', class: 'col-sm-2 col-form-label pt-0'
.col-sm-10 .col-lg-8
.form-group
= f.label :header_logo, 'Header logo', class: 'col-form-label label-bold pt-0'
%p
- if @appearance.header_logo? - if @appearance.header_logo?
= image_tag @appearance.header_logo_path, class: 'appearance-light-logo-preview' = image_tag @appearance.header_logo_path, class: 'appearance-light-logo-preview'
- if @appearance.persisted? - if @appearance.persisted?
...@@ -17,13 +20,15 @@ ...@@ -17,13 +20,15 @@
= f.file_field :header_logo, class: "" = f.file_field :header_logo, class: ""
.hint .hint
Maximum file size is 1MB. Pages are optimized for a 28px tall header logo Maximum file size is 1MB. Pages are optimized for a 28px tall header logo
%hr
.row
.col-lg-4.profile-settings-sidebar
%h4.prepend-top-0 Favicon
%fieldset.app_logo .col-lg-8
%legend .form-group
Favicon: = f.label :favicon, 'Favicon', class: 'col-form-label label-bold pt-0'
.form-group.row %p
= f.label :favicon, 'Favicon', class: 'col-sm-2 col-form-label pt-0'
.col-sm-10
- if @appearance.favicon? - if @appearance.favicon?
= image_tag @appearance.favicon_path, class: 'appearance-light-logo-preview' = image_tag @appearance.favicon_path, class: 'appearance-light-logo-preview'
- if @appearance.persisted? - if @appearance.persisted?
...@@ -37,22 +42,24 @@ ...@@ -37,22 +42,24 @@
%br %br
Images with incorrect dimensions are not resized automatically, and may result in unexpected behavior. Images with incorrect dimensions are not resized automatically, and may result in unexpected behavior.
%fieldset.sign-in
%legend %hr
Sign in/Sign up pages: .row
.form-group.row .col-lg-4.profile-settings-sidebar
= f.label :title, class: 'col-sm-2 col-form-label' %h4.prepend-top-0 Sign in/Sign up pages
.col-sm-10
.col-lg-8
.form-group
= f.label :title, class: 'col-form-label label-bold'
= f.text_field :title, class: "form-control" = f.text_field :title, class: "form-control"
.form-group.row .form-group
= f.label :description, class: 'col-sm-2 col-form-label' = f.label :description, class: 'col-form-label label-bold'
.col-sm-10
= f.text_area :description, class: "form-control", rows: 10 = f.text_area :description, class: "form-control", rows: 10
.hint .hint
Description parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}. Description parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.
.form-group.row .form-group
= f.label :logo, class: 'col-sm-2 col-form-label pt-0' = f.label :logo, class: 'col-form-label label-bold pt-0'
.col-sm-10 %p
- if @appearance.logo? - if @appearance.logo?
= image_tag @appearance.logo_path, class: 'appearance-logo-preview' = image_tag @appearance.logo_path, class: 'appearance-logo-preview'
- if @appearance.persisted? - if @appearance.persisted?
...@@ -64,18 +71,21 @@ ...@@ -64,18 +71,21 @@
.hint .hint
Maximum file size is 1MB. Pages are optimized for a 640x360 px logo. Maximum file size is 1MB. Pages are optimized for a 640x360 px logo.
%fieldset %hr
%legend .row
New project pages: .col-lg-4.profile-settings-sidebar
.form-group.row %h4.prepend-top-0 New project pages
= f.label :new_project_guidelines, class: 'col-sm-2 col-form-label'
.col-sm-10 .col-lg-8
.form-group
= f.label :new_project_guidelines, class: 'col-form-label label-bold'
%p
= f.text_area :new_project_guidelines, class: "form-control", rows: 10 = f.text_area :new_project_guidelines, class: "form-control", rows: 10
.hint .hint
Guidelines parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}. Guidelines parsed with #{link_to "GitLab Flavored Markdown", help_page_path('user/markdown'), target: '_blank'}.
.form-actions .prepend-top-default.append-bottom-default
= f.submit 'Save', class: 'btn btn-success append-right-10' = f.submit 'Update appearance settings', class: 'btn btn-success'
- if @appearance.persisted? - if @appearance.persisted?
Preview last save: Preview last save:
= link_to 'Sign-in page', preview_sign_in_admin_appearances_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer' = link_to 'Sign-in page', preview_sign_in_admin_appearances_path, class: 'btn', target: '_blank', rel: 'noopener noreferrer'
......
- page_title "Appearance" - page_title "Appearance"
- @content_class = "limit-container-width" unless fluid_layout
%h3.page-title
Appearance settings
%p.light
You can modify the look and feel of GitLab here
%hr
= render 'form' = render 'form'
---
title: Update UI for admin appearance settings
merge_request: 24685
author:
type: other
...@@ -10,10 +10,10 @@ describe 'Admin Appearance' do ...@@ -10,10 +10,10 @@ describe 'Admin Appearance' do
fill_in 'appearance_title', with: 'MyCompany' fill_in 'appearance_title', with: 'MyCompany'
fill_in 'appearance_description', with: 'dev server' fill_in 'appearance_description', with: 'dev server'
fill_in 'appearance_new_project_guidelines', with: 'Custom project guidelines' fill_in 'appearance_new_project_guidelines', with: 'Custom project guidelines'
click_button 'Save' click_button 'Update appearance settings'
expect(current_path).to eq admin_appearances_path expect(current_path).to eq admin_appearances_path
expect(page).to have_content 'Appearance settings' expect(page).to have_content 'Appearance'
expect(page).to have_field('appearance_title', with: 'MyCompany') expect(page).to have_field('appearance_title', with: 'MyCompany')
expect(page).to have_field('appearance_description', with: 'dev server') expect(page).to have_field('appearance_description', with: 'dev server')
...@@ -57,7 +57,7 @@ describe 'Admin Appearance' do ...@@ -57,7 +57,7 @@ describe 'Admin Appearance' do
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_logo, logo_fixture) attach_file(:appearance_logo, logo_fixture)
click_button 'Save' click_button 'Update appearance settings'
expect(page).to have_css(logo_selector) expect(page).to have_css(logo_selector)
click_link 'Remove logo' click_link 'Remove logo'
...@@ -69,7 +69,7 @@ describe 'Admin Appearance' do ...@@ -69,7 +69,7 @@ describe 'Admin Appearance' do
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_header_logo, logo_fixture) attach_file(:appearance_header_logo, logo_fixture)
click_button 'Save' click_button 'Update appearance settings'
expect(page).to have_css(header_logo_selector) expect(page).to have_css(header_logo_selector)
click_link 'Remove header logo' click_link 'Remove header logo'
...@@ -81,7 +81,7 @@ describe 'Admin Appearance' do ...@@ -81,7 +81,7 @@ describe 'Admin Appearance' do
visit admin_appearances_path visit admin_appearances_path
attach_file(:appearance_favicon, logo_fixture) attach_file(:appearance_favicon, logo_fixture)
click_button 'Save' click_button 'Update appearance settings'
expect(page).to have_css('.appearance-light-logo-preview') expect(page).to have_css('.appearance-light-logo-preview')
...@@ -91,7 +91,7 @@ describe 'Admin Appearance' do ...@@ -91,7 +91,7 @@ describe 'Admin Appearance' do
# allowed file types # allowed file types
attach_file(:appearance_favicon, Rails.root.join('spec', 'fixtures', 'sanitized.svg')) attach_file(:appearance_favicon, Rails.root.join('spec', 'fixtures', 'sanitized.svg'))
click_button 'Save' click_button 'Update appearance settings'
expect(page).to have_content 'Favicon You are not allowed to upload "svg" files, allowed types: png, ico' expect(page).to have_content 'Favicon You are not allowed to upload "svg" files, allowed types: png, ico'
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment