Commit ef6ce7a9 authored by Douwe Maan's avatar Douwe Maan

More backend cleanup

parent f711b2df
...@@ -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
......
...@@ -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'
......
...@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment