Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
projects.thm.de
GitLab
Commits
1993a444
Commit
1993a444
authored
Aug 18, 2018
by
gfyoung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable frozen string for app/helpers/**/*.rb
Partially addresses #47424.
parent
07d5ee36
Changes
102
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
235 additions
and
103 deletions
+235
-103
app/helpers/accounts_helper.rb
app/helpers/accounts_helper.rb
+2
-0
app/helpers/active_sessions_helper.rb
app/helpers/active_sessions_helper.rb
+2
-0
app/helpers/appearances_helper.rb
app/helpers/appearances_helper.rb
+2
-0
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+5
-3
app/helpers/application_settings_helper.rb
app/helpers/application_settings_helper.rb
+5
-3
app/helpers/auth_helper.rb
app/helpers/auth_helper.rb
+2
-0
app/helpers/auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+2
-0
app/helpers/avatars_helper.rb
app/helpers/avatars_helper.rb
+5
-3
app/helpers/award_emoji_helper.rb
app/helpers/award_emoji_helper.rb
+2
-0
app/helpers/blame_helper.rb
app/helpers/blame_helper.rb
+2
-0
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+2
-0
app/helpers/boards_helper.rb
app/helpers/boards_helper.rb
+2
-0
app/helpers/branches_helper.rb
app/helpers/branches_helper.rb
+2
-0
app/helpers/breadcrumbs_helper.rb
app/helpers/breadcrumbs_helper.rb
+2
-0
app/helpers/broadcast_messages_helper.rb
app/helpers/broadcast_messages_helper.rb
+4
-3
app/helpers/builds_helper.rb
app/helpers/builds_helper.rb
+6
-4
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+2
-0
app/helpers/calendar_helper.rb
app/helpers/calendar_helper.rb
+2
-0
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+2
-0
app/helpers/clusters_helper.rb
app/helpers/clusters_helper.rb
+2
-0
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+2
-0
app/helpers/compare_helper.rb
app/helpers/compare_helper.rb
+2
-0
app/helpers/components_helper.rb
app/helpers/components_helper.rb
+2
-0
app/helpers/conversational_development_index_helper.rb
app/helpers/conversational_development_index_helper.rb
+2
-0
app/helpers/count_helper.rb
app/helpers/count_helper.rb
+2
-0
app/helpers/dashboard_helper.rb
app/helpers/dashboard_helper.rb
+2
-0
app/helpers/defer_script_tag_helper.rb
app/helpers/defer_script_tag_helper.rb
+2
-0
app/helpers/deploy_tokens_helper.rb
app/helpers/deploy_tokens_helper.rb
+2
-0
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+6
-5
app/helpers/dropdowns_helper.rb
app/helpers/dropdowns_helper.rb
+6
-5
app/helpers/emails_helper.rb
app/helpers/emails_helper.rb
+4
-2
app/helpers/emoji_helper.rb
app/helpers/emoji_helper.rb
+2
-0
app/helpers/environment_helper.rb
app/helpers/environment_helper.rb
+2
-0
app/helpers/environments_helper.rb
app/helpers/environments_helper.rb
+2
-0
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+2
-0
app/helpers/explore_helper.rb
app/helpers/explore_helper.rb
+2
-0
app/helpers/external_wiki_helper.rb
app/helpers/external_wiki_helper.rb
+2
-0
app/helpers/favicon_helper.rb
app/helpers/favicon_helper.rb
+2
-0
app/helpers/form_helper.rb
app/helpers/form_helper.rb
+2
-0
app/helpers/git_helper.rb
app/helpers/git_helper.rb
+2
-0
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+2
-0
app/helpers/graph_helper.rb
app/helpers/graph_helper.rb
+4
-2
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+10
-15
app/helpers/hooks_helper.rb
app/helpers/hooks_helper.rb
+2
-0
app/helpers/icons_helper.rb
app/helpers/icons_helper.rb
+12
-8
app/helpers/import_helper.rb
app/helpers/import_helper.rb
+2
-0
app/helpers/instance_configuration_helper.rb
app/helpers/instance_configuration_helper.rb
+2
-0
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+5
-2
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+9
-7
app/helpers/javascript_helper.rb
app/helpers/javascript_helper.rb
+2
-0
app/helpers/kerberos_spnego_helper.rb
app/helpers/kerberos_spnego_helper.rb
+2
-0
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+2
-0
app/helpers/lazy_image_tag_helper.rb
app/helpers/lazy_image_tag_helper.rb
+6
-2
app/helpers/markup_helper.rb
app/helpers/markup_helper.rb
+2
-0
app/helpers/mattermost_helper.rb
app/helpers/mattermost_helper.rb
+2
-0
app/helpers/members_helper.rb
app/helpers/members_helper.rb
+7
-9
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+6
-4
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+9
-9
app/helpers/milestones_routing_helper.rb
app/helpers/milestones_routing_helper.rb
+2
-0
app/helpers/mirror_helper.rb
app/helpers/mirror_helper.rb
+2
-0
app/helpers/namespaces_helper.rb
app/helpers/namespaces_helper.rb
+2
-0
app/helpers/nav_helper.rb
app/helpers/nav_helper.rb
+2
-0
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+2
-0
app/helpers/notifications_helper.rb
app/helpers/notifications_helper.rb
+2
-0
app/helpers/numbers_helper.rb
app/helpers/numbers_helper.rb
+2
-0
app/helpers/page_layout_helper.rb
app/helpers/page_layout_helper.rb
+8
-6
app/helpers/pagination_helper.rb
app/helpers/pagination_helper.rb
+2
-0
app/helpers/performance_bar_helper.rb
app/helpers/performance_bar_helper.rb
+2
-0
app/helpers/pipeline_schedules_helper.rb
app/helpers/pipeline_schedules_helper.rb
+2
-0
app/helpers/preferences_helper.rb
app/helpers/preferences_helper.rb
+2
-0
app/helpers/profiles_helper.rb
app/helpers/profiles_helper.rb
+2
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+6
-11
app/helpers/repository_languages_helper.rb
app/helpers/repository_languages_helper.rb
+2
-0
app/helpers/rss_helper.rb
app/helpers/rss_helper.rb
+2
-0
app/helpers/runners_helper.rb
app/helpers/runners_helper.rb
+2
-0
No files found.
app/helpers/accounts_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AccountsHelper
module
AccountsHelper
def
incoming_email_token_enabled?
def
incoming_email_token_enabled?
current_user
.
incoming_email_token
&&
Gitlab
::
IncomingEmail
.
supports_issue_creation?
current_user
.
incoming_email_token
&&
Gitlab
::
IncomingEmail
.
supports_issue_creation?
...
...
app/helpers/active_sessions_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ActiveSessionsHelper
module
ActiveSessionsHelper
# Maps a device type as defined in `ActiveSession` to an svg icon name and
# Maps a device type as defined in `ActiveSession` to an svg icon name and
# outputs the icon html.
# outputs the icon html.
...
...
app/helpers/appearances_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AppearancesHelper
module
AppearancesHelper
def
brand_title
def
brand_title
current_appearance
&
.
title
.
presence
||
'GitLab Community Edition'
current_appearance
&
.
title
.
presence
||
'GitLab Community Edition'
...
...
app/helpers/application_helper.rb
View file @
1993a444
# frozen_string_literal: true
require
'digest/md5'
require
'digest/md5'
require
'uri'
require
'uri'
...
@@ -106,11 +108,11 @@ def extra_config
...
@@ -106,11 +108,11 @@ def extra_config
#
#
# Returns an HTML-safe String
# Returns an HTML-safe String
def
time_ago_with_tooltip
(
time
,
placement:
'top'
,
html_class:
''
,
short_format:
false
)
def
time_ago_with_tooltip
(
time
,
placement:
'top'
,
html_class:
''
,
short_format:
false
)
css_classes
=
short_format
?
'js-short-timeago'
:
'js-timeago'
css_classes
=
[
short_format
?
'js-short-timeago'
:
'js-timeago'
]
css_classes
<<
"
#{
html_class
}
"
unless
html_class
.
blank?
css_classes
<<
html_class
unless
html_class
.
blank?
element
=
content_tag
:time
,
l
(
time
,
format:
"%b %d, %Y"
),
element
=
content_tag
:time
,
l
(
time
,
format:
"%b %d, %Y"
),
class:
css_classes
,
class:
css_classes
.
join
(
' '
)
,
title:
l
(
time
.
to_time
.
in_time_zone
,
format: :timeago_tooltip
),
title:
l
(
time
.
to_time
.
in_time_zone
,
format: :timeago_tooltip
),
datetime:
time
.
to_time
.
getutc
.
iso8601
,
datetime:
time
.
to_time
.
getutc
.
iso8601
,
data:
{
data:
{
...
...
app/helpers/application_settings_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ApplicationSettingsHelper
module
ApplicationSettingsHelper
extend
self
extend
self
...
@@ -73,12 +75,12 @@ def import_sources_checkboxes(help_block_id, options = {})
...
@@ -73,12 +75,12 @@ def import_sources_checkboxes(help_block_id, options = {})
def
oauth_providers_checkboxes
def
oauth_providers_checkboxes
button_based_providers
.
map
do
|
source
|
button_based_providers
.
map
do
|
source
|
disabled
=
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
.
include?
(
source
.
to_s
)
disabled
=
Gitlab
::
CurrentSettings
.
disabled_oauth_sign_in_sources
.
include?
(
source
.
to_s
)
css_class
=
'btn'
css_class
=
[
'btn'
]
css_class
<<
'
active'
unless
disabled
css_class
<<
'active'
unless
disabled
checkbox_name
=
'application_setting[enabled_oauth_sign_in_sources][]'
checkbox_name
=
'application_setting[enabled_oauth_sign_in_sources][]'
name
=
Gitlab
::
Auth
::
OAuth
::
Provider
.
label_for
(
source
)
name
=
Gitlab
::
Auth
::
OAuth
::
Provider
.
label_for
(
source
)
label_tag
(
checkbox_name
,
class:
css_class
)
do
label_tag
(
checkbox_name
,
class:
css_class
.
join
(
' '
)
)
do
check_box_tag
(
checkbox_name
,
source
,
!
disabled
,
check_box_tag
(
checkbox_name
,
source
,
!
disabled
,
autocomplete:
'off'
,
autocomplete:
'off'
,
id:
name
.
tr
(
' '
,
'_'
))
+
name
id:
name
.
tr
(
' '
,
'_'
))
+
name
...
...
app/helpers/auth_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AuthHelper
module
AuthHelper
PROVIDERS_WITH_ICONS
=
%w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq)
.
freeze
PROVIDERS_WITH_ICONS
=
%w(twitter github gitlab bitbucket google_oauth2 facebook azure_oauth2 authentiq)
.
freeze
LDAP_PROVIDER
=
/\Aldap/
LDAP_PROVIDER
=
/\Aldap/
...
...
app/helpers/auto_devops_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AutoDevopsHelper
module
AutoDevopsHelper
def
show_auto_devops_callout?
(
project
)
def
show_auto_devops_callout?
(
project
)
Feature
.
get
(
:auto_devops_banner_disabled
).
off?
&&
Feature
.
get
(
:auto_devops_banner_disabled
).
off?
&&
...
...
app/helpers/avatars_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AvatarsHelper
module
AvatarsHelper
def
project_icon
(
project_id
,
options
=
{})
def
project_icon
(
project_id
,
options
=
{})
source_icon
(
Project
,
project_id
,
options
)
source_icon
(
Project
,
project_id
,
options
)
...
@@ -125,9 +127,9 @@ def source_icon(klass, source_id, options = {})
...
@@ -125,9 +127,9 @@ def source_icon(klass, source_id, options = {})
def
source_identicon
(
source
,
options
=
{})
def
source_identicon
(
source
,
options
=
{})
bg_key
=
(
source
.
id
%
7
)
+
1
bg_key
=
(
source
.
id
%
7
)
+
1
options
[
:class
]
||=
''
options
[
:class
]
<<
' identicon'
options
[
:class
]
=
options
[
:class
]
<<
"
bg
#{
bg_key
}
"
[
*
options
[
:class
]
,
"identicon
bg
#{
bg_key
}
"
].
join
(
' '
)
content_tag
(
:div
,
class:
options
[
:class
].
strip
)
do
content_tag
(
:div
,
class:
options
[
:class
].
strip
)
do
source
.
name
[
0
,
1
].
upcase
source
.
name
[
0
,
1
].
upcase
...
...
app/helpers/award_emoji_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
AwardEmojiHelper
module
AwardEmojiHelper
def
toggle_award_url
(
awardable
)
def
toggle_award_url
(
awardable
)
return
url_for
([
:toggle_award_emoji
,
awardable
])
unless
@project
||
awardable
.
is_a?
(
Note
)
return
url_for
([
:toggle_award_emoji
,
awardable
])
unless
@project
||
awardable
.
is_a?
(
Note
)
...
...
app/helpers/blame_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BlameHelper
module
BlameHelper
def
age_map_duration
(
blame_groups
,
project
)
def
age_map_duration
(
blame_groups
,
project
)
now
=
Time
.
zone
.
now
now
=
Time
.
zone
.
now
...
...
app/helpers/blob_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BlobHelper
module
BlobHelper
def
highlight
(
blob_name
,
blob_content
,
repository:
nil
,
plain:
false
)
def
highlight
(
blob_name
,
blob_content
,
repository:
nil
,
plain:
false
)
plain
||=
blob_content
.
length
>
Blob
::
MAXIMUM_TEXT_HIGHLIGHT_SIZE
plain
||=
blob_content
.
length
>
Blob
::
MAXIMUM_TEXT_HIGHLIGHT_SIZE
...
...
app/helpers/boards_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BoardsHelper
module
BoardsHelper
def
board
def
board
@board
||=
@board
||
@boards
.
first
@board
||=
@board
||
@boards
.
first
...
...
app/helpers/branches_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BranchesHelper
module
BranchesHelper
def
project_branches
def
project_branches
options_for_select
(
@project
.
repository
.
branch_names
,
@project
.
default_branch
)
options_for_select
(
@project
.
repository
.
branch_names
,
@project
.
default_branch
)
...
...
app/helpers/breadcrumbs_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BreadcrumbsHelper
module
BreadcrumbsHelper
def
add_to_breadcrumbs
(
text
,
link
)
def
add_to_breadcrumbs
(
text
,
link
)
@breadcrumbs_extra_links
||=
[]
@breadcrumbs_extra_links
||=
[]
...
...
app/helpers/broadcast_messages_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BroadcastMessagesHelper
module
BroadcastMessagesHelper
def
broadcast_message
(
message
)
def
broadcast_message
(
message
)
return
unless
message
.
present?
return
unless
message
.
present?
...
@@ -8,18 +10,17 @@ def broadcast_message(message)
...
@@ -8,18 +10,17 @@ def broadcast_message(message)
end
end
def
broadcast_message_style
(
broadcast_message
)
def
broadcast_message_style
(
broadcast_message
)
style
=
''
style
=
[]
if
broadcast_message
.
color
.
present?
if
broadcast_message
.
color
.
present?
style
<<
"background-color:
#{
broadcast_message
.
color
}
"
style
<<
"background-color:
#{
broadcast_message
.
color
}
"
style
<<
'; '
if
broadcast_message
.
font
.
present?
end
end
if
broadcast_message
.
font
.
present?
if
broadcast_message
.
font
.
present?
style
<<
"color:
#{
broadcast_message
.
font
}
"
style
<<
"color:
#{
broadcast_message
.
font
}
"
end
end
style
style
.
join
(
'; '
)
end
end
def
broadcast_message_status
(
broadcast_message
)
def
broadcast_message_status
(
broadcast_message
)
...
...
app/helpers/builds_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
BuildsHelper
module
BuildsHelper
def
build_summary
(
build
,
skip:
false
)
def
build_summary
(
build
,
skip:
false
)
if
build
.
has_trace?
if
build
.
has_trace?
...
@@ -12,10 +14,10 @@ def build_summary(build, skip: false)
...
@@ -12,10 +14,10 @@ def build_summary(build, skip: false)
end
end
def
sidebar_build_class
(
build
,
current_build
)
def
sidebar_build_class
(
build
,
current_build
)
build_class
=
''
build_class
=
[]
build_class
+=
'
active'
if
build
.
id
===
current_build
.
id
build_class
<<
'active'
if
build
.
id
===
current_build
.
id
build_class
+=
'
retried'
if
build
.
retried?
build_class
<<
'retried'
if
build
.
retried?
build_class
build_class
.
join
(
' '
)
end
end
def
javascript_build_options
def
javascript_build_options
...
...
app/helpers/button_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ButtonHelper
module
ButtonHelper
# Output a "Copy to Clipboard" button
# Output a "Copy to Clipboard" button
#
#
...
...
app/helpers/calendar_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
CalendarHelper
module
CalendarHelper
def
calendar_url_options
def
calendar_url_options
{
format: :ics
,
{
format: :ics
,
...
...
app/helpers/ci_status_helper.rb
View file @
1993a444
# frozen_string_literal: true
##
##
# DEPRECATED
# DEPRECATED
#
#
...
...
app/helpers/clusters_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ClustersHelper
module
ClustersHelper
def
has_multiple_clusters?
(
project
)
def
has_multiple_clusters?
(
project
)
false
false
...
...
app/helpers/commits_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
CommitsHelper
module
CommitsHelper
# Returns a link to the commit author. If the author has a matching user and
# Returns a link to the commit author. If the author has a matching user and
# is a member of the current @project it will link to the team member page.
# is a member of the current @project it will link to the team member page.
...
...
app/helpers/compare_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
CompareHelper
module
CompareHelper
def
create_mr_button?
(
from
=
params
[
:from
],
to
=
params
[
:to
],
project
=
@project
)
def
create_mr_button?
(
from
=
params
[
:from
],
to
=
params
[
:to
],
project
=
@project
)
from
.
present?
&&
from
.
present?
&&
...
...
app/helpers/components_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ComponentsHelper
module
ComponentsHelper
def
gitlab_workhorse_version
def
gitlab_workhorse_version
if
request
.
headers
[
'Gitlab-Workhorse'
].
present?
if
request
.
headers
[
'Gitlab-Workhorse'
].
present?
...
...
app/helpers/conversational_development_index_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ConversationalDevelopmentIndexHelper
module
ConversationalDevelopmentIndexHelper
def
score_level
(
score
)
def
score_level
(
score
)
if
score
<
33.33
if
score
<
33.33
...
...
app/helpers/count_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
CountHelper
module
CountHelper
def
approximate_count_with_delimiters
(
count_data
,
model
)
def
approximate_count_with_delimiters
(
count_data
,
model
)
count
=
count_data
[
model
]
count
=
count_data
[
model
]
...
...
app/helpers/dashboard_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
DashboardHelper
module
DashboardHelper
def
assigned_issues_dashboard_path
def
assigned_issues_dashboard_path
issues_dashboard_path
(
assignee_id:
current_user
.
id
)
issues_dashboard_path
(
assignee_id:
current_user
.
id
)
...
...
app/helpers/defer_script_tag_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
DeferScriptTagHelper
module
DeferScriptTagHelper
# Override the default ActionView `javascript_include_tag` helper to support page specific deferred loading
# Override the default ActionView `javascript_include_tag` helper to support page specific deferred loading
def
javascript_include_tag
(
*
sources
)
def
javascript_include_tag
(
*
sources
)
...
...
app/helpers/deploy_tokens_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
DeployTokensHelper
module
DeployTokensHelper
def
expand_deploy_tokens_section?
(
deploy_token
)
def
expand_deploy_tokens_section?
(
deploy_token
)
deploy_token
.
persisted?
||
deploy_token
.
persisted?
||
...
...
app/helpers/diff_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
DiffHelper
module
DiffHelper
def
mark_inline_diffs
(
old_line
,
new_line
)
def
mark_inline_diffs
(
old_line
,
new_line
)
old_diffs
,
new_diffs
=
Gitlab
::
Diff
::
InlineDiff
.
new
(
old_line
,
new_line
).
inline_diffs
old_diffs
,
new_diffs
=
Gitlab
::
Diff
::
InlineDiff
.
new
(
old_line
,
new_line
).
inline_diffs
...
@@ -39,7 +41,8 @@ def diff_match_line(old_pos, new_pos, text: '', view: :inline, bottom: false)
...
@@ -39,7 +41,8 @@ def diff_match_line(old_pos, new_pos, text: '', view: :inline, bottom: false)
line_num_class
=
%w[diff-line-num unfold js-unfold]
line_num_class
=
%w[diff-line-num unfold js-unfold]
line_num_class
<<
'js-unfold-bottom'
if
bottom
line_num_class
<<
'js-unfold-bottom'
if
bottom
html
=
''
html
=
[]
if
old_pos
if
old_pos
html
<<
content_tag
(
:td
,
'...'
,
class:
[
*
line_num_class
,
'old_line'
],
data:
{
linenumber:
old_pos
})
html
<<
content_tag
(
:td
,
'...'
,
class:
[
*
line_num_class
,
'old_line'
],
data:
{
linenumber:
old_pos
})
html
<<
content_tag
(
:td
,
text
,
class:
[
*
content_line_class
,
'left-side'
])
if
view
==
:parallel
html
<<
content_tag
(
:td
,
text
,
class:
[
*
content_line_class
,
'left-side'
])
if
view
==
:parallel
...
@@ -50,7 +53,7 @@ def diff_match_line(old_pos, new_pos, text: '', view: :inline, bottom: false)
...
@@ -50,7 +53,7 @@ def diff_match_line(old_pos, new_pos, text: '', view: :inline, bottom: false)
html
<<
content_tag
(
:td
,
text
,
class:
[
*
content_line_class
,
(
'right-side'
if
view
==
:parallel
)])
html
<<
content_tag
(
:td
,
text
,
class:
[
*
content_line_class
,
(
'right-side'
if
view
==
:parallel
)])
end
end
html
.
html_safe
html
.
join
.
html_safe
end
end
def
diff_line_content
(
line
)
def
diff_line_content
(
line
)
...
@@ -215,9 +218,7 @@ def params_with_whitespace
...
@@ -215,9 +218,7 @@ def params_with_whitespace
end
end
def
toggle_whitespace_link
(
url
,
options
)
def
toggle_whitespace_link
(
url
,
options
)
options
[
:class
]
||=
''
options
[
:class
]
=
[
*
options
[
:class
],
'btn btn-default'
].
join
(
' '
)
options
[
:class
]
<<
' btn btn-default'
link_to
"
#{
hide_whitespace?
?
'Show'
:
'Hide'
}
whitespace changes"
,
url
,
class:
options
[
:class
]
link_to
"
#{
hide_whitespace?
?
'Show'
:
'Hide'
}
whitespace changes"
,
url
,
class:
options
[
:class
]
end
end
...
...
app/helpers/dropdowns_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
DropdownsHelper
module
DropdownsHelper
def
dropdown_tag
(
toggle_text
,
options:
{},
&
block
)
def
dropdown_tag
(
toggle_text
,
options:
{},
&
block
)
content_tag
:div
,
class:
"dropdown
#{
options
[
:wrapper_class
]
if
options
.
key?
(
:wrapper_class
)
}
"
do
content_tag
:div
,
class:
"dropdown
#{
options
[
:wrapper_class
]
if
options
.
key?
(
:wrapper_class
)
}
"
do
...
@@ -10,7 +12,7 @@ def dropdown_tag(toggle_text, options: {}, &block)
...
@@ -10,7 +12,7 @@ def dropdown_tag(toggle_text, options: {}, &block)
dropdown_output
=
dropdown_toggle
(
toggle_text
,
data_attr
,
options
)
dropdown_output
=
dropdown_toggle
(
toggle_text
,
data_attr
,
options
)
dropdown_output
<<
content_tag
(
:div
,
class:
"dropdown-menu dropdown-select
#{
options
[
:dropdown_class
]
if
options
.
key?
(
:dropdown_class
)
}
"
)
do
dropdown_output
<<
content_tag
(
:div
,
class:
"dropdown-menu dropdown-select
#{
options
[
:dropdown_class
]
if
options
.
key?
(
:dropdown_class
)
}
"
)
do
output
=
""
output
=
[]
if
options
.
key?
(
:title
)
if
options
.
key?
(
:title
)
output
<<
dropdown_title
(
options
[
:title
])
output
<<
dropdown_title
(
options
[
:title
])
...
@@ -31,8 +33,7 @@ def dropdown_tag(toggle_text, options: {}, &block)
...
@@ -31,8 +33,7 @@ def dropdown_tag(toggle_text, options: {}, &block)
end
end
output
<<
dropdown_loading
output
<<
dropdown_loading
output
.
join
.
html_safe
output
.
html_safe
end
end
dropdown_output
.
html_safe
dropdown_output
.
html_safe
...
@@ -50,7 +51,7 @@ def dropdown_toggle(toggle_text, data_attr, options = {})
...
@@ -50,7 +51,7 @@ def dropdown_toggle(toggle_text, data_attr, options = {})
def
dropdown_title
(
title
,
options:
{})
def
dropdown_title
(
title
,
options:
{})
content_tag
:div
,
class:
"dropdown-title"
do
content_tag
:div
,
class:
"dropdown-title"
do
title_output
=
""
title_output
=
[]
if
options
.
fetch
(
:back
,
false
)
if
options
.
fetch
(
:back
,
false
)
title_output
<<
content_tag
(
:button
,
class:
"dropdown-title-button dropdown-menu-back"
,
aria:
{
label:
"Go back"
},
type:
"button"
)
do
title_output
<<
content_tag
(
:button
,
class:
"dropdown-title-button dropdown-menu-back"
,
aria:
{
label:
"Go back"
},
type:
"button"
)
do
...
@@ -66,7 +67,7 @@ def dropdown_title(title, options: {})
...
@@ -66,7 +67,7 @@ def dropdown_title(title, options: {})
end
end
end
end
title_output
.
html_safe
title_output
.
join
.
html_safe
end
end
end
end
...
...
app/helpers/emails_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
EmailsHelper
module
EmailsHelper
include
AppearancesHelper
include
AppearancesHelper
...
@@ -49,8 +51,8 @@ def password_reset_token_valid_time
...
@@ -49,8 +51,8 @@ def password_reset_token_valid_time
def
reset_token_expire_message
def
reset_token_expire_message
link_tag
=
link_to
(
'request a new one'
,
new_user_password_url
(
user_email:
@user
.
email
))
link_tag
=
link_to
(
'request a new one'
,
new_user_password_url
(
user_email:
@user
.
email
))
msg
=
"This link is valid for
#{
password_reset_token_valid_time
}
. "
"This link is valid for
#{
password_reset_token_valid_time
}
. "
\
msg
<<
"After it expires, you can
#{
link_tag
}
."
"After it expires, you can
#{
link_tag
}
."
end
end
def
header_logo
def
header_logo
...
...
app/helpers/emoji_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
EmojiHelper
module
EmojiHelper
def
emoji_icon
(
*
args
)
def
emoji_icon
(
*
args
)
raw
Gitlab
::
Emoji
.
gl_emoji_tag
(
*
args
)
raw
Gitlab
::
Emoji
.
gl_emoji_tag
(
*
args
)
...
...
app/helpers/environment_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
EnvironmentHelper
module
EnvironmentHelper
def
environment_for_build
(
project
,
build
)
def
environment_for_build
(
project
,
build
)
return
unless
build
.
environment
return
unless
build
.
environment
...
...
app/helpers/environments_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
EnvironmentsHelper
module
EnvironmentsHelper
def
environments_list_data
def
environments_list_data
{
{
...
...
app/helpers/events_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
EventsHelper
module
EventsHelper
ICON_NAMES_BY_EVENT_TYPE
=
{
ICON_NAMES_BY_EVENT_TYPE
=
{
'pushed to'
=>
'commit'
,
'pushed to'
=>
'commit'
,
...
...
app/helpers/explore_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ExploreHelper
module
ExploreHelper
def
filter_projects_path
(
options
=
{})
def
filter_projects_path
(
options
=
{})
exist_opts
=
{
exist_opts
=
{
...
...
app/helpers/external_wiki_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
ExternalWikiHelper
module
ExternalWikiHelper
def
get_project_wiki_path
(
project
)
def
get_project_wiki_path
(
project
)
external_wiki_service
=
project
.
external_wiki
external_wiki_service
=
project
.
external_wiki
...
...
app/helpers/favicon_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
FaviconHelper
module
FaviconHelper
def
favicon_extension_whitelist
def
favicon_extension_whitelist
FaviconUploader
::
EXTENSION_WHITELIST
FaviconUploader
::
EXTENSION_WHITELIST
...
...
app/helpers/form_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
FormHelper
module
FormHelper
def
form_errors
(
model
,
type:
'form'
)
def
form_errors
(
model
,
type:
'form'
)
return
unless
model
.
errors
.
any?
return
unless
model
.
errors
.
any?
...
...
app/helpers/git_helper.rb
View file @
1993a444
# frozen_string_literal: true
module
GitHelper
module
GitHelper
def
strip_gpg_signature
(
text
)
def
strip_gpg_signature
(
text
)
text
.
gsub
(
/-----BEGIN PGP SIGNATURE-----(.*)-----END PGP SIGNATURE-----/m
,
""
)