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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
be142e6b
Commit
be142e6b
authored
Sep 23, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the `version_check_enabled` check from view to helper
parent
48cfad90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/helpers/version_check_helper.rb
app/helpers/version_check_helper.rb
+1
-1
app/views/help/index.html.haml
app/views/help/index.html.haml
+1
-2
spec/views/help/index.html.haml_spec.rb
spec/views/help/index.html.haml_spec.rb
+1
-2
No files found.
app/helpers/version_check_helper.rb
View file @
be142e6b
module
VersionCheckHelper
module
VersionCheckHelper
def
version_status_badge
def
version_status_badge
if
Rails
.
env
.
production?
if
Rails
.
env
.
production?
&&
current_application_settings
.
version_check_enabled
image_tag
VersionCheck
.
new
.
url
image_tag
VersionCheck
.
new
.
url
end
end
end
end
...
...
app/views/help/index.html.haml
View file @
be142e6b
...
@@ -5,8 +5,7 @@
...
@@ -5,8 +5,7 @@
-
if
current_user
&&
current_user
.
admin?
-
if
current_user
&&
current_user
.
admin?
%span
=
Gitlab
::
VERSION
%span
=
Gitlab
::
VERSION
%small
=
Gitlab
::
REVISION
%small
=
Gitlab
::
REVISION
-
if
current_application_settings
.
version_check_enabled
=
version_status_badge
=
version_status_badge
%p
.slead
%p
.slead
GitLab is open source software to collaborate on code.
GitLab is open source software to collaborate on code.
%br
%br
...
...
spec/views/help/index.html.haml_spec.rb
View file @
be142e6b
...
@@ -49,7 +49,6 @@ describe 'help/index' do
...
@@ -49,7 +49,6 @@ describe 'help/index' do
def
stub_helpers
def
stub_helpers
allow
(
view
).
to
receive
(
:markdown
).
and_return
(
''
)
allow
(
view
).
to
receive
(
:markdown
).
and_return
(
''
)
allow
(
view
).
to
receive
(
:current_application_settings
).
allow
(
view
).
to
receive
(
:version_status_badge
).
and_return
(
''
)
and_return
(
double
.
as_null_object
)
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