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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ee17c659
Commit
ee17c659
authored
Apr 13, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add viewer switcher
parent
21d2ebff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+2
-0
app/views/projects/blob/_viewer_switcher.html.haml
app/views/projects/blob/_viewer_switcher.html.haml
+12
-0
No files found.
app/views/projects/blob/_header.html.haml
View file @
ee17c659
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
=
number_to_human_size
(
blob
.
raw_size
)
=
number_to_human_size
(
blob
.
raw_size
)
.file-actions.hidden-xs
.file-actions.hidden-xs
=
render
'projects/blob/viewer_switcher'
,
blob:
blob
unless
blame
.btn-group
{
role:
"group"
}
<
.btn-group
{
role:
"group"
}
<
=
copy_blob_source_button
(
blob
)
unless
blame
=
copy_blob_source_button
(
blob
)
unless
blame
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
...
...
app/views/projects/blob/_viewer_switcher.html.haml
0 → 100644
View file @
ee17c659
-
if
blob
.
show_viewer_switcher?
-
simple_viewer
=
blob
.
simple_viewer
-
rich_viewer
=
blob
.
rich_viewer
.btn-group
{
role:
"group"
}
-
simple_label
=
"Display
#{
simple_viewer
.
switcher_title
}
"
%button
.btn.btn-default.btn-sm.js-blob-viewer-switcher.has-tooltip
{
'aria-label'
=>
simple_label
,
title:
simple_label
,
data:
{
viewer:
'simple'
,
container:
'body'
}
}
>
=
icon
(
simple_viewer
.
switcher_icon
)
-
rich_label
=
"Display
#{
rich_viewer
.
switcher_title
}
"
%button
.btn.btn-default.btn-sm.js-blob-viewer-switcher.has-tooltip
{
'aria-label'
=>
rich_label
,
title:
rich_label
,
data:
{
viewer:
'rich'
,
container:
'body'
}
}
>
=
icon
(
rich_viewer
.
switcher_icon
)
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