Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d1a54a41
Commit
d1a54a41
authored
Mar 28, 2018
by
Tiago Botelho
Committed by
André Luís
Mar 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Makes use of the current_appearance helper method
parent
167bcdd3
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
29 deletions
+29
-29
app/helpers/appearances_helper.rb
app/helpers/appearances_helper.rb
+8
-8
app/helpers/emails_helper.rb
app/helpers/emails_helper.rb
+2
-2
app/views/layouts/application.html.haml
app/views/layouts/application.html.haml
+2
-2
app/views/layouts/devise.html.haml
app/views/layouts/devise.html.haml
+3
-3
app/views/layouts/devise_empty.html.haml
app/views/layouts/devise_empty.html.haml
+2
-2
ee/app/helpers/ee/appearances_helper.rb
ee/app/helpers/ee/appearances_helper.rb
+12
-12
No files found.
app/helpers/appearances_helper.rb
View file @
d1a54a41
...
...
@@ -2,28 +2,28 @@ module AppearancesHelper
prepend
EE
::
AppearancesHelper
def
brand_title
brand_item
&
.
title
.
presence
||
'GitLab Enterprise Edition'
current_appearance
&
.
title
.
presence
||
'GitLab Enterprise Edition'
end
def
brand_image
image_tag
(
brand_item
.
logo
)
if
brand_item
&
.
logo?
image_tag
(
current_appearance
.
logo
)
if
current_appearance
&
.
logo?
end
def
brand_text
markdown_field
(
brand_item
,
:description
)
markdown_field
(
current_appearance
,
:description
)
end
def
brand_new_project_guidelines
markdown_field
(
brand_item
,
:new_project_guidelines
)
markdown_field
(
current_appearance
,
:new_project_guidelines
)
end
def
brand_item
def
current_appearance
@appearance
||=
Appearance
.
current
end
def
brand_header_logo
if
brand_item
&
.
header_logo?
image_tag
brand_item
.
header_logo
if
current_appearance
&
.
header_logo?
image_tag
current_appearance
.
header_logo
else
render
'shared/logo.svg'
end
...
...
@@ -31,7 +31,7 @@ module AppearancesHelper
# Skip the 'GitLab' type logo when custom brand logo is set
def
brand_header_logo_type
unless
brand_item
&
.
header_logo?
unless
current_appearance
&
.
header_logo?
render
'shared/logo_type.svg'
end
end
...
...
app/helpers/emails_helper.rb
View file @
d1a54a41
...
...
@@ -54,9 +54,9 @@ module EmailsHelper
end
def
header_logo
if
brand_item
&&
brand_item
.
header_logo?
if
current_appearance
&
.
header_logo?
image_tag
(
brand_item
.
header_logo
,
current_appearance
.
header_logo
,
style:
'height: 50px'
)
else
...
...
app/views/layouts/application.html.haml
View file @
d1a54a41
...
...
@@ -4,9 +4,9 @@
%body
{
class:
"#{user_application_theme} #{@body_class}"
,
data:
{
page:
body_data_page
,
project:
"#{@project.path if @project}"
,
group:
"#{@group.path if @group}"
,
find_file:
find_file_path
}
}
=
render
"layouts/init_auto_complete"
if
@gfm_form
=
render
'peek/bar'
=
header_message
(
@appearance
)
=
header_message
=
render
"layouts/header/default"
=
render
'layouts/page'
,
sidebar:
sidebar
,
nav:
nav
=
footer_message
(
@appearance
)
=
footer_message
=
yield
:scripts_body
app/views/layouts/devise.html.haml
View file @
d1a54a41
...
...
@@ -2,7 +2,7 @@
%html
.devise-layout-html
{
class:
system_message_class
}
=
render
"layouts/head"
%body
.ui_indigo.login-page.application.navless
{
data:
{
page:
body_data_page
}
}
=
header_message
(
@appearance
)
=
header_message
.page-wrap
=
render
"layouts/header/empty"
.login-page-broadcast
...
...
@@ -17,7 +17,7 @@
%h1
=
brand_title
=
brand_image
-
if
brand_item
&
.
description?
-
if
current_appearance
&
.
description?
=
brand_text
-
else
%h3
Open source software to collaborate on code
...
...
@@ -41,4 +41,4 @@
=
link_to
"Explore"
,
explore_root_path
=
link_to
"Help"
,
help_path
=
link_to
"About GitLab"
,
"https://about.gitlab.com/"
=
footer_message
(
@appearance
)
=
footer_message
app/views/layouts/devise_empty.html.haml
View file @
d1a54a41
...
...
@@ -2,7 +2,7 @@
%html
{
lang:
"en"
,
class:
system_message_class
}
=
render
"layouts/head"
%body
.ui_indigo.login-page.application.navless
=
header_message
(
@appearance
)
=
header_message
=
render
"layouts/header/empty"
=
render
"layouts/broadcast"
.container.navless-container
...
...
@@ -16,4 +16,4 @@
=
link_to
"Explore"
,
explore_root_path
=
link_to
"Help"
,
help_path
=
link_to
"About GitLab"
,
"https://about.gitlab.com/"
=
footer_message
(
@appearance
)
=
footer_message
ee/app/helpers/ee/appearances_helper.rb
View file @
d1a54a41
module
EE
module
AppearancesHelper
def
header_message
(
appearance
)
return
unless
appearance
&
.
show_header?
def
header_message
return
unless
current_
appearance
&
.
show_header?
class_names
=
[]
class_names
<<
'with-performance-bar'
if
performance_bar_enabled?
render_message
(
appearance
,
:header_message
,
class_names
)
render_message
(
:header_message
,
class_names
)
end
def
footer_message
(
appearance
)
return
unless
appearance
&
.
show_footer?
def
footer_message
return
unless
current_
appearance
&
.
show_footer?
render_message
(
appearance
,
:footer_message
)
render_message
(
:footer_message
)
end
private
def
render_message
(
appearance
,
field_sym
,
class_names
=
[])
def
render_message
(
field_sym
,
class_names
=
[])
class_names
<<
field_sym
.
to_s
.
dasherize
content_tag
:div
,
class:
class_names
,
style:
message_style
(
appearance
)
do
::
Banzai
.
render_field
(
appearance
,
field_sym
).
html_safe
content_tag
:div
,
class:
class_names
,
style:
message_style
do
::
Banzai
.
render_field
(
current_
appearance
,
field_sym
).
html_safe
end
end
def
message_style
(
appearance
)
def
message_style
style
=
''
style
<<
"background-color:
#{
appearance
.
background_color
}
;"
style
<<
"color:
#{
appearance
.
font_color
}
"
style
<<
"background-color:
#{
current_
appearance
.
background_color
}
;"
style
<<
"color:
#{
current_
appearance
.
font_color
}
"
style
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment