[refs #737] remove branch from commit message

This commit is contained in:
Alexander Machehin 2012-11-28 19:15:15 +06:00
parent c969d82c94
commit 76606036cb
8 changed files with 7 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -2,5 +2,4 @@ en:
layout:
messages:
commits:
header_with_branch: "%{committer} has added %{commit} into %{branch} branch"
header: "%{committer} has added %{commit}"

View File

@ -2,5 +2,4 @@ ru:
layout:
messages:
commits:
header_with_branch: "%{committer} добавил коммит %{commit} в ветку %{branch}"
header: "%{committer} добавил коммит %{commit}"