diff options
author | Mark Chao <mchao@gitlab.com> | 2019-01-23 16:50:19 +0800 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-18 10:13:35 +0000 |
commit | c1fd719e18e2ab7f0412cf95b5e336a3aeea8006 (patch) | |
tree | 0e06b898a154d8bac4b504a9944efc79da2a4005 | |
parent | ff81747fbbd339da495b7b4c42df40df443961b0 (diff) | |
download | gitlab-ce-19054-expand-diff.tar.gz |
Add full option for blob diff action19054-expand-diff
-rw-r--r-- | app/controllers/projects/blob_controller.rb | 3 | ||||
-rw-r--r-- | lib/unfold_form.rb | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb index 77672e7d9fc..8146120f489 100644 --- a/app/controllers/projects/blob_controller.rb +++ b/app/controllers/projects/blob_controller.rb @@ -95,7 +95,8 @@ class Projects::BlobController < Projects::ApplicationController @form = UnfoldForm.new(params.to_unsafe_h) - @lines = @lines[@form.since - 1..@form.to - 1].map(&:html_safe) + @lines = @lines[@form.since - 1..@form.to - 1] unless @form.full? + @lines = @lines.map(&:html_safe) if @form.bottom? @match_line = '' diff --git a/lib/unfold_form.rb b/lib/unfold_form.rb index 05bb3ed7f1c..53adc3af0cd 100644 --- a/lib/unfold_form.rb +++ b/lib/unfold_form.rb @@ -9,6 +9,7 @@ class UnfoldForm attribute :to, GtOneCoercion attribute :bottom, Boolean attribute :unfold, Boolean, default: true + attribute :full, Boolean, default: false attribute :offset, Integer attribute :indent, Integer, default: 0 end |