diff options
Diffstat (limited to 'app/views/search/results')
-rw-r--r-- | app/views/search/results/_blob.html.haml | 18 | ||||
-rw-r--r-- | app/views/search/results/_blob_data.html.haml | 10 | ||||
-rw-r--r-- | app/views/search/results/_commit.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_issue.html.haml | 4 | ||||
-rw-r--r-- | app/views/search/results/_merge_request.html.haml | 6 | ||||
-rw-r--r-- | app/views/search/results/_snippet_title.html.haml | 6 | ||||
-rw-r--r-- | app/views/search/results/_wiki_blob.html.haml | 15 |
7 files changed, 29 insertions, 32 deletions
diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml index de473c23d66..fdcd126e7a3 100644 --- a/app/views/search/results/_blob.html.haml +++ b/app/views/search/results/_blob.html.haml @@ -1,13 +1,5 @@ -- file_name, blob = blob -.blob-result - .file-holder - .js-file-title.file-title - - ref = @search_results.repository_ref - - blob_link = project_blob_path(@project, tree_join(ref, file_name)) - = link_to blob_link do - %i.fa.fa-file - %strong - = file_name - - if blob - .file-content.code.term - = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link +- project = find_project_for_result_blob(blob) +- file_name, blob = parse_search_result(blob) +- blob_link = project_blob_path(project, tree_join(blob.ref, file_name)) + += render partial: 'search/results/blob_data', locals: { blob: blob, project: project, file_name: file_name, blob_link: blob_link } diff --git a/app/views/search/results/_blob_data.html.haml b/app/views/search/results/_blob_data.html.haml new file mode 100644 index 00000000000..143e9f91ca3 --- /dev/null +++ b/app/views/search/results/_blob_data.html.haml @@ -0,0 +1,10 @@ +.blob-result + .file-holder + .js-file-title.file-title + = link_to blob_link do + %i.fa.fa-file + %strong + = search_blob_title(project, file_name) + - if blob.data + .file-content.code.term + = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline diff --git a/app/views/search/results/_commit.html.haml b/app/views/search/results/_commit.html.haml index f34eaf89027..ed5a3badf11 100644 --- a/app/views/search/results/_commit.html.haml +++ b/app/views/search/results/_commit.html.haml @@ -1 +1 @@ -= render 'projects/commits/commit', project: @project, commit: commit, ref: nil += render 'projects/commits/commit', project: commit.project, commit: commit, ref: nil, show_project_name: @project.nil? diff --git a/app/views/search/results/_issue.html.haml b/app/views/search/results/_issue.html.haml index b7a27ef6be2..c413c3d4abb 100644 --- a/app/views/search/results/_issue.html.haml +++ b/app/views/search/results/_issue.html.haml @@ -4,8 +4,8 @@ = link_to [issue.project.namespace.becomes(Namespace), issue.project, issue] do %span.term.str-truncated= issue.title - if issue.closed? - %span.label.label-danger.prepend-left-5 Closed - .pull-right ##{issue.iid} + %span.badge.badge-danger.prepend-left-5 Closed + .float-right ##{issue.iid} - if issue.description.present? .description.term = search_md_sanitize(issue, :description) diff --git a/app/views/search/results/_merge_request.html.haml b/app/views/search/results/_merge_request.html.haml index 8b0fd74f680..519176af108 100644 --- a/app/views/search/results/_merge_request.html.haml +++ b/app/views/search/results/_merge_request.html.haml @@ -3,10 +3,10 @@ = link_to [merge_request.target_project.namespace.becomes(Namespace), merge_request.target_project, merge_request] do %span.term.str-truncated= merge_request.title - if merge_request.merged? - %span.label.label-primary.prepend-left-5 Merged + %span.badge.badge-primary.prepend-left-5 Merged - elsif merge_request.closed? - %span.label.label-danger.prepend-left-5 Closed - .pull-right= merge_request.to_reference + %span.badge.badge-danger.prepend-left-5 Closed + .float-right= merge_request.to_reference - if merge_request.description.present? .description.term = search_md_sanitize(merge_request, :description) diff --git a/app/views/search/results/_snippet_title.html.haml b/app/views/search/results/_snippet_title.html.haml index d46c4d11e51..9c8afb2165b 100644 --- a/app/views/search/results/_snippet_title.html.haml +++ b/app/views/search/results/_snippet_title.html.haml @@ -3,13 +3,13 @@ = link_to reliable_snippet_path(snippet_title) do = truncate(snippet_title.title, length: 60) - if snippet_title.private? - %span.label.label-gray + %span.badge.badge-gray %i.fa.fa-lock private - %span.cgray.monospace.tiny.pull-right.term + %span.cgray.monospace.tiny.float-right.term = snippet_title.file_name - %small.pull-right.cgray + %small.float-right.cgray - if snippet_title.project_id? = link_to snippet_title.project.full_name, project_path(snippet_title.project) diff --git a/app/views/search/results/_wiki_blob.html.haml b/app/views/search/results/_wiki_blob.html.haml index 16a0e432d62..4346217c230 100644 --- a/app/views/search/results/_wiki_blob.html.haml +++ b/app/views/search/results/_wiki_blob.html.haml @@ -1,10 +1,5 @@ -- wiki_blob = parse_search_result(wiki_blob) -.blob-result - .file-holder - .js-file-title.file-title - = link_to project_wiki_path(@project, wiki_blob.basename) do - %i.fa.fa-file - %strong - = wiki_blob.basename - .file-content.code.term - = render 'shared/file_highlight', blob: wiki_blob, first_line_number: wiki_blob.startline +- project = find_project_for_result_blob(wiki_blob) +- file_name, wiki_blob = parse_search_result(wiki_blob) +- wiki_blob_link = project_wiki_path(project, wiki_blob.basename) + += render partial: 'search/results/blob_data', locals: { blob: wiki_blob, project: project, file_name: file_name, blob_link: wiki_blob_link } |