diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index 54933746c..1d2604f55 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -7,15 +7,12 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter def initialize(commit, opts = {}) @commit = commit - @options = opts#[:branch] if opts[:branch] + @options = opts prepare_message end def header - @header ||= if options[:branch].present? - I18n.t("layout.messages.commits.header_with_branch", - :committer => committer_link, :commit => commit_link, :branch => options[:branch].name) - elsif options[:project].present? + @header ||= if options[:project].present? I18n.t("layout.messages.commits.header", :committer => committer_link, :commit => commit_link, :project => options[:project].name) end.html_safe diff --git a/app/views/projects/base/_layout.html.haml b/app/views/projects/base/_layout.html.haml index bfcce95bb..601a41b28 100644 --- a/app/views/projects/base/_layout.html.haml +++ b/app/views/projects/base/_layout.html.haml @@ -3,7 +3,7 @@ = render 'about_block', :project => @project %h3= t("layout.projects.last_commit") -- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| +- GitPresenters::CommitAsMessagePresenter.present(@commit, :project => @project) do |presenter| = render 'shared/feed_message', :presenter => presenter, :item_no => 1 .both diff --git a/app/views/projects/git/blobs/blame.html.haml b/app/views/projects/git/blobs/blame.html.haml index 75d54a250..eadbf22c8 100644 --- a/app/views/projects/git/blobs/blame.html.haml +++ b/app/views/projects/git/blobs/blame.html.haml @@ -5,7 +5,7 @@ %h3= t("layout.projects.last_commit") -- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| +- GitPresenters::CommitAsMessagePresenter.present(@commit, :project => @project) do |presenter| = render 'shared/feed_message', :presenter => presenter, :item_no => 1 .both diff --git a/app/views/projects/git/commits/_commits.html.haml b/app/views/projects/git/commits/_commits.html.haml index cb79b9ffa..e815935a7 100644 --- a/app/views/projects/git/commits/_commits.html.haml +++ b/app/views/projects/git/commits/_commits.html.haml @@ -12,7 +12,7 @@ .date= raw l(commits.first.authored_date, :format => :date_block_format) .messages - commits.each_with_index do |commit| - - GitPresenters::CommitAsMessagePresenter.present(commit, :branch => @branch, :project => @project) do |presenter| + - GitPresenters::CommitAsMessagePresenter.present(commit, :project => @project) do |presenter| = render 'shared/feed_message', :presenter => presenter, :item_no => counter - counter += 1 .both diff --git a/app/views/projects/git/commits/_commits_small.html.haml b/app/views/projects/git/commits/_commits_small.html.haml index 528f9b3ff..3302753fb 100644 --- a/app/views/projects/git/commits/_commits_small.html.haml +++ b/app/views/projects/git/commits/_commits_small.html.haml @@ -3,7 +3,7 @@ %tbody - commits.each do |commit| - item_no = commit.id - - GitPresenters::CommitAsMessagePresenter.present(commit, :branch => @branch, :project => @project) do |presenter| + - GitPresenters::CommitAsMessagePresenter.present(commit, :project => @project) do |presenter| %tr %td %img{:height => 16, :alt => "avatar", :src => presenter.image} diff --git a/app/views/projects/git/commits/show.html.haml b/app/views/projects/git/commits/show.html.haml index 7da6e3afb..70a7e3efe 100644 --- a/app/views/projects/git/commits/show.html.haml +++ b/app/views/projects/git/commits/show.html.haml @@ -3,7 +3,7 @@ = render 'about_block', :project => @project %h3= t("layout.projects.last_commit") -- GitPresenters::CommitAsMessagePresenter.present(@commit, :branch => @branch, :project => @project) do |presenter| +- GitPresenters::CommitAsMessagePresenter.present(@commit, :project => @project) do |presenter| = render :partial => 'shared/feed_message', :locals => {:presenter => presenter, :item_no => 1} .both diff --git a/config/locales/layout/messages.en.yml b/config/locales/layout/messages.en.yml index e0a3b3b3a..d17e6bac3 100644 --- a/config/locales/layout/messages.en.yml +++ b/config/locales/layout/messages.en.yml @@ -2,5 +2,4 @@ en: layout: messages: commits: - header_with_branch: "%{committer} has added %{commit} into %{branch} branch" header: "%{committer} has added %{commit}" diff --git a/config/locales/layout/messages.ru.yml b/config/locales/layout/messages.ru.yml index 8e02db73b..77f43d4f5 100644 --- a/config/locales/layout/messages.ru.yml +++ b/config/locales/layout/messages.ru.yml @@ -2,5 +2,4 @@ ru: layout: messages: commits: - header_with_branch: "%{committer} добавил коммит %{commit} в ветку %{branch}" header: "%{committer} добавил коммит %{commit}"