Welcome to mirror list, hosted at ThFree Co, Russian Federation.

_snippet_blob.html.haml « results « search « views « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8af393777f0c32d4dde8597c762967769d1ae366 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.search-result-row
  %span
    = snippet_blob[:snippet_object].title
    by
    = link_to user_snippets_path(snippet_blob[:snippet_object].author) do
      = image_tag avatar_icon(snippet_blob[:snippet_object].author_email), class: "avatar avatar-inline s16", alt: ''
      = snippet_blob[:snippet_object].author_name
    %span.light #{time_ago_with_tooltip(snippet_blob[:snippet_object].created_at)}
  %h4.snippet-title
  - snippet_path = reliable_snippet_path(snippet_blob[:snippet_object])
  = link_to snippet_path do
    .file-holder
      .file-title
        %i.fa.fa-file
        %strong= snippet_blob[:snippet_object].file_name
      - if gitlab_markdown?(snippet_blob[:snippet_object].file_name)
        .file-content.wiki
          - snippet_blob[:snippet_chunks].each do |snippet|
            - unless snippet[:data].empty?
              = preserve do
                = markdown(snippet[:data])
            - else
              .file-content.code
                .nothing-here-block Empty file
      - elsif markup?(snippet_blob[:snippet_object].file_name)
        .file-content.wiki
          - snippet_blob[:snippet_chunks].each do |snippet|
            - unless snippet[:data].empty?
              = render_markup(snippet_blob[:snippet_object].file_name, snippet[:data])
            - else
              .file-content.code
                .nothing-here-block Empty file
      - else
        .file-content.code
          %div.highlighted-data{class: user_color_scheme_class}
            .line-numbers
              - snippet_blob[:snippet_chunks].each do |snippet|
                - unless snippet[:data].empty?
                  - snippet[:data].lines.to_a.size.times do |index|
                    - offset = defined?(snippet[:start_line]) ? snippet[:start_line] : 1
                    - i = index + offset
                    = link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}" do
                      %i.fa.fa-link
                      = i
                  - unless snippet == snippet_blob[:snippet_chunks].last
                    %a
                      = "."
            .highlight.term
              %pre
                %code
                  - snippet_blob[:snippet_chunks].each do |snippet|
                    - unless snippet[:data].empty?
                      = snippet[:data]
                      - unless snippet == snippet_blob[:snippet_chunks].last
                        %a
                          = "..."
                    - else
                      .file-content.code
                        .nothing-here-block Empty file