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
ef6ce7a9
Commit
ef6ce7a9
authored
Aug 03, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More backend cleanup
parent
f711b2df
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
23 deletions
+12
-23
app/controllers/projects_controller.rb
app/controllers/projects_controller.rb
+9
-11
app/helpers/tree_helper.rb
app/helpers/tree_helper.rb
+0
-8
app/views/projects/blob/_blob.html.haml
app/views/projects/blob/_blob.html.haml
+3
-4
No files found.
app/controllers/projects_controller.rb
View file @
ef6ce7a9
...
@@ -227,29 +227,27 @@ class ProjectsController < Projects::ApplicationController
...
@@ -227,29 +227,27 @@ class ProjectsController < Projects::ApplicationController
find_commits
=
true
find_commits
=
true
unless
find_refs
.
nil?
unless
find_refs
.
nil?
find_branches
=
find_refs
.
include?
'branches'
find_branches
=
find_refs
.
include?
(
'branches'
)
find_tags
=
find_refs
.
include?
'tags'
find_tags
=
find_refs
.
include?
(
'tags'
)
find_commits
=
find_refs
.
include?
'commits'
find_commits
=
find_refs
.
include?
(
'commits'
)
end
end
options
=
{}
options
=
{}
if
find_branches
if
find_branches
branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
.
map
(
&
:name
)
branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
=
{
options
[
s_
(
'RefSwitcher|Branches'
)]
=
branches
s_
(
'RefSwitcher|Branches'
)
=>
branches
.
take
(
100
)
}
end
end
if
@repository
.
tag_count
.
nonzero?
&&
find_tags
if
find_tags
&&
@repository
.
tag_count
.
nonzero?
tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
.
map
(
&
:name
)
tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
[
s_
(
'RefSwitcher|Tags'
)]
=
tags
.
take
(
100
)
options
[
s_
(
'RefSwitcher|Tags'
)]
=
tags
end
end
# If reference is commit id - we should add it to branch/tag selectbox
# If reference is commit id - we should add it to branch/tag selectbox
ref
=
Addressable
::
URI
.
unescape
(
params
[
:ref
])
ref
=
Addressable
::
URI
.
unescape
(
params
[
:ref
])
if
ref
&&
options
.
flatten
(
2
).
exclude?
(
ref
)
&&
ref
=~
/\A[0-9a-zA-Z]{6,52}\z/
&&
find_commits
if
find_commits
&&
ref
&&
options
.
flatten
(
2
).
exclude?
(
ref
)
&&
ref
=~
/\A[0-9a-zA-Z]{6,52}\z/
options
[
'Commits'
]
=
[
ref
]
options
[
'Commits'
]
=
[
ref
]
end
end
...
...
app/helpers/tree_helper.rb
View file @
ef6ce7a9
...
@@ -12,14 +12,6 @@ module TreeHelper
...
@@ -12,14 +12,6 @@ module TreeHelper
tree
.
html_safe
tree
.
html_safe
end
end
def
repo_url
(
project
)
if
controller_name
==
'projects'
readme_path
(
project
)
||
project_tree_path
(
project
,
project
.
default_branch
)
else
request
.
original_url
end
end
# Return an image icon depending on the file type and mode
# Return an image icon depending on the file type and mode
#
#
# type - String type of the tree item; either 'folder' or 'file'
# type - String type of the tree item; either 'folder' or 'file'
...
...
app/views/projects/blob/_blob.html.haml
View file @
ef6ce7a9
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
=
render
"projects/blob/auxiliary_viewer"
,
blob:
blob
=
render
"projects/blob/auxiliary_viewer"
,
blob:
blob
#blob-content-holder
.blob-content-holder
#blob-content-holder
.blob-content-holder
-
unless
show_new_repo?
%article
.file-holder
%article
.file-holder
=
render
'projects/blob/header'
,
blob:
blob
=
render
'projects/blob/header'
,
blob:
blob
=
render
'projects/blob/content'
,
blob:
blob
=
render
'projects/blob/content'
,
blob:
blob
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