aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Legler <alex@a3li.li>2011-08-20 14:09:08 +0200
committerAlex Legler <alex@a3li.li>2011-08-20 14:09:08 +0200
commita81d5fbb8368a0a2c84242798d63a76d554cac16 (patch)
tree8d03cc7e9c1addcdf31976bb1a402fa66aef23a4
parentToolsController: file_req_ajax_info is now bugs_ajax_info; Remove old methods (diff)
downloadglsamaker-a81d5fbb8368a0a2c84242798d63a76d554cac16.tar.gz
glsamaker-a81d5fbb8368a0a2c84242798d63a76d554cac16.tar.bz2
glsamaker-a81d5fbb8368a0a2c84242798d63a76d554cac16.zip
Migrate CVEController to rails3
-rw-r--r--app/assets/javascripts/jsui.js7
-rw-r--r--app/assets/stylesheets/cve.css (renamed from public/stylesheets/cve.css)0
-rw-r--r--app/models/cve.rb2
-rw-r--r--app/views/cve/_toolbar.js.erb14
-rw-r--r--app/views/cve/general_info.html.erb2
-rw-r--r--app/views/cve/info.html.erb4
-rw-r--r--app/views/layouts/cve.html.erb7
7 files changed, 20 insertions, 16 deletions
diff --git a/app/assets/javascripts/jsui.js b/app/assets/javascripts/jsui.js
index cc3b8f4..039f727 100644
--- a/app/assets/javascripts/jsui.js
+++ b/app/assets/javascripts/jsui.js
@@ -1,3 +1,8 @@
+//= require prototype
+//= require prototype_ujs
+//= require effects
//= require uki
//= require uki-more
-//= require searchable \ No newline at end of file
+//= require searchable
+//= require glsamaker
+//= require glsamaker_misc \ No newline at end of file
diff --git a/public/stylesheets/cve.css b/app/assets/stylesheets/cve.css
index bebb317..bebb317 100644
--- a/public/stylesheets/cve.css
+++ b/app/assets/stylesheets/cve.css
diff --git a/app/models/cve.rb b/app/models/cve.rb
index 4384b16..abc576f 100644
--- a/app/models/cve.rb
+++ b/app/models/cve.rb
@@ -173,3 +173,5 @@ class CVE < ActiveRecord::Base
package_hints.flatten.uniq
end
end
+
+class Cve < CVE; end \ No newline at end of file
diff --git a/app/views/cve/_toolbar.js.erb b/app/views/cve/_toolbar.js.erb
index af685ae..6097c61 100644
--- a/app/views/cve/_toolbar.js.erb
+++ b/app/views/cve/_toolbar.js.erb
@@ -5,9 +5,9 @@ function toolbar() {
{ value: 2004, text: '2004' }];
return [
- { view: 'Image', rect: '0 0 220 57', anchors: 'left top', src: '/images/cvetool-logo.png', id: 'logo' },
+ { view: 'Image', rect: '0 0 220 57', anchors: 'left top', src: '/assets/cvetool-logo.png', id: 'logo' },
// view settings
- { view: 'Image', rect: '5 57 16 16', anchors: 'left top', src: '/images/icons/switch.png' },
+ { view: 'Image', rect: '5 57 16 16', anchors: 'left top', src: '/assets/icons/switch.png' },
{ view: 'Label', rect: '25 54 100 24', anchors: 'left top right', text: 'View settings' },
{ view: 'uki.more.view.ToggleButton', rect: '5 80 36 22', anchors: 'top', text: 'NEW', id: 'toggle-new', checked: true },
{ view: 'uki.more.view.ToggleButton', rect: '43 80 36 22', anchors: 'top', text: 'ASS', id: 'toggle-assigned' },
@@ -21,27 +21,27 @@ function toolbar() {
{ view: 'Label', rect: '100 85 10 10', anchors: 'left top right', text: '', id: 'popup'},
// assign
- { view: 'Image', rect: '5 140 16 16', anchors: 'left top', src: '/images/icons/bug_add.png' },
+ { view: 'Image', rect: '5 140 16 16', anchors: 'left top', src: '/assets/icons/bug_add.png' },
{ view: 'Label', rect: '25 137 188 24', anchors: 'left top right', text: 'Assign selected CVEs to bug' },
{ view: 'TextField', rect: '5 165 135 22', anchors: 'left top right', placeholder: 'bug', id: 'assign-bug-nr' },
{ view: 'Button', rect: '145 164 50 24', anchors: 'top right', text: 'Assign', id: 'cve-assign' },
// file-new-bug
- { view: 'Image', rect: '5 200 16 16', anchors: 'left top', src: '/images/icons/bug_new.png' },
+ { view: 'Image', rect: '5 200 16 16', anchors: 'left top', src: '/assets/icons/bug_new.png' },
{ view: 'Label', rect: '25 198 188 24', anchors: 'left top right', text: 'New bug from selected CVEs' },
{ view: 'Button', rect: '5 225 188 24', anchors: 'left top right', text: 'File a new bug', id: 'cve-file' },
// mark-as
- { view: 'Image', rect: '5 265 16 16', anchors: 'left top', src: '/images/icons/stamp.png' },
+ { view: 'Image', rect: '5 265 16 16', anchors: 'left top', src: '/assets/icons/stamp.png' },
{ view: 'Label', rect: '25 262 188 24', anchors: 'left top right', text: 'Mark selected CVEs as…' },
{ view: 'Button', rect: '5 290 60 24', anchors: 'left top' , text: 'NFU', id: 'cve-mark-nfu' },
{ view: 'Button', rect: '70 290 60 24', anchors: 'left top', text: 'LATER', id: 'cve-mark-later' },
{ view: 'Button', rect: '135 290 60 24', anchors: 'left top', text: 'INVALID', id: 'cve-mark-invalid' },
// add-a-note
- { view: 'Image', rect: '5 330 16 16', anchors: 'left top', src: '/images/icons/note.png' },
+ { view: 'Image', rect: '5 330 16 16', anchors: 'left top', src: '/assets/icons/note.png' },
{ view: 'Label', rect: '25 327 188 24', anchors: 'left top right', text: 'Add a note to selected CVEs' },
{ view: 'MultilineTextField', rect: '5 350 189 50', anchors: 'left top right', placeholder: 'Note', id: 'cve-note-text' },
{ view: 'Button', rect: '135 405 60 24', anchors: 'right top', text: 'Add note', id: 'cve-add-note' },
// mark-as
- { view: 'Image', rect: '5 445 16 16', anchors: 'left top', src: '/images/icons/info.png' },
+ { view: 'Image', rect: '5 445 16 16', anchors: 'left top', src: '/assets/icons/info.png' },
{ view: 'Button', rect: '25 442 170 24', anchors: 'left top' , text: 'Info about selected CVEs', id: 'cve-details' },
// bottom stuff
diff --git a/app/views/cve/general_info.html.erb b/app/views/cve/general_info.html.erb
index f7b9d6c..5179ce9 100644
--- a/app/views/cve/general_info.html.erb
+++ b/app/views/cve/general_info.html.erb
@@ -5,7 +5,7 @@
<ul>
<% @cve.assignments.each do |ass| %>
<li>
- <a href="https://<%= GLSAMAKER_BUGZIE_HOST %>/<%= h ass.bug %>" target="_blank"><%= h ass.bug %></a>
+ <a href="https://<%= GLSAMAKER_BUGZIE_HOST %>/<%= ass.bug %>" target="_blank"><%= ass.bug %></a>
</li>
<% end %>
</ul>
diff --git a/app/views/cve/info.html.erb b/app/views/cve/info.html.erb
index 6094afe..e857c7f 100644
--- a/app/views/cve/info.html.erb
+++ b/app/views/cve/info.html.erb
@@ -5,13 +5,13 @@
<% else %>
<script language="JavaScript" type="text/javascript">
-cve_id = "<%= h @cve.cve_id %>";
+cve_id = "<%= escape_javascript @cve.cve_id %>";
// page layout
uki({ view: 'VSplitPane', rect: '500 600', anchors: 'left top right bottom', topMin: 120, handlePosition: 120,
topChildViews: [
{ view: 'Box', rect: '0 0 500 30', anchors: 'top right left', background: 'cssBox(background:#D3CFE5;border-bottom:1px solid #999)', childViews: [
- { view: 'Label', rect: '5 5 400 20', html: "<h2 style='margin: 0;'><%= @cve.colorize %> <small>(<%= @cve.state %>)</small></h2>", anchors: 'top left'},
+ { view: 'Label', rect: '5 5 400 20', html: "<h2 style='margin: 0;'><%= @cve.colorize.html_safe %> <small>(<%= @cve.state %>)</small></h2>", anchors: 'top left'},
{ view: 'Button', rect: '440 4 50 20', text: 'Close', anchors: 'top right', id: 'close' }
] },
{ view: 'Label', rect: '5 35 490 50', anchors: 'left top right', html: '<%= escape_javascript(simple_format_without_paragraph(h @cve.summary)).gsub(/\n/, '') %>', textSelectable: true, multiline: true}
diff --git a/app/views/layouts/cve.html.erb b/app/views/layouts/cve.html.erb
index 3d6e06e..c5962ab 100644
--- a/app/views/layouts/cve.html.erb
+++ b/app/views/layouts/cve.html.erb
@@ -5,16 +5,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title><%= @pageTitle + " &mdash; "if @pageTitle%> GLSAMaker 2 &mdash; CVETool</title>
- <%= javascript_include_tag :defaults %>
- <%= javascript_include_tag 'uki', 'uki-more', 'glsamaker' %>
- <%= javascript_include_tag 'searchable' %>
+ <%= javascript_include_tag 'jsui' %>
<script type="text/javascript">
uki.theme.airport.imagePath = '/uki-theme/airport/i/';
</script>
<%= stylesheet_link_tag "cve" %>
-
- <style type="text/css">body, html { margin: 0; padding: 0; overflow:hidden; };</style>
+ <style type="text/css">body, html { margin: 0; padding: 0; overflow:hidden; };</style>
</head>
<body id="<%= h @pageID if @pageID %>">
<%= yield %>