Commit b53557aca64fbf55f9bbd59849d83daa10b7361f
1 parent
da5b0c91
Exists in
master
and in
4 other branches
Remove decorator calls and methods from views. Repalace with helper calls when needed
Showing
13 changed files
with
18 additions
and
21 deletions
Show diff stats
app/views/blame/show.html.haml
@@ -22,13 +22,13 @@ | @@ -22,13 +22,13 @@ | ||
22 | %table | 22 | %table |
23 | - current_line = 1 | 23 | - current_line = 1 |
24 | - @blame.each do |commit, lines| | 24 | - @blame.each do |commit, lines| |
25 | - - commit = CommitDecorator.decorate(Commit.new(commit)) | 25 | + - commit = Commit.new(commit) |
26 | %tr | 26 | %tr |
27 | %td.blame-commit | 27 | %td.blame-commit |
28 | %span.commit | 28 | %span.commit |
29 | = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | 29 | = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" |
30 | | 30 | |
31 | - = commit.author_link avatar: true, size: 16 | 31 | + = commit_author_link(commit, avatar: true, size: 16) |
32 | | 32 | |
33 | = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title" | 33 | = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title" |
34 | %td.lines.blame-numbers | 34 | %td.lines.blame-numbers |
app/views/commit/_commit_box.html.haml
@@ -24,14 +24,14 @@ | @@ -24,14 +24,14 @@ | ||
24 | .row | 24 | .row |
25 | .span5 | 25 | .span5 |
26 | .author | 26 | .author |
27 | - = @commit.author_link avatar: true, size: 32 | 27 | + = commit_author_link(@commit, avatar: true, size: 32) |
28 | authored | 28 | authored |
29 | %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")} | 29 | %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")} |
30 | #{time_ago_in_words(@commit.authored_date)} ago | 30 | #{time_ago_in_words(@commit.authored_date)} ago |
31 | - if @commit.different_committer? | 31 | - if @commit.different_committer? |
32 | .committer | 32 | .committer |
33 | → | 33 | → |
34 | - = @commit.committer_link | 34 | + = commit_committer_link(@commit) |
35 | committed | 35 | committed |
36 | %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")} | 36 | %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")} |
37 | #{time_ago_in_words(@commit.committed_date)} ago | 37 | #{time_ago_in_words(@commit.committed_date)} ago |
app/views/commits/_commit.html.haml
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right" | 4 | %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right" |
5 | %p | 5 | %p |
6 | = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" | 6 | = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id" |
7 | - = commit.author_link avatar: true, size: 24 | 7 | + = commit_author_link(commit, avatar: true, size: 24) |
8 | | 8 | |
9 | = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title" | 9 | = link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title" |
10 | 10 |
app/views/commits/show.html.haml
app/views/events/_commit.html.haml
app/views/repositories/_branch.html.haml
app/views/repositories/_feed.html.haml
app/views/repositories/tags.html.haml
@@ -7,8 +7,7 @@ | @@ -7,8 +7,7 @@ | ||
7 | %th Last commit | 7 | %th Last commit |
8 | %th | 8 | %th |
9 | - @tags.each do |tag| | 9 | - @tags.each do |tag| |
10 | - - commit = Commit.new(tag.commit) | ||
11 | - - commit = CommitDecorator.decorate(commit) | 10 | + - commit = Commit.new(Gitlab::Git::Commit.new(tag.commit)) |
12 | %tr | 11 | %tr |
13 | %td | 12 | %td |
14 | %strong | 13 | %strong |
app/views/tree/_tree.html.haml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | %i.icon-angle-right | 3 | %i.icon-angle-right |
4 | = link_to project_tree_path(@project, @ref) do | 4 | = link_to project_tree_path(@project, @ref) do |
5 | = @project.path | 5 | = @project.path |
6 | - - tree.breadcrumbs(6) do |title, path| | 6 | + - tree_breadcrumbs(tree, 6) do |title, path| |
7 | \/ | 7 | \/ |
8 | %li | 8 | %li |
9 | - if path | 9 | - if path |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | %tr.tree-item | 27 | %tr.tree-item |
28 | %td.tree-item-file-name | 28 | %td.tree-item-file-name |
29 | = image_tag "file_empty.png", size: '16x16' | 29 | = image_tag "file_empty.png", size: '16x16' |
30 | - = link_to "..", project_tree_path(@project, tree.up_dir_path) | 30 | + = link_to "..", project_tree_path(@project, up_dir_path(tree)) |
31 | %td | 31 | %td |
32 | %td | 32 | %td |
33 | %td | 33 | %td |
app/views/tree/_tree_commit_column.html.haml
1 | -%span.tree_author= commit.author_link avatar: true | 1 | +%span.tree_author= commit_author_link(commit, avatar: true) |
2 | = link_to_gfm truncate(commit.title, length: 80), project_commit_path(@project, commit.id), class: "tree-commit-link" | 2 | = link_to_gfm truncate(commit.title, length: 80), project_commit_path(@project, commit.id), class: "tree-commit-link" |
app/views/wikis/history.html.haml
@@ -14,12 +14,13 @@ | @@ -14,12 +14,13 @@ | ||
14 | %th Format | 14 | %th Format |
15 | %tbody | 15 | %tbody |
16 | - @wiki.versions.each do |version| | 16 | - @wiki.versions.each do |version| |
17 | - - commit = CommitDecorator.new(version) | 17 | + - commit = version |
18 | %tr | 18 | %tr |
19 | %td | 19 | %td |
20 | = link_to project_wiki_path(@project, @wiki, version_id: commit.id) do | 20 | = link_to project_wiki_path(@project, @wiki, version_id: commit.id) do |
21 | = commit.short_id | 21 | = commit.short_id |
22 | - %td= commit.author_link avatar: true, size: 24 | 22 | + %td |
23 | + = commit_author_link(commit, avatar: true, size: 24) | ||
23 | %td | 24 | %td |
24 | = commit.title | 25 | = commit.title |
25 | %td | 26 | %td |
app/views/wikis/pages.html.haml
@@ -21,5 +21,5 @@ | @@ -21,5 +21,5 @@ | ||
21 | = wiki_page.created_at.to_s(:short) do | 21 | = wiki_page.created_at.to_s(:short) do |
22 | (#{time_ago_in_words(wiki_page.created_at)} | 22 | (#{time_ago_in_words(wiki_page.created_at)} |
23 | ago) | 23 | ago) |
24 | - - commit = CommitDecorator.decorate(wiki_page.version) | ||
25 | - %td= commit.author_link avatar: true, size: 24 | 24 | + %td |
25 | + = commit_author_link(wiki_page.version, avatar: true, size: 24) |
app/views/wikis/show.html.haml
@@ -13,5 +13,5 @@ | @@ -13,5 +13,5 @@ | ||
13 | = preserve do | 13 | = preserve do |
14 | = render_wiki_content(@wiki) | 14 | = render_wiki_content(@wiki) |
15 | 15 | ||
16 | -- commit = CommitDecorator.new(@wiki.version) | ||
17 | -%p.time Last edited by #{commit.author_link(avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago | 16 | +- commit = Commit.new(@wiki.version) |
17 | +%p.time Last edited by #{commit_author_link(commit, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago |