summaryrefslogtreecommitdiff
path: root/app/views/projects/blob/_viewer_switcher.html.haml
blob: 6a521069418e79cb612a0feeea604138cbbc035f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
- if blob.show_viewer_switcher?
  - simple_viewer = blob.simple_viewer
  - rich_viewer = blob.rich_viewer

  .btn-group.js-blob-viewer-switcher{ role: "group" }
    - simple_label = "Display #{simple_viewer.switcher_title}"
    %button.btn.btn-default.btn-sm.js-blob-viewer-switch-btn.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-switch-btn.has-tooltip{ 'aria-label' => rich_label, title: rich_label, data: { viewer: 'rich', container: 'body' } }>
      = icon(rich_viewer.switcher_icon)