summaryrefslogtreecommitdiff
path: root/app/helpers/tree_helper.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 15:03:14 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-01-26 15:03:14 -0800
commit21297e78afd5ddfbfdf62f471acf1ab2f0c2a892 (patch)
treebc5b9f8eea2d427e4cd918309cc2db8dd8820272 /app/helpers/tree_helper.rb
parente07da5989f5ae14dddc130b80210342ca776e6d2 (diff)
downloadgitlab-ce-21297e78afd5ddfbfdf62f471acf1ab2f0c2a892.tar.gz
Refactor blob helpers
Diffstat (limited to 'app/helpers/tree_helper.rb')
-rw-r--r--app/helpers/tree_helper.rb38
1 files changed, 0 insertions, 38 deletions
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index 1d987a6ffc0..727ec3fb231 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -64,32 +64,6 @@ module TreeHelper
::Gitlab::GitAccess.can_push_to_branch?(current_user, project, ref)
end
- def edit_blob_link(project, ref, path, options = {})
- blob =
- begin
- project.repository.blob_at(ref, path)
- rescue
- nil
- end
-
- if blob && blob.text?
- text = 'Edit'
- after = options[:after] || ''
- from_mr = options[:from_merge_request_id]
- link_opts = {}
- link_opts[:from_merge_request_id] = from_mr if from_mr
- cls = 'btn btn-small'
- if allowed_tree_edit?(project, ref)
- link_to text, project_edit_tree_path(project, tree_join(ref, path),
- link_opts), class: cls
- else
- content_tag :span, text, class: cls + ' disabled'
- end + after.html_safe
- else
- ''
- end
- end
-
def tree_breadcrumbs(tree, max_links = 2)
if @path.present?
part_path = ""
@@ -121,16 +95,4 @@ module TreeHelper
return tree.name
end
end
-
- def leave_edit_message
- "Leave edit mode?\nAll unsaved changes will be lost."
- end
-
- def editing_preview_title(filename)
- if Gitlab::MarkdownHelper.previewable?(filename)
- 'Preview'
- else
- 'Diff'
- end
- end
end