Merge pull request #740 from warpc/737-dont_show_branch_in_commit
[refs #737] dont show branch in commit
This commit is contained in:
commit
e7e80164cb
|
@ -7,15 +7,12 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
|
||||||
|
|
||||||
def initialize(commit, opts = {})
|
def initialize(commit, opts = {})
|
||||||
@commit = commit
|
@commit = commit
|
||||||
@options = opts#[:branch] if opts[:branch]
|
@options = opts
|
||||||
prepare_message
|
prepare_message
|
||||||
end
|
end
|
||||||
|
|
||||||
def header
|
def header
|
||||||
@header ||= if options[:branch].present?
|
@header ||= if options[:project].present?
|
||||||
I18n.t("layout.messages.commits.header_with_branch",
|
|
||||||
:committer => committer_link, :commit => commit_link, :branch => options[:branch].name)
|
|
||||||
elsif options[:project].present?
|
|
||||||
I18n.t("layout.messages.commits.header",
|
I18n.t("layout.messages.commits.header",
|
||||||
:committer => committer_link, :commit => commit_link, :project => options[:project].name)
|
:committer => committer_link, :commit => commit_link, :project => options[:project].name)
|
||||||
end.html_safe
|
end.html_safe
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
= render 'about_block', :project => @project
|
= render 'about_block', :project => @project
|
||||||
|
|
||||||
%h3= t("layout.projects.last_commit")
|
%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
|
= render 'shared/feed_message', :presenter => presenter, :item_no => 1
|
||||||
|
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
|
|
||||||
%h3= t("layout.projects.last_commit")
|
%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
|
= render 'shared/feed_message', :presenter => presenter, :item_no => 1
|
||||||
|
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
.date= raw l(commits.first.authored_date, :format => :date_block_format)
|
.date= raw l(commits.first.authored_date, :format => :date_block_format)
|
||||||
.messages
|
.messages
|
||||||
- commits.each_with_index do |commit|
|
- 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
|
= render 'shared/feed_message', :presenter => presenter, :item_no => counter
|
||||||
- counter += 1
|
- counter += 1
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
%tbody
|
%tbody
|
||||||
- commits.each do |commit|
|
- commits.each do |commit|
|
||||||
- item_no = commit.id
|
- item_no = commit.id
|
||||||
- GitPresenters::CommitAsMessagePresenter.present(commit, :branch => @branch, :project => @project) do |presenter|
|
- GitPresenters::CommitAsMessagePresenter.present(commit, :project => @project) do |presenter|
|
||||||
%tr
|
%tr
|
||||||
%td
|
%td
|
||||||
%img{:height => 16, :alt => "avatar", :src => presenter.image}
|
%img{:height => 16, :alt => "avatar", :src => presenter.image}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
= render 'about_block', :project => @project
|
= render 'about_block', :project => @project
|
||||||
|
|
||||||
%h3= t("layout.projects.last_commit")
|
%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}
|
= render :partial => 'shared/feed_message', :locals => {:presenter => presenter, :item_no => 1}
|
||||||
|
|
||||||
.both
|
.both
|
||||||
|
|
|
@ -2,5 +2,4 @@ en:
|
||||||
layout:
|
layout:
|
||||||
messages:
|
messages:
|
||||||
commits:
|
commits:
|
||||||
header_with_branch: "%{committer} has added %{commit} into %{branch} branch"
|
|
||||||
header: "%{committer} has added %{commit}"
|
header: "%{committer} has added %{commit}"
|
||||||
|
|
|
@ -2,5 +2,4 @@ ru:
|
||||||
layout:
|
layout:
|
||||||
messages:
|
messages:
|
||||||
commits:
|
commits:
|
||||||
header_with_branch: "%{committer} добавил коммит %{commit} в ветку %{branch}"
|
|
||||||
header: "%{committer} добавил коммит %{commit}"
|
header: "%{committer} добавил коммит %{commit}"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
ru:
|
ru:
|
||||||
title_editing:
|
title_editing:
|
||||||
'Редактирование'
|
'Редактирование'
|
||||||
at: at
|
at: в
|
||||||
users:
|
users:
|
||||||
settings:
|
settings:
|
||||||
profile:
|
profile:
|
||||||
|
|
Loading…
Reference in New Issue