Commit 4fd73683d904ecc71af3ebce128630f0f90997ae

Authored by Riyad Preukschas
1 parent aef2031a

Update author info in tree view

app/assets/stylesheets/sections/tree.scss
@@ -52,14 +52,26 @@ @@ -52,14 +52,26 @@
52 } 52 }
53 } 53 }
54 54
55 - .tree-commit-link {  
56 - color:#333; 55 + .tree_author {
  56 + padding-right: 8px;
  57 +
  58 + img.avatar {
  59 + border: 0 none;
  60 + float: none;
  61 + margin-right: 0;
  62 + padding: 0;
  63 + width: 16px;
  64 + }
57 } 65 }
58 66
59 - a.tree-commit-link {  
60 - color: #666;  
61 - &:hover {  
62 - text-decoration: underline; 67 + .tree_commit {
  68 + color: gray;
  69 +
  70 + .tree-commit-link {
  71 + color: #444;
  72 + &:hover {
  73 + text-decoration: underline;
  74 + }
63 } 75 }
64 } 76 }
65 } 77 }
app/views/refs/logs_tree.js.haml
1 - @logs.each do |content_data| 1 - @logs.each do |content_data|
2 - file_name = content_data[:file_name] 2 - file_name = content_data[:file_name]
3 - - content_commit = content_data[:commit]  
4 - - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) 3 + - commit = content_data[:commit]
5 4
6 :plain 5 :plain
7 var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); 6 var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}");
8 - row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago');  
9 - row.find("td.tree_commit").html('#{escape_javascript(render("tree/tree_commit", tm: tm, content_commit: content_commit))}'); 7 + row.find("td.tree_time_ago").html('#{escape_javascript time_ago_in_words(commit.committed_date)} ago');
  8 + row.find("td.tree_commit").html('#{escape_javascript render("tree/tree_commit_column", commit: commit)}');
app/views/tree/_tree_commit.html.haml
@@ -1,3 +0,0 @@ @@ -1,3 +0,0 @@
1 -- if tm  
2 - = link_to "[#{tm.user_name}]", project_team_member_path(@project, tm)  
3 -= link_to_gfm truncate(content_commit.title, length: tm ? 30 : 50), project_commit_path(@project, content_commit.id), class: "tree-commit-link"  
app/views/tree/_tree_commit_column.html.haml 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +%span.tree_author= commit.author_link avatar: true
  2 += link_to_gfm truncate(commit.title, length: 80), project_commit_path(@project, commit.id), class: "tree-commit-link"