summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2017-01-13 15:14:40 +0100
committerAlex Legler <alex@a3li.li>2017-01-13 15:14:40 +0100
commit21c1b585daa50b626b854fb63135be226c611486 (patch)
tree95189b9ee4fab26f4c841e4308ad7b6583015146
parentSupport <revised count=""> (diff)
downloadsecurity-21c1b585daa50b626b854fb63135be226c611486.tar.gz
security-21c1b585daa50b626b854fb63135be226c611486.tar.bz2
security-21c1b585daa50b626b854fb63135be226c611486.zip
Display slots in versions properly
-rw-r--r--lib/helpers.rb10
-rw-r--r--views/glsa/glsav1.erb6
2 files changed, 13 insertions, 3 deletions
diff --git a/lib/helpers.rb b/lib/helpers.rb
index d19e8f5..ab2e42c 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -44,6 +44,16 @@ helpers do
COMP_MAP.invert[val]
end
+ def render_version(ver)
+ vs = ver[1].split ':'
+
+ if vs.size == 1
+ '%s <strong>%s</strong>' % [h(reverse_xml_comp(ver[0])), h(ver[1])]
+ else
+ '%s <strong>%s</strong> in slot <strong>%s</strong>' % [h(reverse_xml_comp(ver[0])), h(vs[0]), h(vs[1])]
+ end
+ end
+
def yaml_dump(items)
items.map do |item|
{
diff --git a/views/glsa/glsav1.erb b/views/glsa/glsav1.erb
index a01f769..29e75c4 100644
--- a/views/glsa/glsav1.erb
+++ b/views/glsa/glsav1.erb
@@ -22,11 +22,11 @@
</tr>
<tr class="danger">
<th>Affected versions</th>
- <td><%= data[:vulnerable].map { |ver| "%s <strong>%s</strong>" % [h(reverse_xml_comp(ver[0])), h(ver[1])] }.join ', ' %></td>
+ <td><%= data[:vulnerable].map { |ver| render_version(ver) }.join '<br>' %></td>
</tr>
<tr class="success">
<th>Unaffected versions</th>
- <td><%= data[:unaffected].map { |ver| "%s <strong>%s</strong>" % [h(reverse_xml_comp(ver[0])), h(ver[1])] }.join ', ' %></td>
+ <td><%= data[:unaffected].map { |ver| render_version(ver) }.join '<br>' %></td>
</tr>
</table>
<% end %>
@@ -83,4 +83,4 @@
<% end %>
</ul>
</div>
-</div> \ No newline at end of file
+</div>