Add user_color_scheme_class helper
This commit is contained in:
parent
c4f3c54ecb
commit
184a9ecaf6
3 changed files with 8 additions and 6 deletions
|
@ -126,6 +126,10 @@ module ApplicationHelper
|
||||||
Gitlab::Theme.css_class_by_id(current_user.try(:theme_id))
|
Gitlab::Theme.css_class_by_id(current_user.try(:theme_id))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def user_color_scheme_class
|
||||||
|
current_user.dark_scheme ? :black : :white
|
||||||
|
end
|
||||||
|
|
||||||
def show_last_push_widget?(event)
|
def show_last_push_widget?(event)
|
||||||
event &&
|
event &&
|
||||||
event.last_push_to_non_root? &&
|
event.last_push_to_non_root? &&
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
= link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
|
= link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank"
|
||||||
.file_content.code
|
.file_content.code
|
||||||
- unless @snippet.content.empty?
|
- unless @snippet.content.empty?
|
||||||
%div{class: current_user.dark_scheme ? "black" : "white"}
|
%div{class: user_color_scheme_class}
|
||||||
:preserve
|
= raw @snippet.colorize(formatter: :gitlab)
|
||||||
#{raw @snippet.colorize(formatter: :gitlab)}
|
|
||||||
- else
|
- else
|
||||||
%p.nothing_here_message Empty file
|
%p.nothing_here_message Empty file
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
- else
|
- else
|
||||||
.file_content.code
|
.file_content.code
|
||||||
- unless blob.empty?
|
- unless blob.empty?
|
||||||
%div{class: current_user.dark_scheme ? "black" : "white"}
|
%div{class: user_color_scheme_class}
|
||||||
= preserve do
|
= raw blob.colorize(formatter: :gitlab)
|
||||||
= raw blob.colorize(formatter: :gitlab)
|
|
||||||
- else
|
- else
|
||||||
%p.nothing_here_message Empty file
|
%p.nothing_here_message Empty file
|
||||||
|
|
Loading…
Add table
Reference in a new issue