BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
23 deletions
+12
-23
projects_controller.rb
app/controllers/projects_controller.rb
+9
-11
tree_helper.rb
app/helpers/tree_helper.rb
+0
-8
_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
find_commits
=
true
unless
find_refs
.
nil?
find_branches
=
find_refs
.
include?
'branches'
find_tags
=
find_refs
.
include?
'tags'
find_commits
=
find_refs
.
include?
'commits'
find_branches
=
find_refs
.
include?
(
'branches'
)
find_tags
=
find_refs
.
include?
(
'tags'
)
find_commits
=
find_refs
.
include?
(
'commits'
)
end
options
=
{}
if
find_branches
branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
.
map
(
&
:name
)
options
=
{
s_
(
'RefSwitcher|Branches'
)
=>
branches
.
take
(
100
)
}
branches
=
BranchesFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
[
s_
(
'RefSwitcher|Branches'
)]
=
branches
end
if
@repository
.
tag_count
.
nonzero?
&&
find_tags
tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
.
map
(
&
:name
)
if
find_tags
&&
@repository
.
tag_count
.
nonzero?
tags
=
TagsFinder
.
new
(
@repository
,
params
).
execute
.
take
(
100
).
map
(
&
:name
)
options
[
s_
(
'RefSwitcher|Tags'
)]
=
tags
.
take
(
100
)
options
[
s_
(
'RefSwitcher|Tags'
)]
=
tags
end
# If reference is commit id - we should add it to branch/tag selectbox
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
]
end
...
...
app/helpers/tree_helper.rb
View file @
ef6ce7a9
...
...
@@ -12,14 +12,6 @@ module TreeHelper
tree
.
html_safe
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
#
# 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 @@
=
render
"projects/blob/auxiliary_viewer"
,
blob:
blob
#blob-content-holder
.blob-content-holder
-
unless
show_new_repo?
%article
.file-holder
=
render
'projects/blob/header'
,
blob:
blob
=
render
'projects/blob/content'
,
blob:
blob
%article
.file-holder
=
render
'projects/blob/header'
,
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