diff options
author | Alex Legler <alex@a3li.li> | 2011-08-18 13:52:10 +0200 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2011-08-18 13:52:10 +0200 |
commit | d3850abfb0bdace16503b42f3c3d17967ca357f9 (patch) | |
tree | 0e70e26579f47ee076019d271f8ec0dc3bb53ab9 | |
parent | Complete migration of the new-request view to rails3 and back to prototype (diff) | |
download | glsamaker-d3850abfb0bdace16503b42f3c3d17967ca357f9.tar.gz glsamaker-d3850abfb0bdace16503b42f3c3d17967ca357f9.tar.bz2 glsamaker-d3850abfb0bdace16503b42f3c3d17967ca357f9.zip |
Migrate glsa/show views to rails-3
-rw-r--r-- | app/views/glsa/_glsa.xml.builder | 2 | ||||
-rw-r--r-- | app/views/glsa/_show_bug_row.html.erb | 6 | ||||
-rw-r--r-- | app/views/glsa/show.html.erb | 49 | ||||
-rw-r--r-- | app/views/glsa/show.txt.erb | 2 | ||||
-rw-r--r-- | app/views/glsa/show.xml.erb | 2 |
5 files changed, 28 insertions, 33 deletions
diff --git a/app/views/glsa/_glsa.xml.builder b/app/views/glsa/_glsa.xml.builder index 8c905fa..6320ef9 100644 --- a/app/views/glsa/_glsa.xml.builder +++ b/app/views/glsa/_glsa.xml.builder @@ -1,7 +1,7 @@ xml.instruct! xml.instruct! :'xml-stylesheet', :href => '/xsl/glsa.xsl', :type => 'text/xsl' xml.instruct! :'xml-stylesheet', :href => '/xsl/guide.xsl', :type => 'text/xsl' -xml.declare! :DOCTYPE, :glsa, :SYSTEM, "http://www.gentoo.org/dtd/glsa-2.dtd" +xml.declare! :DOCTYPE, :glsa, :SYSTEM, "http://www.gentoo.org/dtd/glsa.dtd" xml.glsa :id => glsa.glsa_id do xml.title rev.title diff --git a/app/views/glsa/_show_bug_row.html.erb b/app/views/glsa/_show_bug_row.html.erb index 9fb4053..05c75e6 100644 --- a/app/views/glsa/_show_bug_row.html.erb +++ b/app/views/glsa/_show_bug_row.html.erb @@ -1,6 +1,6 @@ -<tr id="bug-<%= h bug.bug_id %>"> +<tr id="bug-<%= bug.bug_id %>"> <td><%= bugready_icon(bug.bug_ready?) %></td> <td> - <a href="javascript:///" onclick="buginfo(<%= h bug.bug_id %>);"><strong><%= h bug.bug_id %></strong></a></td> - <td><%= truncate(h(bug.title), :length => 60) %></td> + <a href="javascript:///" onclick="buginfo(<%= bug.bug_id %>);"><strong><%= bug.bug_id %></strong></a></td> + <td><%= truncate(bug.title, :length => 60) %></td> </tr>
\ No newline at end of file diff --git a/app/views/glsa/show.html.erb b/app/views/glsa/show.html.erb index 9193fcf..d547727 100644 --- a/app/views/glsa/show.html.erb +++ b/app/views/glsa/show.html.erb @@ -10,12 +10,12 @@ options_from_collection_for_select(@glsa.revisions, :revid, :to_s, @rev.revid), :onchange => "document.location = '#{url_for :controller=> :glsa, :action => :show, :id => @glsa}?rev_id=' + this.value" %> </span> - <%= link_to "#{image_tag 'icons/edit.png'} Edit this draft", {:controller => 'glsa', :action => 'edit', :id => @glsa}, {:class => 'button'} %> - <%= link_to "#{image_tag 'icons/xml.png'} View as XML", {:controller => 'glsa', :action => 'show', :id => @glsa, :format => 'xml'}, {:class => 'button'} %> - <%= link_to "#{image_tag 'icons/txt.png'} View as Text", {:controller => 'glsa', :action => 'show', :id => @glsa, :format => 'txt'}, {:class => 'button'} %> - <%= link_to_function "#{image_tag 'icons/reference.png'} Import references", "GLSAMaker.editing.references.import_dialog(#{h @glsa.id})", {:class => 'button'} %> - <%= link_to "#{image_tag 'icons/diff.png'} Compare revisions", {:controller => 'glsa', :action => 'diff', :id => @glsa, :old => @glsa.last_revision.revid - 1, :new => @glsa.last_revision.revid}, {:class => 'button'} %> - <%= link_to "#{image_tag 'icons/sent.png'} Release advisory", {:controller => 'glsa', :action => 'prepare_release', :id => @glsa}, {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/edit.png'} Edit this draft".html_safe, {:controller => 'glsa', :action => 'edit', :id => @glsa}, {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/xml.png'} View as XML".html_safe, {:controller => 'glsa', :action => 'show', :id => @glsa, :format => 'xml'}, {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/txt.png'} View as Text".html_safe, {:controller => 'glsa', :action => 'show', :id => @glsa, :format => 'txt'}, {:class => 'button'} %> + <%= link_to_function "#{image_tag 'icons/reference.png'} Import references".html_safe, "GLSAMaker.editing.references.import_dialog(#{h @glsa.id})", {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/diff.png'} Compare revisions".html_safe, {:controller => 'glsa', :action => 'diff', :id => @glsa, :old => @glsa.last_revision.revid - 1, :new => @glsa.last_revision.revid}, {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/sent.png'} Release advisory".html_safe, {:controller => 'glsa', :action => 'prepare_release', :id => @glsa}, {:class => 'button'} %> </div> <div style="float: right; width: 40%;"> @@ -28,35 +28,30 @@ <%= restricted_icon @glsa.restricted %> </h2><br /> <% if @glsa.is_approved? and @glsa.last_revision.bug_ready? %> - <p><img src="/images/icons/ok.png" alt="ok" /> This draft is <strong>ready for sending</strong>.</p> + <p><img src="/assets/icons/ok.png" alt="ok" /> This draft is <strong>ready for sending</strong>.</p> <% else %> - <p><img src="/images/icons/pending.png" alt="pending" /> This draft is <strong>not ready for sending.</strong></p> + <p><img src="/assets/icons/pending.png" alt="pending" /> This draft is <strong>not ready for sending.</strong></p> <% end %> <p> <span style="float: right; font-size: 90%;"><%= @glsa.created_at.to_s %></span> - Requester: <strong><%= h @glsa.requester.name %></strong> + Requester: <strong><%= @glsa.requester.name %></strong> </p> <% if @glsa.submitter %> <p> <span style="float: right; font-size: 90%;"><%= @glsa.updated_at.to_s %></span> - Submitter: <strong><%= h @glsa.submitter.name %></strong> + Submitter: <strong><%= @glsa.submitter.name %></strong> </p> <% end %> <p> <span style="float: right; font-size: 90%;"><%= @glsa.updated_at.to_s %></span> - Editor: <strong><%= h @glsa.last_revision.user.name %></strong> + Editor: <strong><%= @glsa.last_revision.user.name %></strong> </p> </div> <div class="box"> - <h2> - <span class="toolbar"> - <a href="/glsa/update_cache/<%= @glsa.id %>" title="Update all cached metadata"> - <img src="/images/icons/refresh.png" alt="Update all cached metadata" /> - </a> - </span> - <img src="/images/icons/bug.png" alt="bug" /> Bugs - </h2> + <%= box_title('Bugs', :icon => 'icons/bug.png', + :toolbar => [{:title => 'Update all cached metadata', :icon => 'icons/refresh.png', :uri => "/glsa/update_cache/#{@glsa.id}"}]) + %> <table id="bugtable"> <%= render :partial => "show_bug_row", :collection => @glsa.last_revision.bugs, :as => :bug %> </table> @@ -70,15 +65,15 @@ </p> <p> -<strong>Access:</strong> <%= h @rev.access %> <br /> -<strong>Product:</strong> <%= h @rev.product %> <br /> -<strong>Severity:</strong> <%= h @rev.severity %> <br /> -<strong>Synopsis:</strong> <%= h @rev.synopsis %> <br /> +<strong>Access:</strong> <%= @rev.access %> <br /> +<strong>Product:</strong> <%= @rev.product %> <br /> +<strong>Severity:</strong> <%= @rev.severity %> <br /> +<strong>Synopsis:</strong> <%= @rev.synopsis %> <br /> </p> <p><strong>Related bugs:</strong><br /> <% @rev.bugs.each do |b| %> - <%= link_to_function h(b.bug_id), "buginfo('#{h b.bug_id}')" %> + <%= link_to_function h(b.bug_id), "buginfo('#{b.bug_id}')" %> <% end %> </p> @@ -86,14 +81,14 @@ <strong>Unaffected Packages:</strong><br /> <ul> <% @rev.packages.each do |pkg| ; next unless pkg.my_type == "unaffected" %> - <li><%= h pkg.comp %><strong><%= h pkg.atom %></strong>-<%= h pkg.version %> on <%= h pkg.arch %> (auto: <%= pkg.automatic %>)</li> + <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li> <% end %> </ul> <strong>Vulnerable Packages:</strong><br /> <ul> <% @rev.packages.each do |pkg| ; next unless pkg.my_type == "vulnerable" %> - <li><%= h pkg.comp %><strong><%= h pkg.atom %></strong>-<%= h pkg.version %> on <%= h pkg.arch %> (auto: <%= pkg.automatic %>)</li> + <li><%= pkg.comp %><strong><%= pkg.atom %></strong>-<%= pkg.version %> on <%= pkg.arch %> (auto: <%= pkg.automatic %>)</li> <% end %> </ul> </p> @@ -111,7 +106,7 @@ </p> <p><strong>Workaround:</strong><br /> -<%= h @rev.workaround %></p> +<%= @rev.workaround %></p> <p><strong>Resolution:</strong><br /> <%= sanitize(@rev.resolution, :tags => %w[p ul li code]) %> </p> diff --git a/app/views/glsa/show.txt.erb b/app/views/glsa/show.txt.erb index 5ee06a9..3b74a76 100644 --- a/app/views/glsa/show.txt.erb +++ b/app/views/glsa/show.txt.erb @@ -1,6 +1,6 @@ <%- @packages = @rev.packages_by_atom @packages_count = 0 - @tf = Text::Format.new -%> + @tf = ::Text::Format.new -%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gentoo Linux Security Advisory GLSA <%= @glsa.glsa_id %> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/views/glsa/show.xml.erb b/app/views/glsa/show.xml.erb index ea03e5d..58ece79 100644 --- a/app/views/glsa/show.xml.erb +++ b/app/views/glsa/show.xml.erb @@ -1 +1 @@ -<%= Glsamaker::XML.indent(render(:partial => 'glsa', :locals => {:glsa => @glsa, :rev => @rev}), {:indent => 2, :maxcols => 80}) %> +<%= Glsamaker::XML.indent(render(:partial => 'glsa', :locals => {:glsa => @glsa, :rev => @rev}), {:indent => 2, :maxcols => 80}).html_safe %>
\ No newline at end of file |