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
95a78fb5
Commit
95a78fb5
authored
Nov 07, 2016
by
Hiroyuki Sato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug of json request url
parent
d8cc8d7a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
app/controllers/projects/network_controller.rb
app/controllers/projects/network_controller.rb
+10
-3
app/views/projects/network/show.html.haml
app/views/projects/network/show.html.haml
+1
-1
No files found.
app/controllers/projects/network_controller.rb
View file @
95a78fb5
...
...
@@ -5,16 +5,16 @@ class Projects::NetworkController < Projects::ApplicationController
before_action
:require_non_empty_project
before_action
:assign_ref_vars
before_action
:authorize_download_code!
before_action
:assign_extended_sha1
def
show
@url
=
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@ref
,
@options
.
merge
(
format: :json
))
@commit_url
=
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
'ae45ca32'
).
gsub
(
"ae45ca32"
,
"%s"
)
@commit
=
@repo
.
commit
(
params
[
:extended_sha1
])
if
params
[
:extended_sha1
].
present?
respond_to
do
|
format
|
format
.
html
do
if
params
[
:extended_sha1
].
present?
&&
!
@commit
flash
.
now
[
:alert
]
=
"Git revision '
#{
param
s
[
:extended_sha1
]
}
' does not exist."
if
@options
[
:extended_sha1
]
&&
!
@commit
flash
.
now
[
:alert
]
=
"Git revision '
#{
@option
s
[
:extended_sha1
]
}
' does not exist."
end
end
...
...
@@ -23,4 +23,11 @@ class Projects::NetworkController < Projects::ApplicationController
end
end
end
def
assign_extended_sha1
return
if
params
[
:extended_sha1
].
blank?
@options
[
:extended_sha1
]
=
params
[
:extended_sha1
]
@commit
=
@repo
.
commit
(
@options
[
:extended_sha1
])
end
end
app/views/projects/network/show.html.haml
View file @
95a78fb5
...
...
@@ -8,7 +8,7 @@
.project-network
.controls
=
form_tag
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@id
),
method: :get
,
class:
'form-inline network-form'
do
|
f
|
=
text_field_tag
:extended_sha1
,
param
s
[
:extended_sha1
],
placeholder:
"Git revision"
,
class:
'search-input form-control input-mx-250 search-sha'
=
text_field_tag
:extended_sha1
,
@option
s
[
:extended_sha1
],
placeholder:
"Git revision"
,
class:
'search-input form-control input-mx-250 search-sha'
=
button_tag
class:
'btn btn-success'
do
=
icon
(
'search'
)
.inline.prepend-left-20
...
...
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