Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Hayes <eric@erichayes.net>2016-04-03 08:00:06 +0300
committerRémy Coutable <remy@rymai.me>2016-07-19 19:51:09 +0300
commitc266c7fa18848586cd6ee903cc4c4d4f9049100e (patch)
tree8fa8d0b2dca828bec6af0ad49855cbb4e69a9e30 /app/controllers/projects/uploads_controller.rb
parent81e57e783e8882de21d27d9191c09404ed7faca3 (diff)
First support of videos in issues, MRs and notes
* Registered video MIME types * Currently supporting browser-supported formats with extensions that match the mime type
Diffstat (limited to 'app/controllers/projects/uploads_controller.rb')
-rw-r--r--app/controllers/projects/uploads_controller.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/projects/uploads_controller.rb b/app/controllers/projects/uploads_controller.rb
index caed064dfbc..e617be8f9fb 100644
--- a/app/controllers/projects/uploads_controller.rb
+++ b/app/controllers/projects/uploads_controller.rb
@@ -1,6 +1,6 @@
class Projects::UploadsController < Projects::ApplicationController
skip_before_action :reject_blocked!, :project,
- :repository, if: -> { action_name == 'show' && image? }
+ :repository, if: -> { action_name == 'show' && image_or_video? }
before_action :authorize_upload_file!, only: [:create]
@@ -24,7 +24,7 @@ class Projects::UploadsController < Projects::ApplicationController
def show
return render_404 if uploader.nil? || !uploader.file.exists?
- disposition = uploader.image? ? 'inline' : 'attachment'
+ disposition = uploader.image_or_video? ? 'inline' : 'attachment'
send_file uploader.file.path, disposition: disposition
end
@@ -49,7 +49,7 @@ class Projects::UploadsController < Projects::ApplicationController
@uploader
end
- def image?
- uploader && uploader.file.exists? && uploader.image?
+ def image_or_video?
+ uploader && uploader.file.exists? && uploader.image_or_video?
end
end