summaryrefslogtreecommitdiff
path: root/app/views/shared/snippets/_header.html.haml
blob: e2680fac01916bfc8982a6fe72d18bbbe4871c27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.detail-page-header
  .detail-page-header-body
    .snippet-box.has-tooltip.inline.gl-mr-2{ 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)
    %span.creator
      = s_('Snippets|Authored %{time_ago} by %{author}').html_safe % { time_ago: time_ago_with_tooltip(@snippet.created_at, placement: 'bottom', html_class: 'snippet_updated_ago'), author: link_to_member(@project, @snippet.author, size: 24, author_class: "author item-title", avatar_class: "d-none d-sm-inline") + user_status(@snippet.author) }

  .detail-page-header-actions
    - if @snippet.project_id?
      = render "projects/snippets/actions"
    - else
      = render "snippets/actions"

.snippet-header.limited-header-width
  %h2.snippet-title.gl-mt-0.mb-3
    = markdown_field(@snippet, :title)

  - if @snippet.description.present?
    .description
      .md
        = markdown_field(@snippet, :description)

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

  - if @snippet.embeddable?
    .embed-snippet
      .input-group
        .input-group-prepend
          %button.btn.gl-button.btn-svg.embed-toggle.input-group-text{ 'data-toggle': 'dropdown', type: 'button' }
            %span.js-embed-action= _("Embed")
            = sprite_icon('angle-down', size: 12, css_class: 'caret-down')
          %ul.dropdown-menu.dropdown-menu-selectable.embed-toggle-list
            %li
              %button.js-embed-btn.btn.gl-button.btn-default-tertiary.is-active{ type: 'button' }
                %strong.embed-toggle-list-item= _("Embed")
            %li
              %button.js-share-btn.btn.gl-button.btn-default-tertiary{ type: 'button' }
                %strong.embed-toggle-list-item= _("Share")
        = snippet_embed_input(@snippet)
        .input-group-append
          = clipboard_button(title: _('Copy'), class: 'js-clipboard-btn snippet-clipboard-btn btn btn-default', target: '.js-snippet-url-area')
    .clearfix