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
Léo-Paul Géneau
gitlab-ce
Commits
c0e3b397
Commit
c0e3b397
authored
Apr 14, 2013
by
Sato Hiroyuki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set @options in assing_ref_vars
@options enable to keep params when switching ref.
parent
97a9c229
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
12 deletions
+14
-12
app/controllers/graph_controller.rb
app/controllers/graph_controller.rb
+2
-8
app/controllers/refs_controller.rb
app/controllers/refs_controller.rb
+1
-1
app/views/graph/_head.html.haml
app/views/graph/_head.html.haml
+3
-1
app/views/graph/show.html.haml
app/views/graph/show.html.haml
+1
-2
app/views/shared/_ref_switcher.html.haml
app/views/shared/_ref_switcher.html.haml
+2
-0
lib/extracts_path.rb
lib/extracts_path.rb
+5
-0
No files found.
app/controllers/graph_controller.rb
View file @
c0e3b397
...
...
@@ -8,14 +8,8 @@ class GraphController < ProjectResourceController
before_filter
:require_non_empty_project
def
show
if
params
.
has_key?
(
:q
)
if
params
[
:q
].
blank?
redirect_to
project_graph_path
(
@project
,
params
[
:id
])
return
end
@q
=
params
[
:q
]
@commit
=
@project
.
repository
.
commit
(
@q
)
||
@commit
if
@options
[
:q
]
@commit
=
@project
.
repository
.
commit
(
@options
[
:q
])
||
@commit
end
respond_to
do
|
format
|
...
...
app/controllers/refs_controller.rb
View file @
c0e3b397
...
...
@@ -14,7 +14,7 @@ class RefsController < ProjectResourceController
elsif
params
[
:destination
]
==
"blob"
project_blob_path
(
@project
,
(
@id
))
elsif
params
[
:destination
]
==
"graph"
project_graph_path
(
@project
,
@id
)
project_graph_path
(
@project
,
@id
,
@options
)
else
project_commits_path
(
@project
,
@id
)
end
...
...
app/views/graph/_head.html.haml
View file @
c0e3b397
...
...
@@ -10,7 +10,9 @@
.control-group
=
label_tag
:search
,
"Looking for commit:"
,
class:
'control-label light'
.controls
=
text_field_tag
:q
,
@
q
,
placeholder:
"Input SHA"
,
class:
"search-input xlarge"
=
text_field_tag
:q
,
@
options
[
:q
]
,
placeholder:
"Input SHA"
,
class:
"search-input xlarge"
=
button_tag
type:
'submit'
,
class:
'btn vtop'
do
%i
.icon-search
-
@options
.
each
do
|
key
,
value
|
=
hidden_field_tag
(
key
,
value
,
id:
nil
)
unless
key
==
"q"
app/views/graph/show.html.haml
View file @
c0e3b397
...
...
@@ -7,9 +7,8 @@
:javascript
var
branch_graph
;
branch_graph
=
new
BranchGraph
(
$
(
"
#holder
"
),
{
url
:
'
#{
project_graph_path
(
@project
,
@ref
,
q:
@q
,
format: :json
)
}
'
,
url
:
'
#{
project_graph_path
(
@project
,
@ref
,
@options
.
merge
(
format: :json
)
)
}
'
,
commit_url
:
'
#{
project_commit_path
(
@project
,
'ae45ca32'
).
gsub
(
"ae45ca32"
,
"%s"
)
}
'
,
ref
:
'
#{
@ref
}
'
,
commit_id
:
'
#{
@commit
.
id
}
'
...
...
app/views/shared/_ref_switcher.html.haml
View file @
c0e3b397
...
...
@@ -3,3 +3,5 @@
=
hidden_field_tag
:destination
,
destination
-
if
defined?
(
path
)
=
hidden_field_tag
:path
,
path
-
@options
&&
@options
.
each
do
|
key
,
value
|
=
hidden_field_tag
key
,
value
,
id:
nil
lib/extracts_path.rb
View file @
c0e3b397
...
...
@@ -106,6 +106,11 @@ module ExtractsPath
@hex_path
=
Digest
::
SHA1
.
hexdigest
(
@path
)
@logs_path
=
logs_file_project_ref_path
(
@project
,
@ref
,
@path
)
# assign allowed options
allowed_options
=
[
"filter_ref"
,
"q"
]
@options
=
params
.
select
{
|
key
,
value
|
allowed_options
.
include?
(
key
)
&&
!
value
.
blank?
}
@options
=
HashWithIndifferentAccess
.
new
(
@options
)
raise
InvalidPathError
unless
@tree
.
exists?
rescue
RuntimeError
,
NoMethodError
,
InvalidPathError
not_found!
...
...
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