2015-10-17 13:17:13 -04:00
|
|
|
.tree-ref-holder
|
|
|
|
= render 'shared/ref_switcher', destination: 'tree', path: @path
|
|
|
|
|
|
|
|
%ul.breadcrumb.repo-breadcrumb
|
|
|
|
%li
|
|
|
|
= link_to namespace_project_tree_path(@project.namespace, @project, @ref) do
|
|
|
|
= @project.path
|
|
|
|
- tree_breadcrumbs(tree, 6) do |title, path|
|
|
|
|
%li
|
|
|
|
- if path
|
|
|
|
= link_to truncate(title, length: 40), namespace_project_tree_path(@project.namespace, @project, path)
|
|
|
|
- else
|
|
|
|
= link_to title, '#'
|
2015-12-18 04:03:34 -05:00
|
|
|
|
|
|
|
- if current_user
|
2015-10-17 13:17:13 -04:00
|
|
|
%li
|
2015-12-18 04:03:34 -05:00
|
|
|
- if !on_top_of_branch?
|
2016-12-26 05:47:16 -05:00
|
|
|
%span.btn.add-to-tree.disabled.has-tooltip{ title: "You can only add files when you are on a branch", data: { container: 'body' } }
|
2015-10-17 13:17:13 -04:00
|
|
|
= icon('plus')
|
2015-12-18 11:15:05 -05:00
|
|
|
- else
|
2015-12-18 04:03:34 -05:00
|
|
|
%span.dropdown
|
2016-12-26 05:47:16 -05:00
|
|
|
%a.dropdown-toggle.btn.add-to-tree{ href: '#', "data-toggle" => "dropdown" }
|
2015-12-18 04:03:34 -05:00
|
|
|
= icon('plus')
|
|
|
|
%ul.dropdown-menu
|
2015-12-18 11:15:05 -05:00
|
|
|
- if can_edit_tree?
|
|
|
|
%li
|
|
|
|
= link_to namespace_project_new_blob_path(@project.namespace, @project, @id) do
|
|
|
|
= icon('pencil fw')
|
|
|
|
New file
|
|
|
|
%li
|
2016-12-26 05:47:16 -05:00
|
|
|
= link_to '#modal-upload-blob', { 'data-target' => '#modal-upload-blob', 'data-toggle' => 'modal' } do
|
2015-12-18 11:15:05 -05:00
|
|
|
= icon('file fw')
|
|
|
|
Upload file
|
|
|
|
%li
|
2016-12-26 05:47:16 -05:00
|
|
|
= link_to '#modal-create-new-dir', { 'data-target' => '#modal-create-new-dir', 'data-toggle' => 'modal' } do
|
2015-12-18 11:15:05 -05:00
|
|
|
= icon('folder fw')
|
|
|
|
New directory
|
|
|
|
- elsif can?(current_user, :fork_project, @project)
|
|
|
|
%li
|
|
|
|
- continue_params = { to: namespace_project_new_blob_path(@project.namespace, @project, @id),
|
|
|
|
notice: edit_in_new_fork_notice,
|
|
|
|
notice_now: edit_in_new_fork_notice_now }
|
2016-01-11 14:44:31 -05:00
|
|
|
- fork_path = namespace_project_forks_path(@project.namespace, @project, namespace_key: current_user.namespace.id,
|
2015-12-18 11:15:05 -05:00
|
|
|
continue: continue_params)
|
|
|
|
= link_to fork_path, method: :post do
|
|
|
|
= icon('pencil fw')
|
|
|
|
New file
|
|
|
|
%li
|
|
|
|
- continue_params = { to: request.fullpath,
|
|
|
|
notice: edit_in_new_fork_notice + " Try to upload a file again.",
|
|
|
|
notice_now: edit_in_new_fork_notice_now }
|
2016-01-11 14:44:31 -05:00
|
|
|
- fork_path = namespace_project_forks_path(@project.namespace, @project, namespace_key: current_user.namespace.id,
|
2015-12-18 11:15:05 -05:00
|
|
|
continue: continue_params)
|
|
|
|
= link_to fork_path, method: :post do
|
|
|
|
= icon('file fw')
|
|
|
|
Upload file
|
|
|
|
%li
|
|
|
|
- continue_params = { to: request.fullpath,
|
|
|
|
notice: edit_in_new_fork_notice + " Try to create a new directory again.",
|
|
|
|
notice_now: edit_in_new_fork_notice_now }
|
2016-01-11 14:44:31 -05:00
|
|
|
- fork_path = namespace_project_forks_path(@project.namespace, @project, namespace_key: current_user.namespace.id,
|
2015-12-18 11:15:05 -05:00
|
|
|
continue: continue_params)
|
|
|
|
= link_to fork_path, method: :post do
|
|
|
|
= icon('folder fw')
|
|
|
|
New directory
|
|
|
|
|
2015-12-18 04:03:34 -05:00
|
|
|
%li.divider
|
|
|
|
%li
|
2015-12-18 11:15:05 -05:00
|
|
|
= link_to new_namespace_project_branch_path(@project.namespace, @project) do
|
|
|
|
= icon('code-fork fw')
|
|
|
|
New branch
|
2015-12-18 04:03:34 -05:00
|
|
|
%li
|
2015-12-18 11:15:05 -05:00
|
|
|
= link_to new_namespace_project_tag_path(@project.namespace, @project) do
|
|
|
|
= icon('tags fw')
|
|
|
|
New tag
|