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
ae83dd1a
Commit
ae83dd1a
authored
May 23, 2018
by
Lin Jen-Shin
Committed by
Rémy Coutable
May 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use render_if_exists to hide EE specific codes
parent
288595cc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
28 deletions
+39
-28
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+5
-0
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+6
-23
config/application.rb
config/application.rb
+4
-4
ee/app/views/admin/dashboard/_elastic_and_geo.html.haml
ee/app/views/admin/dashboard/_elastic_and_geo.html.haml
+10
-0
ee/app/views/admin/dashboard/_geo.html.haml
ee/app/views/admin/dashboard/_geo.html.haml
+9
-0
ee/app/views/admin/dashboard/_users_statistics.html.haml
ee/app/views/admin/dashboard/_users_statistics.html.haml
+2
-0
ee/app/views/admin/licenses/_breakdown.html.haml
ee/app/views/admin/licenses/_breakdown.html.haml
+2
-0
lib/banzai/reference_parser/epic_parser.rb
lib/banzai/reference_parser/epic_parser.rb
+1
-1
No files found.
app/helpers/application_helper.rb
View file @
ae83dd1a
...
...
@@ -4,6 +4,11 @@ require 'uri'
module
ApplicationHelper
prepend
EE
::
ApplicationHelper
# See https://docs.gitlab.com/ee/development/ee_features.html#code-in-app-views
def
render_if_exists
(
partial
,
locals
=
{})
render
(
partial
,
locals
)
if
lookup_context
.
exists?
(
partial
,
[],
true
)
end
# Check if a particular controller is the current one
#
# args - One or more controller names to check
...
...
app/views/admin/dashboard/index.html.haml
View file @
ae83dd1a
...
...
@@ -2,8 +2,7 @@
-
breadcrumb_title
"Dashboard"
%div
{
class:
container_class
}
-
if
@license
=
render
"admin/licenses/breakdown"
,
license:
@license
=
render_if_exists
"admin/licenses/breakdown"
,
license:
@license
.admin-dashboard.prepend-top-default
.row
...
...
@@ -23,9 +22,7 @@
%h3
.text-center
Users:
=
approximate_count_with_delimiters
(
User
)
-# EE specific
.text-center
=
link_to
'Users statistics'
,
admin_dashboard_stats_path
=
render_if_exists
'users_statistics'
%hr
=
link_to
'New user'
,
new_admin_user_path
,
class:
"btn btn-new"
.col-sm-4
...
...
@@ -104,16 +101,7 @@
%span
.light.pull-right
=
boolean_to_icon
Gitlab
::
IncomingEmail
.
enabled?
-
elastic
=
"Elasticsearch"
%p
{
"aria-label"
=>
"#{elastic}: status "
+
(
Gitlab
::
CurrentSettings
.
elasticsearch_search?
?
"on"
:
"off"
)
}
=
elastic
%span
.light.pull-right
=
boolean_to_icon
Gitlab
::
CurrentSettings
.
elasticsearch_search?
-
geo
=
link_to
'Geo'
,
admin_geo_nodes_path
%p
{
"aria-label"
=>
"#{geo}: status "
+
(
Gitlab
::
Geo
.
enabled?
?
"on"
:
"off"
)
}
=
geo
%span
.light.pull-right
=
boolean_to_icon
Gitlab
::
Geo
.
enabled?
=
render_if_exists
'elastic_and_geo'
-
container_reg
=
"Container Registry"
%p
{
"aria-label"
=>
"#{container_reg}: status "
+
(
Gitlab
.
config
.
registry
.
enabled
?
"on"
:
"off"
)
}
...
...
@@ -162,14 +150,9 @@
GitLab Pages
%span
.pull-right
=
Gitlab
::
Pages
::
VERSION
-
if
Gitlab
::
Geo
.
enabled?
%p
=
link_to
'Geo'
,
admin_geo_nodes_path
%span
.pull-right
-
if
Gitlab
::
Geo
.
current_node
=
Gitlab
::
Geo
.
current_node
.
primary
?
'Primary node'
:
'Secondary node'
-
else
Undefined
=
render_if_exists
'geo'
%p
Ruby
%span
.pull-right
...
...
config/application.rb
View file @
ae83dd1a
...
...
@@ -44,11 +44,11 @@ module Gitlab
ee_path
=
config
.
root
.
join
(
'ee'
,
Pathname
.
new
(
path
).
relative_path_from
(
config
.
root
))
memo
<<
ee_path
.
to_s
if
ee_path
.
exist?
end
config
.
eager_load_paths
.
concat
(
ee_paths
)
config
.
eager_load_paths
.
unshift
(
*
ee_paths
)
config
.
paths
[
'lib/tasks'
]
<<
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'app/views'
]
<<
"
#{
config
.
root
}
/ee/app/views"
config
.
helpers_paths
<<
"
#{
config
.
root
}
/ee/app/helpers"
config
.
paths
[
'lib/tasks'
]
.
unshift
"
#{
config
.
root
}
/ee/lib/tasks"
config
.
paths
[
'app/views'
]
.
unshift
"
#{
config
.
root
}
/ee/app/views"
config
.
helpers_paths
.
unshift
"
#{
config
.
root
}
/ee/app/helpers"
## EE-specific paths config END
# Rake tasks ignore the eager loading settings, so we need to set the
...
...
ee/app/views/admin/dashboard/_elastic_and_geo.html.haml
0 → 100644
View file @
ae83dd1a
-
elastic
=
"Elasticsearch"
%p
{
"aria-label"
=>
"#{elastic}: status "
+
(
Gitlab
::
CurrentSettings
.
elasticsearch_search?
?
"on"
:
"off"
)
}
=
elastic
%span
.light.pull-right
=
boolean_to_icon
Gitlab
::
CurrentSettings
.
elasticsearch_search?
-
geo
=
link_to
'Geo'
,
admin_geo_nodes_path
%p
{
"aria-label"
=>
"#{geo}: status "
+
(
Gitlab
::
Geo
.
enabled?
?
"on"
:
"off"
)
}
=
geo
%span
.light.pull-right
=
boolean_to_icon
Gitlab
::
Geo
.
enabled?
ee/app/views/admin/dashboard/_geo.html.haml
0 → 100644
View file @
ae83dd1a
-
return
unless
Gitlab
::
Geo
.
enabled?
%p
=
link_to
'Geo'
,
admin_geo_nodes_path
%span
.pull-right
-
if
Gitlab
::
Geo
.
current_node
=
Gitlab
::
Geo
.
current_node
.
primary
?
'Primary node'
:
'Secondary node'
-
else
Undefined
ee/app/views/admin/dashboard/_users_statistics.html.haml
0 → 100644
View file @
ae83dd1a
.text-center
=
link_to
'Users statistics'
,
admin_dashboard_stats_path
ee/app/views/admin/licenses/_breakdown.html.haml
View file @
ae83dd1a
-
return
unless
local_assigns
.
fetch
(
:license
)
-
if
license
.
restricted?
(
:active_user_count
)
-
restricted
=
license
.
restrictions
[
:active_user_count
]
-
licensed_users
=
number_with_delimiter
(
restricted
)
...
...
lib/banzai/reference_parser/epic_parser.rb
View file @
ae83dd1a
...
...
@@ -2,7 +2,7 @@ module Banzai
module
ReferenceParser
# The actual parser is implemented in the EE mixin
class
EpicParser
<
IssuableParser
prepend
EE
::
Banzai
::
ReferenceParser
::
EpicParser
prepend
::
EE
::
Banzai
::
ReferenceParser
::
EpicParser
self
.
reference_type
=
:epic
...
...
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