Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
44cf2470
Commit
44cf2470
authored
Apr 13, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Render blob using blob viewers
parent
30db305d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
6 deletions
+22
-6
app/views/projects/blob/_blob.html.haml
app/views/projects/blob/_blob.html.haml
+1
-6
app/views/projects/blob/_content.html.haml
app/views/projects/blob/_content.html.haml
+8
-0
app/views/projects/blob/_viewer.html.haml
app/views/projects/blob/_viewer.html.haml
+5
-0
app/views/projects/blob/_viewer_wrapper.html.haml
app/views/projects/blob/_viewer_wrapper.html.haml
+8
-0
No files found.
app/views/projects/blob/_blob.html.haml
View file @
44cf2470
...
...
@@ -26,9 +26,4 @@
%article
.file-holder
=
render
"projects/blob/header"
,
blob:
blob
-
if
blob
.
empty?
.file-content.code
.nothing-here-block
Empty file
-
else
=
render
blob
.
to_partial_path
(
@project
),
blob:
blob
=
render
'projects/blob/content'
,
blob:
blob
app/views/projects/blob/_content.html.haml
0 → 100644
View file @
44cf2470
-
simple_viewer
=
blob
.
simple_viewer
-
rich_viewer
=
blob
.
rich_viewer
-
active_viewer
=
rich_viewer
&&
params
[
:viewer
]
!=
'simple'
?
:rich
:
:simple
=
render
'projects/blob/viewer_wrapper'
,
viewer:
simple_viewer
,
hidden:
(
active_viewer
!=
:simple
)
-
if
rich_viewer
=
render
'projects/blob/viewer_wrapper'
,
viewer:
rich_viewer
,
hidden:
(
active_viewer
!=
:rich
)
app/views/projects/blob/_viewer.html.haml
0 → 100644
View file @
44cf2470
-
if
error
=
viewer
.
render_error
(
override_max_size:
params
[
:override_max_size
])
=
render
'projects/blob/render_error'
,
viewer:
viewer
,
error:
error
-
else
-
viewer
.
prepare!
=
render
viewer
.
partial_path
,
viewer:
viewer
app/views/projects/blob/_viewer_wrapper.html.haml
0 → 100644
View file @
44cf2470
-
hidden
=
local_assigns
.
fetch
(
:hidden
,
false
)
-
url
=
url_for
(
params
.
merge
(
format: :json
,
viewer:
viewer
.
type
))
if
viewer
.
server_side?
.blob-viewer
{
data:
{
type:
viewer
.
type
,
url:
url
},
class:
(
'hidden'
if
hidden
)
}
-
if
viewer
.
server_side?
.text-center.prepend-top-default.append-bottom-default
=
icon
(
'spinner spin 2x'
,
'aria-hidden'
=>
'true'
,
'aria-label'
=>
'Loading content'
)
-
else
=
render
'projects/blob/viewer'
,
viewer:
viewer
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment