diff options
-rw-r--r-- | lib/helpers.rb | 10 | ||||
-rw-r--r-- | views/glsa/glsav1.erb | 6 |
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> |