Skip to content
代码片段 群组 项目
提交 5fd83ec3 编辑于 作者: Max Woolf's avatar Max Woolf
浏览文件

Merge branch...

Merge branch 'dreedy-use-user-application-theme-helper-instead-of-hard-coded-theme-classes' into 'master'

Use user_application_theme helper instead of hard-coded theme classes

See merge request gitlab-org/gitlab!61197
No related branches found
No related tags found
无相关合并请求
显示
103 个添加7 个删除
!!! 5
%html.devise-layout-html{ class: system_message_class }
= render "layouts/head", { startup_filename: 'signin' }
%body.ui-indigo.login-page.application.navless{ class: "#{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } }
%body.login-page.application.navless{ class: "#{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'login_page' } }
= header_message
= render "layouts/init_client_detection_flags"
.page-wrap
......
!!! 5
%html.devise-layout-html{ lang: "en", class: system_message_class }
= render "layouts/head"
%body.ui-indigo.login-page.application.navless{ class: "#{client_class_list}" }
%body.login-page.application.navless{ class: "#{user_application_theme} #{client_class_list}" }
= header_message
= render "layouts/init_client_detection_flags"
= render "layouts/header/empty"
......
......@@ -2,7 +2,7 @@
%html.devise-layout-html.navless{ class: system_message_class }
- add_page_specific_style 'page_bundles/signup'
= render "layouts/head"
%body.ui-indigo.signup-page{ class: "#{client_class_list}", data: { page: body_data_page, qa_selector: 'signup_page' } }
%body.signup-page{ class: "#{user_application_theme} #{client_class_list}", data: { page: body_data_page, qa_selector: 'signup_page' } }
= render "layouts/header/logo_with_title"
= render "layouts/init_client_detection_flags"
.page-wrap
......
!!! 5
%html.subscriptions-layout-html{ lang: 'en' }
= render 'layouts/head'
%body.ui-indigo.gl-display-flex{ data: body_data }
%body.gl-display-flex{ class: user_application_theme, data: body_data }
= render "layouts/header/logo_with_title"
.container.gl-display-flex.gl-flex-direction-column.gl-m-0.gl-px-0
= render "layouts/broadcast"
......
......@@ -4,7 +4,7 @@
!!! 5
%html{ lang: I18n.locale }
= render 'layouts/head'
%body.ui-indigo.gl-display-flex
%body.gl-display-flex{ class: user_application_theme }
= render 'layouts/header/logo_with_title'
.container.gl-pt-8.gl-max-w-full.gl-text-center
- if @invite_link
......
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'layouts/application' do
RSpec.describe 'layouts/application', :themed_layout do
let_it_be(:user) { create(:user) }
before do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/checkout' do
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
RSpec.shared_examples "a layout which reflects the application theme setting", :themed_layout do
context 'as a themed layout' do
let(:default_theme_class) { ::Gitlab::Themes.default.css_class }
context 'when no theme is explicitly selected' do
it 'renders with the default theme' do
render
expect(rendered).to have_selector("body.#{default_theme_class}")
end
end
context 'when user is authenticated & has selected a specific theme' do
before do
allow(view).to receive(:user_application_theme).and_return(chosen_theme.css_class)
end
where(chosen_theme: ::Gitlab::Themes.available_themes)
with_them do
it "renders with the #{params[:chosen_theme].name} theme" do
render
if chosen_theme.css_class != default_theme_class
expect(rendered).not_to have_selector("body.#{default_theme_class}")
end
expect(rendered).to have_selector("body.#{chosen_theme.css_class}")
end
end
end
end
end
......@@ -2,7 +2,7 @@
require 'spec_helper'
RSpec.describe 'layouts/application' do
RSpec.describe 'layouts/application', :themed_layout do
let(:user) { create(:user) }
before do
......
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/devise' do
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/devise_empty' do
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/fullscreen' do
let_it_be(:user) { create(:user) }
before do
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/signup_onboarding' do
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/simple_registration' do
it_behaves_like 'a layout which reflects the application theme setting'
end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'layouts/terms' do
let_it_be(:user) { create(:user) }
before do
allow(view).to receive(:current_user_mode).and_return(Gitlab::Auth::CurrentUserMode.new(user))
end
it_behaves_like 'a layout which reflects the application theme setting'
end
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册