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
e94c9d62
Commit
e94c9d62
authored
Mar 30, 2018
by
Tiago Botelho
Committed by
André Luís
Mar 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renames appearance background and font color to message_background_color and message_font_color
parent
e0636673
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
29 deletions
+29
-29
db/schema.rb
db/schema.rb
+2
-2
ee/app/controllers/ee/admin/appearances_controller.rb
ee/app/controllers/ee/admin/appearances_controller.rb
+2
-2
ee/app/helpers/ee/appearances_helper.rb
ee/app/helpers/ee/appearances_helper.rb
+3
-3
ee/app/models/ee/appearance.rb
ee/app/models/ee/appearance.rb
+6
-6
ee/app/views/admin/appearances/_system_header_footer_form.html.haml
...ws/admin/appearances/_system_header_footer_form.html.haml
+6
-6
ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb
...917_add_header_and_footer_banners_to_appearances_table.rb
+2
-2
ee/spec/models/ee/appearance_spec.rb
ee/spec/models/ee/appearance_spec.rb
+8
-8
No files found.
db/schema.rb
View file @
e94c9d62
...
@@ -43,8 +43,8 @@ ActiveRecord::Schema.define(version: 20180327101207) do
...
@@ -43,8 +43,8 @@ ActiveRecord::Schema.define(version: 20180327101207) do
t
.
text
"header_message_html"
t
.
text
"header_message_html"
t
.
text
"footer_message"
t
.
text
"footer_message"
t
.
text
"footer_message_html"
t
.
text
"footer_message_html"
t
.
text
"background_color"
t
.
text
"
message_
background_color"
t
.
text
"font_color"
t
.
text
"
message_
font_color"
end
end
create_table
"application_settings"
,
force: :cascade
do
|
t
|
create_table
"application_settings"
,
force: :cascade
do
|
t
|
...
...
ee/app/controllers/ee/admin/appearances_controller.rb
View file @
e94c9d62
...
@@ -5,8 +5,8 @@ module EE
...
@@ -5,8 +5,8 @@ module EE
super
+
%i[
super
+
%i[
header_message
header_message
footer_message
footer_message
background_color
message_
background_color
font_color
message_
font_color
]
]
end
end
end
end
...
...
ee/app/helpers/ee/appearances_helper.rb
View file @
e94c9d62
...
@@ -21,14 +21,14 @@ module EE
...
@@ -21,14 +21,14 @@ module EE
class_names
<<
field_sym
.
to_s
.
dasherize
class_names
<<
field_sym
.
to_s
.
dasherize
content_tag
:div
,
class:
class_names
,
style:
message_style
do
content_tag
:div
,
class:
class_names
,
style:
message_style
do
::
Banzai
.
render_field
(
current_appearance
,
field_sym
).
html_safe
markdown_field
(
current_appearance
,
field_sym
)
end
end
end
end
def
message_style
def
message_style
style
=
''
style
=
''
style
<<
"background-color:
#{
current_appearance
.
background_color
}
;"
style
<<
"background-color:
#{
current_appearance
.
message_
background_color
}
;"
style
<<
"color:
#{
current_appearance
.
font_color
}
"
style
<<
"color:
#{
current_appearance
.
message_
font_color
}
"
style
style
end
end
end
end
...
...
ee/app/models/ee/appearance.rb
View file @
e94c9d62
...
@@ -3,14 +3,14 @@ module EE
...
@@ -3,14 +3,14 @@ module EE
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
prepended
do
prepended
do
cache_markdown_field
:header_message
cache_markdown_field
:header_message
,
pipeline: :broadcast_message
cache_markdown_field
:footer_message
cache_markdown_field
:footer_message
,
pipeline: :broadcast_message
validates
:background_color
,
allow_blank:
true
,
color:
true
validates
:
message_
background_color
,
allow_blank:
true
,
color:
true
validates
:font_color
,
allow_blank:
true
,
color:
true
validates
:
message_
font_color
,
allow_blank:
true
,
color:
true
default_value_for
:background_color
,
'#E75E40'
default_value_for
:
message_
background_color
,
'#E75E40'
default_value_for
:font_color
,
'#FFFFFF'
default_value_for
:
message_
font_color
,
'#FFFFFF'
end
end
def
show_header?
def
show_header?
...
...
ee/app/views/admin/appearances/_system_header_footer_form.html.haml
View file @
e94c9d62
...
@@ -8,17 +8,17 @@
...
@@ -8,17 +8,17 @@
.col-sm-10
.col-sm-10
=
form
.
text_area
:header_message
,
placeholder:
_
(
'State your message to activate'
),
class:
"form-control js-autosize"
=
form
.
text_area
:header_message
,
placeholder:
_
(
'State your message to activate'
),
class:
"form-control js-autosize"
.form-group
.form-group
=
form
.
label
:footer_message
,
'Footer message'
,
class:
'control-label'
=
form
.
label
:footer_message
,
_
(
'Footer message'
)
,
class:
'control-label'
.col-sm-10
.col-sm-10
=
form
.
text_area
:footer_message
,
placeholder:
_
(
'State your message to activate'
),
class:
"form-control js-autosize"
=
form
.
text_area
:footer_message
,
placeholder:
_
(
'State your message to activate'
),
class:
"form-control js-autosize"
.form-group.js-toggle-colors-container
.form-group.js-toggle-colors-container
.col-sm-10.col-sm-offset-2
.col-sm-10.col-sm-offset-2
=
link_to
'Customize colors'
,
'#'
,
class:
'js-toggle-colors-link'
=
link_to
_
(
'Customize colors'
)
,
'#'
,
class:
'js-toggle-colors-link'
.form-group.js-toggle-colors-container.hide
.form-group.js-toggle-colors-container.hide
=
form
.
label
:background_color
,
_
(
'Background Color'
),
class:
'control-label'
=
form
.
label
:
message_
background_color
,
_
(
'Background Color'
),
class:
'control-label'
.col-sm-10
.col-sm-10
=
form
.
color_field
:background_color
,
class:
"form-control"
=
form
.
color_field
:
message_
background_color
,
class:
"form-control"
.form-group.js-toggle-colors-container.hide
.form-group.js-toggle-colors-container.hide
=
form
.
label
:font_color
,
_
(
'Font Color'
),
class:
'control-label'
=
form
.
label
:
message_
font_color
,
_
(
'Font Color'
),
class:
'control-label'
.col-sm-10
.col-sm-10
=
form
.
color_field
:font_color
,
class:
"form-control"
=
form
.
color_field
:
message_
font_color
,
class:
"form-control"
ee/db/migrate/20180314145917_add_header_and_footer_banners_to_appearances_table.rb
View file @
e94c9d62
...
@@ -10,7 +10,7 @@ class AddHeaderAndFooterBannersToAppearancesTable < ActiveRecord::Migration
...
@@ -10,7 +10,7 @@ class AddHeaderAndFooterBannersToAppearancesTable < ActiveRecord::Migration
add_column
:appearances
,
:footer_message
,
:text
add_column
:appearances
,
:footer_message
,
:text
add_column
:appearances
,
:footer_message_html
,
:text
add_column
:appearances
,
:footer_message_html
,
:text
add_column
:appearances
,
:background_color
,
:text
add_column
:appearances
,
:
message_
background_color
,
:text
add_column
:appearances
,
:font_color
,
:text
add_column
:appearances
,
:
message_
font_color
,
:text
end
end
end
end
ee/spec/models/ee/appearance_spec.rb
View file @
e94c9d62
...
@@ -7,14 +7,14 @@ describe Appearance do
...
@@ -7,14 +7,14 @@ describe Appearance do
let
(
:triplet
)
{
'#000'
}
let
(
:triplet
)
{
'#000'
}
let
(
:hex
)
{
'#AABBCC'
}
let
(
:hex
)
{
'#AABBCC'
}
it
{
is_expected
.
to
allow_value
(
nil
).
for
(
:background_color
)
}
it
{
is_expected
.
to
allow_value
(
nil
).
for
(
:
message_
background_color
)
}
it
{
is_expected
.
to
allow_value
(
triplet
).
for
(
:background_color
)
}
it
{
is_expected
.
to
allow_value
(
triplet
).
for
(
:
message_
background_color
)
}
it
{
is_expected
.
to
allow_value
(
hex
).
for
(
:background_color
)
}
it
{
is_expected
.
to
allow_value
(
hex
).
for
(
:
message_
background_color
)
}
it
{
is_expected
.
not_to
allow_value
(
'000'
).
for
(
:background_color
)
}
it
{
is_expected
.
not_to
allow_value
(
'000'
).
for
(
:
message_
background_color
)
}
it
{
is_expected
.
to
allow_value
(
nil
).
for
(
:font_color
)
}
it
{
is_expected
.
to
allow_value
(
nil
).
for
(
:
message_
font_color
)
}
it
{
is_expected
.
to
allow_value
(
triplet
).
for
(
:font_color
)
}
it
{
is_expected
.
to
allow_value
(
triplet
).
for
(
:
message_
font_color
)
}
it
{
is_expected
.
to
allow_value
(
hex
).
for
(
:font_color
)
}
it
{
is_expected
.
to
allow_value
(
hex
).
for
(
:
message_
font_color
)
}
it
{
is_expected
.
not_to
allow_value
(
'000'
).
for
(
:font_color
)
}
it
{
is_expected
.
not_to
allow_value
(
'000'
).
for
(
:
message_
font_color
)
}
end
end
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