Commit b48d374b authored by Jonathan Schafer's avatar Jonathan Schafer

More HAML cleanup

Using variable for location
Split Class and Method to separate lines
Only file is linked (not "File:")
Method name in code block
parent 4c2ed6c9
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
%h2.title= @vulnerability.title %h2.title= @vulnerability.title
.description .description
.md .md
- location = @vulnerability.finding.location
%h3= "Description" %h3= "Description"
%p= @vulnerability.finding.description %p= @vulnerability.finding.description
%ul %ul
...@@ -18,23 +19,26 @@ ...@@ -18,23 +19,26 @@
%li= _("Confidence: %{confidence}") % { confidence: @vulnerability.confidence } %li= _("Confidence: %{confidence}") % { confidence: @vulnerability.confidence }
%li= _("Report Type: %{report_type}") % { report_type: @vulnerability.report_type } %li= _("Report Type: %{report_type}") % { report_type: @vulnerability.report_type }
- if @vulnerability.finding.location["image"] - if location['image']
%li= _("Image: %{image}") % { image: @vulnerability.finding.location['image'] } %li= _("Image: %{image}") % { image: location['image'] }
- if @vulnerability.finding.location["operating_system"] - if location['operating_system']
%li= _("Namespace: %{namespace}") % { namespace: @vulnerability.finding.location['operating_system'] } %li= _("Namespace: %{namespace}") % { namespace: location['operating_system'] }
- if @vulnerability.finding.location["file"] - if location['file']
%h3= _("File Location") %h3= _('File Location')
%ul %ul
%li %li
- link_text = _("File: %{file}:%{line}") % { file: @vulnerability.finding.location["file"], - link_text = _("%{file}:%{line}") % { file: location['file'], line: location['start_line'] }
line: @vulnerability.finding.location["start_line"] } File:
%a{ :href=>fast_project_blob_path(@project, tree_join(@vulnerability.project.default_branch, @vulnerability.finding.location["file"])), %a{ href: fast_project_blob_path(@project, tree_join(@vulnerability.project.default_branch, location['file'])),
target: "_blank", rel: 'noopener noreferrer' }= link_text target: '_blank', rel: 'noopener noreferrer' }= link_text
- if @vulnerability.finding.location["class"] - if location['class']
%li= _("Class: %{className}::%{method}") % {className: @vulnerability.finding.location["class"], %li= _("Class: %{className}") % { className: location['class'] }
method: @vulnerability.finding.location["method"] } - if location['method']
%li
Method:
%code= _("%{method}") % { method: location['method'] }
- if @vulnerability.finding.links.any? - if @vulnerability.finding.links.any?
%h3= _("Links") %h3= _("Links")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment