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

master
Dmitriy Zaporozhets 2013-03-31 23:47:26 +03:00
parent da5b0c91dc
commit b53557aca6
13 changed files with 18 additions and 21 deletions

View File

@ -22,13 +22,13 @@
%table
- current_line = 1
- @blame.each do |commit, lines|
- commit = CommitDecorator.decorate(Commit.new(commit))
- commit = Commit.new(commit)
%tr
%td.blame-commit
%span.commit
= link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
 
= commit.author_link avatar: true, size: 16
= commit_author_link(commit, avatar: true, size: 16)
 
= link_to_gfm truncate(commit.title, length: 20), project_commit_path(@project, commit.id), class: "row_title"
%td.lines.blame-numbers

View File

@ -24,14 +24,14 @@
.row
.span5
.author
= @commit.author_link avatar: true, size: 32
= commit_author_link(@commit, avatar: true, size: 32)
authored
%time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.authored_date)} ago
- if @commit.different_committer?
.committer
→
= @commit.committer_link
= commit_committer_link(@commit)
committed
%time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
#{time_ago_in_words(@commit.committed_date)} ago

View File

@ -4,7 +4,7 @@
%strong= link_to "Browse Code »", project_tree_path(@project, commit), class: "right"
%p
= link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
= commit.author_link avatar: true, size: 24
= commit_author_link(commit, avatar: true, size: 24)
 
= link_to_gfm truncate(commit.title, length: 70), project_commit_path(@project, commit.id), class: "row_title"

View File

@ -2,7 +2,7 @@
- if @path.present?
%ul.breadcrumb
= breadcrumbs
= commits_breadcrumbs
%div{id: dom_id(@project)}
#commits-list= render "commits"

View File

@ -1,4 +1,3 @@
- commit = CommitDecorator.decorate(commit)
%li.commit
%p
= link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"

View File

@ -1,5 +1,4 @@
- commit = Commit.new(branch.commit)
- commit = CommitDecorator.decorate(commit)
- commit = Commit.new(Gitlab::Git::Commit.new(branch.commit))
%tr
%td
= link_to project_commits_path(@project, branch.name) do

View File

@ -1,5 +1,4 @@
- commit = update
- commit = CommitDecorator.new(commit)
%tr
%td
= link_to project_commits_path(@project, commit.head.name) do

View File

@ -7,8 +7,7 @@
%th Last commit
%th
- @tags.each do |tag|
- commit = Commit.new(tag.commit)
- commit = CommitDecorator.decorate(commit)
- commit = Commit.new(Gitlab::Git::Commit.new(tag.commit))
%tr
%td
%strong

View File

@ -3,7 +3,7 @@
%i.icon-angle-right
= link_to project_tree_path(@project, @ref) do
= @project.path
- tree.breadcrumbs(6) do |title, path|
- tree_breadcrumbs(tree, 6) do |title, path|
\/
%li
- if path
@ -27,7 +27,7 @@
%tr.tree-item
%td.tree-item-file-name
= image_tag "file_empty.png", size: '16x16'
= link_to "..", project_tree_path(@project, tree.up_dir_path)
= link_to "..", project_tree_path(@project, up_dir_path(tree))
%td
%td
%td

View File

@ -1,2 +1,2 @@
%span.tree_author= commit.author_link avatar: true
%span.tree_author= commit_author_link(commit, avatar: true)
= link_to_gfm truncate(commit.title, length: 80), project_commit_path(@project, commit.id), class: "tree-commit-link"

View File

@ -14,12 +14,13 @@
%th Format
%tbody
- @wiki.versions.each do |version|
- commit = CommitDecorator.new(version)
- commit = version
%tr
%td
= link_to project_wiki_path(@project, @wiki, version_id: commit.id) do
= commit.short_id
%td= commit.author_link avatar: true, size: 24
%td
= commit_author_link(commit, avatar: true, size: 24)
%td
= commit.title
%td

View File

@ -21,5 +21,5 @@
= wiki_page.created_at.to_s(:short) do
(#{time_ago_in_words(wiki_page.created_at)}
ago)
- commit = CommitDecorator.decorate(wiki_page.version)
%td= commit.author_link avatar: true, size: 24
%td
= commit_author_link(wiki_page.version, avatar: true, size: 24)

View File

@ -13,5 +13,5 @@
= preserve do
= render_wiki_content(@wiki)
- commit = CommitDecorator.new(@wiki.version)
%p.time Last edited by #{commit.author_link(avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago
- commit = Commit.new(@wiki.version)
%p.time Last edited by #{commit_author_link(commit, avatar: true, size: 16)} #{time_ago_in_words @wiki.created_at} ago