_header.html.haml 2.23 KB
Newer Older
Eric Eastwood's avatar
Eric Eastwood committed
1
2
3
4
5
6
7
8
9
10
.detail-page-header
  .detail-page-header-body
    .snippet-box.has-tooltip.inline.append-right-5{ title: snippet_visibility_level_description(@snippet.visibility_level, @snippet), data: { container: "body" } }
      %span.sr-only
        = visibility_level_label(@snippet.visibility_level)
      = visibility_level_icon(@snippet.visibility_level, fw: false)
    %span.creator
      Authored
      = time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago')
      by #{link_to_member(@project, @snippet.author, size: 24, author_class: "author item-title", avatar_class: "hidden-xs")}
11

Eric Eastwood's avatar
Eric Eastwood committed
12
  .detail-page-header-actions
13
14
15
16
    - if @snippet.project_id?
      = render "projects/snippets/actions"
    - else
      = render "snippets/actions"
17

18
.snippet-header.limited-header-width
19
20
21
  %h2.snippet-title.prepend-top-0.append-bottom-0
    = markdown_field(@snippet, :title)

22
23
24
25
26
27
  - if @snippet.description.present?
    .description
      .wiki
        = markdown_field(@snippet, :description)
      %textarea.hidden.js-task-list-field
        = @snippet.description
haseeb's avatar
haseeb committed
28
29
30
31

  - if @snippet.updated_at != @snippet.created_at
    = edited_time_ago_with_tooltip(@snippet, placement: 'bottom', html_class: 'snippet-edited-ago', exclude_author: true)

haseeb's avatar
haseeb committed
32
  - if public_snippet?
haseeb's avatar
haseeb committed
33
    .embed-snippet
haseeb's avatar
haseeb committed
34
35
      .input-group
        .input-group-btn
haseeb's avatar
haseeb committed
36
          %button.btn.embed-toggle{ 'data-toggle': 'dropdown', type: 'button' }
haseeb's avatar
haseeb committed
37
            %span.js-embed-action= _("Embed")
haseeb's avatar
haseeb committed
38
            = sprite_icon('angle-down', size: 12)
haseeb's avatar
haseeb committed
39
          %ul.dropdown-menu.dropdown-menu-selectable.embed-toggle-list
haseeb's avatar
haseeb committed
40
            %li
haseeb's avatar
haseeb committed
41
              %button.js-embed-btn.btn.btn-transparent.is-active{ type: 'button' }
haseeb's avatar
haseeb committed
42
                %strong.embed-toggle-list-item= _("Embed")
haseeb's avatar
haseeb committed
43
            %li
haseeb's avatar
haseeb committed
44
              %button.js-share-btn.btn.btn-transparent{ type: 'button' }
haseeb's avatar
haseeb committed
45
                %strong.embed-toggle-list-item= _("Share")
haseeb's avatar
haseeb committed
46
        %input.js-snippet-url-area.snippet-embed-input.form-control{ type: "text", autocomplete: 'off', value: snippet_embed }
haseeb's avatar
haseeb committed
47
        .input-group-btn
48
          %button.js-clipboard-btn.snippet-clipboard-btn.btn.btn-default.has-tooltip{ title: "Copy to clipboard", 'data-clipboard-target': '.js-snippet-url-area' }
haseeb's avatar
haseeb committed
49
50
            = sprite_icon('duplicate', size: 16)
    .clearfix