From 4fd73683d904ecc71af3ebce128630f0f90997ae Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Thu, 18 Oct 2012 20:53:35 +0200 Subject: [PATCH] Update author info in tree view --- app/assets/stylesheets/sections/tree.scss | 24 +++++++++++++++----- app/views/refs/logs_tree.js.haml | 7 +++--- app/views/tree/_tree_commit.html.haml | 3 --- app/views/tree/_tree_commit_column.html.haml | 2 ++ 4 files changed, 23 insertions(+), 13 deletions(-) delete mode 100644 app/views/tree/_tree_commit.html.haml create mode 100644 app/views/tree/_tree_commit_column.html.haml diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index fd12ed00..9f78a6b6 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -52,14 +52,26 @@ } } - .tree-commit-link { - color:#333; + .tree_author { + padding-right: 8px; + + img.avatar { + border: 0 none; + float: none; + margin-right: 0; + padding: 0; + width: 16px; + } } - a.tree-commit-link { - color: #666; - &:hover { - text-decoration: underline; + .tree_commit { + color: gray; + + .tree-commit-link { + color: #444; + &:hover { + text-decoration: underline; + } } } } diff --git a/app/views/refs/logs_tree.js.haml b/app/views/refs/logs_tree.js.haml index b0ac0c4b..23a6dae7 100644 --- a/app/views/refs/logs_tree.js.haml +++ b/app/views/refs/logs_tree.js.haml @@ -1,9 +1,8 @@ - @logs.each do |content_data| - file_name = content_data[:file_name] - - content_commit = content_data[:commit] - - tm = @project.team_member_by_name_or_email(content_commit.author_email, content_commit.author_name) + - commit = content_data[:commit] :plain var row = $("table.table_#{@hex_path} tr.file_#{hexdigest(file_name)}"); - row.find("td.tree_time_ago").html('#{escape_javascript(time_ago_in_words(content_commit.committed_date))} ago'); - row.find("td.tree_commit").html('#{escape_javascript(render("tree/tree_commit", tm: tm, content_commit: content_commit))}'); + row.find("td.tree_time_ago").html('#{escape_javascript time_ago_in_words(commit.committed_date)} ago'); + row.find("td.tree_commit").html('#{escape_javascript render("tree/tree_commit_column", commit: commit)}'); diff --git a/app/views/tree/_tree_commit.html.haml b/app/views/tree/_tree_commit.html.haml deleted file mode 100644 index 1bcf1a7e..00000000 --- a/app/views/tree/_tree_commit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- if tm - = link_to "[#{tm.user_name}]", project_team_member_path(@project, tm) -= link_to_gfm truncate(content_commit.title, length: tm ? 30 : 50), project_commit_path(@project, content_commit.id), class: "tree-commit-link" diff --git a/app/views/tree/_tree_commit_column.html.haml b/app/views/tree/_tree_commit_column.html.haml new file mode 100644 index 00000000..9d02132b --- /dev/null +++ b/app/views/tree/_tree_commit_column.html.haml @@ -0,0 +1,2 @@ +%span.tree_author= commit.author_link avatar: true += link_to_gfm truncate(commit.title, length: 80), project_commit_path(@project, commit.id), class: "tree-commit-link"