From 898321d18bc53f0b18a8526fd3d71ff7b7133e96 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 5 Feb 2015 01:53:08 +0300 Subject: [PATCH] #369: updated UI of commits --- .../git_presenters/commit_as_message_presenter.rb | 2 +- app/views/projects/base/_layout.html.haml | 13 ------------- app/views/projects/base/_layout.html.slim | 14 ++++++++++++++ app/views/projects/git/commits/_show.html.haml | 13 ------------- app/views/projects/git/commits/_show.html.slim | 13 +++++++++++++ app/views/projects/git/commits/show.html.slim | 2 -- app/views/shared/_feed_commit.html.slim | 14 ++++++++------ 7 files changed, 36 insertions(+), 35 deletions(-) delete mode 100644 app/views/projects/base/_layout.html.haml create mode 100644 app/views/projects/base/_layout.html.slim delete mode 100644 app/views/projects/git/commits/_show.html.haml create mode 100644 app/views/projects/git/commits/_show.html.slim diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index 2248fb9ac..82ab5af7d 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -109,6 +109,6 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter @caption = @caption[0..68] + '...' end # @content = @content.gsub("\n", "
").html_safe if @content - @content = simple_format(@content, {}, sanitize: true).html_safe if @content + # @content = simple_format(@content, {}, sanitize: true).html_safe if @content end end diff --git a/app/views/projects/base/_layout.html.haml b/app/views/projects/base/_layout.html.haml deleted file mode 100644 index 776e278f9..000000000 --- a/app/views/projects/base/_layout.html.haml +++ /dev/null @@ -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 diff --git a/app/views/projects/base/_layout.html.slim b/app/views/projects/base/_layout.html.slim new file mode 100644 index 000000000..07494f0e2 --- /dev/null +++ b/app/views/projects/base/_layout.html.slim @@ -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 diff --git a/app/views/projects/git/commits/_show.html.haml b/app/views/projects/git/commits/_show.html.haml deleted file mode 100644 index d2b785ee0..000000000 --- a/app/views/projects/git/commits/_show.html.haml +++ /dev/null @@ -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' diff --git a/app/views/projects/git/commits/_show.html.slim b/app/views/projects/git/commits/_show.html.slim new file mode 100644 index 000000000..3999b70a1 --- /dev/null +++ b/app/views/projects/git/commits/_show.html.slim @@ -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') diff --git a/app/views/projects/git/commits/show.html.slim b/app/views/projects/git/commits/show.html.slim index 31fc8503d..877af3c29 100644 --- a/app/views/projects/git/commits/show.html.slim +++ b/app/views/projects/git/commits/show.html.slim @@ -1,9 +1,7 @@ -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} diff --git a/app/views/shared/_feed_commit.html.slim b/app/views/shared/_feed_commit.html.slim index d4638c987..1881d22cf 100644 --- a/app/views/shared/_feed_commit.html.slim +++ b/app/views/shared/_feed_commit.html.slim @@ -1,14 +1,16 @@ .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' - data-target = "#commit_message_#{item_no}" ] + 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}" + / pre== markdown(presenter.content) + .well.well-sm== markdown(presenter.content)