summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2017-03-28 19:29:02 +0000
committerJacob Schatz <jschatz@gitlab.com>2017-03-28 19:29:02 +0000
commit47aeacd7f5b214d24dcb02bf0a42774415f5083d (patch)
tree130f356d8177ab6688a5e9236f77cc92887e2867 /app/models
parent5f6c32e1452cc25d47db9d5e66d3a5b1b453ceb3 (diff)
parent0f790dbccc506d59feeae2799163e3f00198dee2 (diff)
downloadgitlab-ce-47aeacd7f5b214d24dcb02bf0a42774415f5083d.tar.gz
Merge branch 'ipython-notebook-viewer' into 'master'
iPython notebook viewer See merge request !10017
Diffstat (limited to 'app/models')
-rw-r--r--app/models/blob.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb
index 1376b86fdad..5b71ac21cc0 100644
--- a/app/models/blob.rb
+++ b/app/models/blob.rb
@@ -46,6 +46,10 @@ class Blob < SimpleDelegator
text? && language && language.name == 'SVG'
end
+ def ipython_notebook?
+ text? && language && language.name == 'Jupyter Notebook'
+ end
+
def size_within_svg_limits?
size <= MAXIMUM_SVG_SIZE
end
@@ -63,6 +67,8 @@ class Blob < SimpleDelegator
end
elsif image? || svg?
'image'
+ elsif ipython_notebook?
+ 'notebook'
elsif text?
'text'
else