Commit b53557aca64fbf55f9bbd59849d83daa10b7361f

Authored by Dmitriy Zaporozhets
1 parent da5b0c91

Remove decorator calls and methods from views. Repalace with helper calls when needed

app/views/blame/show.html.haml
... ... @@ -22,13 +22,13 @@
22 22 %table
23 23 - current_line = 1
24 24 - @blame.each do |commit, lines|
25   - - commit = CommitDecorator.decorate(Commit.new(commit))
  25 + - commit = Commit.new(commit)
26 26 %tr
27 27 %td.blame-commit
28 28 %span.commit
29 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 33 = link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
34 34 %td.lines.blame-numbers
... ...
app/views/commit/_commit_box.html.haml
... ... @@ -24,14 +24,14 @@
24 24 .row
25 25 .span5
26 26 .author
27   - = @commit.author_link avatar: true, size: 32
  27 + = commit_author_link(@commit, avatar: true, size: 32)
28 28 authored
29 29 %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
30 30 #{time_ago_in_words(@commit.authored_date)} ago
31 31 - if @commit.different_committer?
32 32 .committer
33 33 →
34   - = @commit.committer_link
  34 + = commit_committer_link(@commit)
35 35 committed
36 36 %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
37 37 #{time_ago_in_words(@commit.committed_date)} ago
... ...
app/views/commits/_commit.html.haml
... ... @@ -4,7 +4,7 @@
4 4 %strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right"
5 5 %p
6 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 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
... ... @@ -2,7 +2,7 @@
2 2  
3 3 - if @path.present?
4 4 %ul.breadcrumb
5   - = breadcrumbs
  5 + = commits_breadcrumbs
6 6  
7 7 %div{id: dom_id(@project)}
8 8 #commits-list= render "commits"
... ...
app/views/events/_commit.html.haml
1   -- commit = CommitDecorator.decorate(commit)
2 1 %li.commit
3 2 %p
4 3 = link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"
... ...
app/views/repositories/_branch.html.haml
1   -- commit = Commit.new(branch.commit)
2   -- commit = CommitDecorator.decorate(commit)
  1 +- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit))
3 2 %tr
4 3 %td
5 4 = link_to project_commits_path(@project, branch.name) do
... ...
app/views/repositories/_feed.html.haml
1 1 - commit = update
2   -- commit = CommitDecorator.new(commit)
3 2 %tr
4 3 %td
5 4 = link_to project_commits_path(@project, commit.head.name) do
... ...
app/views/repositories/tags.html.haml
... ... @@ -7,8 +7,7 @@
7 7 %th Last commit
8 8 %th
9 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 11 %tr
13 12 %td
14 13 %strong
... ...
app/views/tree/_tree.html.haml
... ... @@ -3,7 +3,7 @@
3 3 %i.icon-angle-right
4 4 = link_to project_tree_path(@project, @ref) do
5 5 = @project.path
6   - - tree.breadcrumbs(6) do |title, path|
  6 + - tree_breadcrumbs(tree, 6) do |title, path|
7 7 \/
8 8 %li
9 9 - if path
... ... @@ -27,7 +27,7 @@
27 27 %tr.tree-item
28 28 %td.tree-item-file-name
29 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 31 %td
32 32 %td
33 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 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 14 %th Format
15 15 %tbody
16 16 - @wiki.versions.each do |version|
17   - - commit = CommitDecorator.new(version)
  17 + - commit = version
18 18 %tr
19 19 %td
20 20 = link_to project_wiki_path(@project, @wiki, version_id: commit.id) do
21 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 24 %td
24 25 = commit.title
25 26 %td
... ...
app/views/wikis/pages.html.haml
... ... @@ -21,5 +21,5 @@
21 21 = wiki_page.created_at.to_s(:short) do
22 22 (#{time_ago_in_words(wiki_page.created_at)}
23 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 13 = preserve do
14 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
... ...