Merge pull request #451 from abf/rosa-build:369-commits

#369: UI of commits
This commit is contained in:
avm 2015-02-05 12:49:47 +04:00
commit 77de41393f
7 changed files with 38 additions and 38 deletions

View File

@ -108,7 +108,5 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter
@content = (@content.present?) ? tmp + @content : tmp
@caption = @caption[0..68] + '...'
end
# @content = @content.gsub("\n", "<br />").html_safe if @content
@content = simple_format(@content, {}, sanitize: true).html_safe if @content
end
end

View File

@ -1,13 +0,0 @@
= render 'submenu'
.col-xs-12.col-md-10.col-md-offset-1
.row
= render 'repo_block', project: @project
= render 'about_block', project: @project
- if @commit.present?
%h3= t 'layout.projects.last_commit'
- GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter|
.panel.panel-default
.panel-body= render 'shared/feed_commit', presenter: presenter, item_no: 1
.clearfix
= yield

View File

@ -0,0 +1,14 @@
== render 'submenu'
.col-xs-12.col-md-10.col-md-offset-1
.row
== render 'repo_block', project: @project
== render 'about_block', project: @project
- if @commit.present?
h3= t('layout.projects.last_commit')
- GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter|
.panel.panel-default
.panel-body
== render 'shared/feed_commit', presenter: presenter, item_no: 1
.clearfix
== yield

View File

@ -1,13 +0,0 @@
- stats = @commit.stats
-begin
= render_commit_stats(stats)
.pull-right
= link_to "raw diff", commit_path(@project, @commit.id, :diff)
\|
= link_to "patch", commit_path(@project, @commit.id, :patch)
.clearfix
= render partial: 'commit_diff', collection: @commit.diffs
- rescue Grit::Git::GitTimeout
%p= t 'layout.git.repositories.commit_diff_too_big'

View File

@ -0,0 +1,13 @@
- stats = @commit.stats
- begin
= render_commit_stats(stats)
.pull-right
=> link_to 'raw diff', commit_path(@project, @commit.id, :diff)
| |
=< link_to 'patch', commit_path(@project, @commit.id, :patch)
.clearfix
== render partial: 'commit_diff', collection: @commit.diffs
- rescue Grit::Git::GitTimeout
p= t('layout.git.repositories.commit_diff_too_big')

View File

@ -1,11 +1,11 @@
-set_meta_tags title: [title_object(@project), shortest_hash_id(@commit.id), @commit.message]
== render 'submenu'
== render 'about_block', project: @project
.col-xs-12.col-md-10.col-md-offset-1
h3= t("layout.projects.last_commit")
- GitPresenters::CommitAsMessagePresenter.present(@commit, project: @project) do |presenter|
== render partial: 'shared/feed_message', locals: {presenter: presenter, item_no: 1}
.panel.panel-default
.panel-body
== render 'shared/feed_commit', presenter: presenter, item_no: 1
.both
#repo-wrapper
@ -14,4 +14,4 @@
== render "projects/comments/list", list: comments, project: @project, commentable: @commit
== render "projects/comments/add", project: @project, commentable: @commit if current_user
=hidden_field_tag :preview_url, project_md_preview_path(@project)
= hidden_field_tag :preview_url, project_md_preview_path(@project)

View File

@ -1,14 +1,15 @@
.pull-left.roffset5
img alt = 'avatar' src = presenter.image
img alt='avatar' src=presenter.image
.pull-left
strong= presenter.header
=< datetime_moment(presenter.date, tag: :strong)
.clearfix
span= presenter.caption
span=> presenter.caption
- if presenter.expandable? && presenter.content?
span.glyphicon.glyphicon-chevron-down.pointer[ data-toggle = 'collapse'
span.glyphicon.glyphicon-chevron-down.pointer[
data-toggle = 'collapse'
data-target = "#commit_message_#{item_no}" ]
.clearfix
- if presenter.content?
.collapse id = "commit_message_#{item_no}"
pre== markdown(presenter.content)
.collapse id="commit_message_#{item_no}"
.well.well-sm== markdown(presenter.content)