Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f112a03c
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f112a03c
编写于
4月 13, 2017
作者:
D
Douwe Maan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add simple blob viewers
上级
13891a03
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
66 addition
and
2 deletion
+66
-2
app/models/blob_viewer/client_side.rb
app/models/blob_viewer/client_side.rb
+11
-0
app/models/blob_viewer/download.rb
app/models/blob_viewer/download.rb
+13
-0
app/models/blob_viewer/empty.rb
app/models/blob_viewer/empty.rb
+9
-0
app/models/blob_viewer/simple.rb
app/models/blob_viewer/simple.rb
+11
-0
app/models/blob_viewer/text.rb
app/models/blob_viewer/text.rb
+11
-0
app/views/projects/blob/_text.html.haml
app/views/projects/blob/_text.html.haml
+0
-2
app/views/projects/blob/viewers/_download.html.haml
app/views/projects/blob/viewers/_download.html.haml
+7
-0
app/views/projects/blob/viewers/_empty.html.haml
app/views/projects/blob/viewers/_empty.html.haml
+3
-0
app/views/projects/blob/viewers/_text.html.haml
app/views/projects/blob/viewers/_text.html.haml
+1
-0
未找到文件。
app/models/blob_viewer/client_side.rb
0 → 100644
浏览文件 @
f112a03c
module
BlobViewer
module
ClientSide
extend
ActiveSupport
::
Concern
included
do
self
.
client_side
=
true
self
.
max_size
=
10
.
megabytes
self
.
absolute_max_size
=
50
.
megabytes
end
end
end
app/models/blob_viewer/download.rb
0 → 100644
浏览文件 @
f112a03c
module
BlobViewer
class
Download
<
Base
include
Simple
include
ServerSide
self
.
partial_name
=
'download'
self
.
text_based
=
false
def
render_error
(
*
)
nil
end
end
end
app/models/blob_viewer/empty.rb
0 → 100644
浏览文件 @
f112a03c
module
BlobViewer
class
Empty
<
Base
include
Simple
include
ServerSide
self
.
partial_name
=
'empty'
self
.
text_based
=
false
end
end
app/models/blob_viewer/simple.rb
0 → 100644
浏览文件 @
f112a03c
module
BlobViewer
module
Simple
extend
ActiveSupport
::
Concern
included
do
self
.
type
=
:simple
self
.
switcher_icon
=
'code'
self
.
switcher_title
=
'source'
end
end
end
app/models/blob_viewer/text.rb
0 → 100644
浏览文件 @
f112a03c
module
BlobViewer
class
Text
<
Base
include
Simple
include
ServerSide
self
.
partial_name
=
'text'
self
.
text_based
=
true
self
.
max_size
=
1
.
megabyte
self
.
absolute_max_size
=
10
.
megabytes
end
end
app/views/projects/blob/_text.html.haml
已删除
100644 → 0
浏览文件 @
13891a03
-
blob
.
load_all_data!
(
@repository
)
=
render
'shared/file_highlight'
,
blob:
blob
,
repository:
@repository
app/views/projects/blob/_download.html.haml
→
app/views/projects/blob/
viewers/
_download.html.haml
浏览文件 @
f112a03c
.file-content.blob_file.blob-no-preview
.file-content.blob_file.blob-no-preview
.center
.center
=
link_to
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
)
do
=
link_to
blob_raw_url
do
%h1
.light
%h1
.light
%i
.fa.fa-download
=
icon
(
'download'
)
%h4
%h4
Download (
#{
number_to_human_size
blob_size
(
blob
)
}
)
Download (
#{
number_to_human_size
(
viewer
.
blob
.
raw_size
)
}
)
app/views/projects/blob/viewers/_empty.html.haml
0 → 100644
浏览文件 @
f112a03c
.file-content.code
.nothing-here-block
Empty file
app/views/projects/blob/viewers/_text.html.haml
0 → 100644
浏览文件 @
f112a03c
=
render
'shared/file_highlight'
,
blob:
viewer
.
blob
,
repository:
@repository
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录