BigW Consortium Gitlab

logs_tree.js.haml 935 Bytes
Newer Older
1
- @logs.each do |content_data|
2
  - file_name = content_data[:file_name]
3
  - commit = content_data[:commit]
4
  - next unless commit
5 6

  :plain
7
    var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
8
    row.find("td.tree_time_ago").html('#{escape_javascript time_ago_with_tooltip(commit.committed_date)}');
9
    row.find("td.tree_commit").html('#{escape_javascript render("projects/tree/tree_commit_column", commit: commit)}');
10 11 12 13

- if @logs.present?
  :plain
    var current_url = location.href.replace(/\/?$/, '/');
Vinnie Okada committed
14
    var log_url = '#{namespace_project_tree_url(@project.namespace, @project, tree_join(@ref, @path || '/'))}'.replace(/\/?$/, '/');
15 16 17
    if(current_url == log_url) {
      // Load 10 more commit log for each file in tree
      // if we still on the same page
Vinnie Okada committed
18
      ajaxGet('#{logs_file_namespace_project_ref_path(@project.namespace, @project, @ref, @path || '/', offset: (@offset +  @limit))}');
19
    }