_tree_content.html.haml 1.59 KB
Newer Older
1
.tree-content-holder
Douwe Maan's avatar
Douwe Maan committed
2
  .table-holder
3
    %table.table#tree-slider{ class: "table_#{@hex_path} tree-table" }
4 5 6
      %thead
        %tr
          %th Name
7
          %th.hidden-xs
8
            .pull-left Last commit
9
            .last-commit.hidden-sm.pull-left
10
              %small.light
11
                = clipboard_button(clipboard_text: @commit.id, title: "Copy commit SHA to clipboard")
12
                = link_to @commit.short_id, namespace_project_commit_path(@project.namespace, @project, @commit), class: "monospace"
13 14 15 16 17
                = time_ago_with_tooltip(@commit.committed_date)
                = @commit.full_title
            %small.commit-history-link-spacer |
            = link_to 'History', namespace_project_commits_path(@project.namespace, @project, @id), class: 'commit-history-link'
          %th.text-right Last Update
18 19 20 21 22 23
      - if @path.present?
        %tr.tree-item
          %td.tree-item-file-name
            = link_to "..", namespace_project_tree_path(@project.namespace, @project, up_dir_path), class: 'prepend-left-10'
          %td
          %td.hidden-xs
gitlabhq's avatar
gitlabhq committed
24

25
      = render_tree(tree)
gitlabhq's avatar
gitlabhq committed
26

27
  - if tree.readme
28
    = render "projects/tree/readme", readme: tree.readme
Saito's avatar
Saito committed
29

30
- if can_edit_tree?
31
  = render 'projects/blob/upload', title: 'Upload New File', placeholder: 'Upload new file', button_title: 'Upload file', form_path: namespace_project_create_blob_path(@project.namespace, @project, @id), method: :post
Stan Hu's avatar
Stan Hu committed
32 33
  = render 'projects/blob/new_dir'

34 35
:javascript
  // Load last commit log for each file in tree
36
  $('#tree-slider').waitForImages(function() {
37
    gl.utils.ajaxGet("#{escape_javascript(@logs_path)}");
38
  });