summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorSean Amoss <ackle@gentoo.org>2017-04-18 18:48:21 -0400
committerSean Amoss <ackle@gentoo.org>2017-04-18 18:48:21 -0400
commit4d5b41d09e73f981c89a1156531353d5a403447e (patch)
treec6079ac46b19d2b83281d98204af69e7cdec8083 /app/views
parentGenerate migration to add slot support (diff)
downloadglsamaker-4d5b41d09e73f981c89a1156531353d5a403447e.tar.gz
glsamaker-4d5b41d09e73f981c89a1156531353d5a403447e.tar.bz2
glsamaker-4d5b41d09e73f981c89a1156531353d5a403447e.zip
Add slot support to GLSAMaker2.1.2
Diffstat (limited to 'app/views')
-rw-r--r--app/views/glsa/_glsa.xml.builder12
-rw-r--r--app/views/glsa/_package.html.erb1
-rw-r--r--app/views/glsa/_show_package_row.txt.erb14
-rw-r--r--app/views/glsa/edit.html.erb3
-rw-r--r--app/views/glsa/show.html.erb4
5 files changed, 27 insertions, 7 deletions
diff --git a/app/views/glsa/_glsa.xml.builder b/app/views/glsa/_glsa.xml.builder
index 2213f65..0fe529d 100644
--- a/app/views/glsa/_glsa.xml.builder
+++ b/app/views/glsa/_glsa.xml.builder
@@ -19,10 +19,18 @@ xml.glsa :id => glsa.glsa_id do
xml.package({:name => package, :auto => (atoms['unaffected'] || []).select {|a| !a.automatic}.length == 0 ? 'yes' : 'no',
:arch => (atoms['vulnerable'].nil? || atoms['vulnerable'].length == 0) ? '*' : atoms['vulnerable'].first.arch}) do
(atoms['unaffected'] || []).each do |a|
- xml.unaffected({:range => a.xml_comp}, a.version)
+ if a.slot != '*'
+ xml.unaffected({:range => a.xml_comp, :slot => a.slot}, a.version)
+ else
+ xml.unaffected({:range => a.xml_comp}, a.version)
+ end
end
(atoms['vulnerable'] || []).each do |a|
- xml.vulnerable({:range => a.xml_comp}, a.version)
+ if a.slot != '*'
+ xml.vulnerable({:range => a.xml_comp, :slot => a.slot}, a.version)
+ else
+ xml.vulnerable({:range => a.xml_comp}, a.version)
+ end
end
end
end
diff --git a/app/views/glsa/_package.html.erb b/app/views/glsa/_package.html.erb
index 73203d9..5e3d115 100644
--- a/app/views/glsa/_package.html.erb
+++ b/app/views/glsa/_package.html.erb
@@ -4,6 +4,7 @@
<td><%= pf.text_field :atom, :class => :nice, :index => nil %></td>
<td class="odd"><%= pf.select :comp, comps, {}, :index => nil %></td>
<td class="odd"><%= pf.text_field :version, :class => :nice, :size => 10, :index => nil %></td>
+ <td class="odd"><%= pf.text_field :slot, :class => :nice, :size => 5, :index => nil %></td>
<td><%= pf.text_field :arch, :class => :nice, :size => 7, :index => nil %></td>
<td class="odd"><%= pf.select :automatic, [["yes", true], ["no", false]], {}, :index => nil %></td>
<td><%= link_to_function(
diff --git a/app/views/glsa/_show_package_row.txt.erb b/app/views/glsa/_show_package_row.txt.erb
index be33882..31d3186 100644
--- a/app/views/glsa/_show_package_row.txt.erb
+++ b/app/views/glsa/_show_package_row.txt.erb
@@ -16,7 +16,12 @@ print_vulnerable = (unaffected_versions.size == 0 ? true : false)
while vulnerable_versions.size > 0 or unaffected_versions.size > 0
v = (vulnerable_versions.shift if vulnerable_versions.size > 0) || nil
- line = (v ? "#{v.comp} #{v.version}" : "").center(20)
+ print_slot = (v.slot != '*' ? true : false)
+ if print_slot
+ line = (v ? "#{v.comp} #{v.version}:#{v.slot}" : "").center(20)
+ else
+ line = (v ? "#{v.comp} #{v.version}" : "").center(20)
+ end
if v and v.arch != '*'
@arches[@packages_count] ||= []
@@ -28,7 +33,12 @@ while vulnerable_versions.size > 0 or unaffected_versions.size > 0
print_vulnerable = false
else
v = (unaffected_versions.shift if unaffected_versions.size > 0) || nil
- line += (v ? "#{v.comp} #{v.version} #{v.automatic ? "" : (@print_noauto = true && "*")}" : "").rjust(22)
+ print_slot = (v.slot != '*' ? true : false)
+ if print_slot
+ line += (v ? "#{v.comp} #{v.version}:#{v.slot} #{v.automatic ? "" : (@print_noauto = true && "*")}" : "").rjust(22)
+ else
+ line += (v ? "#{v.comp} #{v.version} #{v.automatic ? "" : (@print_noauto = true && "*")}" : "").rjust(22)
+ end
end
versions << line
end
diff --git a/app/views/glsa/edit.html.erb b/app/views/glsa/edit.html.erb
index 882f503..000d1be 100644
--- a/app/views/glsa/edit.html.erb
+++ b/app/views/glsa/edit.html.erb
@@ -75,6 +75,7 @@
<tr>
<th><%= image_tag 'icons/atom.png' %> Atom</th>
<th class="odd" colspan="2">Version</th>
+ <th title="* or slot">Slot</th>
<th title="* or space-separated list of arches"><%= image_tag 'icons/arch.png' %> Arch</th>
<th class="odd"><%= image_tag 'icons/auto.png' %> Auto</th>
</tr>
@@ -173,4 +174,4 @@
GLSAMaker.editing.templates.observeClick($('impact'));
GLSAMaker.editing.templates.observeClick($('workaround'));
GLSAMaker.editing.templates.observeClick($('resolution'));
-</script> \ No newline at end of file
+</script>
diff --git a/app/views/glsa/show.html.erb b/app/views/glsa/show.html.erb
index a0965f9..1da1a94 100644
--- a/app/views/glsa/show.html.erb
+++ b/app/views/glsa/show.html.erb
@@ -90,7 +90,7 @@
<td>
<ul>
<% @rev.packages.each do |pkg| ; next unless pkg.my_type == "unaffected" %>
- <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li>
+ <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %>:<%= pkg.slot %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li>
<% end %>
</ul>
</td>
@@ -100,7 +100,7 @@
<td>
<ul>
<% @rev.packages.each do |pkg| ; next unless pkg.my_type == "vulnerable" %>
- <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li>
+ <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %>:<%= pkg.slot %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li>
<% end %>
</ul>
</td>