From d062e9a330d2dcebd3dd722d4d556206de4f2a92 Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Tue, 7 Apr 2015 19:16:04 +0500 Subject: [PATCH] new commit diff --- app/assets/javascripts/extra/diff.js.coffee | 2 +- app/assets/stylesheets/views/diff.sass | 13 +- app/helpers/commit_helper.rb | 118 ++++++++++++++---- .../projects/git/commits/_diff.html.slim | 34 ++--- .../git/commits/_file_change_mode.html.slim | 10 ++ .../projects/git/commits/_show.html.slim | 4 +- .../git/commits/_show_image.html.slim | 19 +++ config/locales/models/project.en.yml | 8 ++ config/locales/models/project.ru.yml | 8 ++ config/locales/pluralization.en.yml | 6 - config/locales/pluralization.ru.yml | 8 -- 11 files changed, 152 insertions(+), 78 deletions(-) create mode 100644 app/views/projects/git/commits/_file_change_mode.html.slim create mode 100644 app/views/projects/git/commits/_show_image.html.slim diff --git a/app/assets/javascripts/extra/diff.js.coffee b/app/assets/javascripts/extra/diff.js.coffee index 77b3e59cd..dc811ae69 100644 --- a/app/assets/javascripts/extra/diff.js.coffee +++ b/app/assets/javascripts/extra/diff.js.coffee @@ -1,5 +1,5 @@ $(document).ready -> - $(document).on 'click', '#diff_header .panel-body table a', -> + $(document).on 'click', '#diff_header .panel-body li.list-group-item a', -> href = $(this).attr('href') $(".diff_data.collapse#"+href.slice(1)+"_content").collapse('show') diff --git a/app/assets/stylesheets/views/diff.sass b/app/assets/stylesheets/views/diff.sass index 9d32cfe4a..5e6448143 100644 --- a/app/assets/stylesheets/views/diff.sass +++ b/app/assets/stylesheets/views/diff.sass @@ -3,7 +3,7 @@ overflow-x: auto table.table.diff.inline - //border: 1px solid #DDD + margin-bottom: 0 tr.changes pre @@ -66,17 +66,6 @@ table.table.diff.inline .line-comment, #new_inline_comment max-width: 700px - td.diff-image - text-align: center - - span.diff-image - text-align: center - margin: 0 - padding: 0 - - img - margin-top: 5px - div.file div.top min-height: 28px background: #ededed diff --git a/app/helpers/commit_helper.rb b/app/helpers/commit_helper.rb index 2935e2f0d..838d1a77c 100644 --- a/app/helpers/commit_helper.rb +++ b/app/helpers/commit_helper.rb @@ -1,30 +1,21 @@ module CommitHelper MAX_FILES_WITHOUT_COLLAPSE = 25 - def render_commit_stats(stats, diff) + def render_commit_stats(options = {}) + stats = options[:stats] + diff = options[:diff] + repo = options[:repo] + commit = options[:commit] + res = ["