diff options
author | Max Magorsch <arzano@gentoo.org> | 2021-09-20 22:46:12 +0000 |
---|---|---|
committer | Max Magorsch <arzano@gentoo.org> | 2021-09-20 22:46:12 +0000 |
commit | 676bf267f0f87f36192d3f1144fe3220f22e48e2 (patch) | |
tree | de3ee5da5ed0e014af4ec31fa189e9bba6105042 | |
parent | Display version and last update in the footer (diff) | |
download | glsamaker-676bf267f0f87f36192d3f1144fe3220f22e48e2.tar.gz glsamaker-676bf267f0f87f36192d3f1144fe3220f22e48e2.tar.bz2 glsamaker-676bf267f0f87f36192d3f1144fe3220f22e48e2.zip |
Replace link_to_function by link_to2.1.19
Signed-off-by: Max Magorsch <arzano@gentoo.org>
-rw-r--r-- | app/helpers/application_helper.rb | 5 | ||||
-rw-r--r-- | app/helpers/bug_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/glsa_helper.rb | 12 | ||||
-rw-r--r-- | app/views/glsa/_comment.html.erb | 4 | ||||
-rw-r--r-- | app/views/glsa/_edit_bug_row.html.erb | 5 | ||||
-rw-r--r-- | app/views/glsa/_glsa_row.html.erb | 2 | ||||
-rw-r--r-- | app/views/glsa/_package.html.erb | 7 | ||||
-rw-r--r-- | app/views/glsa/_reference.html.erb | 5 | ||||
-rw-r--r-- | app/views/glsa/show.html.erb | 2 | ||||
-rw-r--r-- | app/views/layouts/application.html.erb | 2 | ||||
-rw-r--r-- | app/views/search/_cve_row.html.erb | 2 | ||||
-rw-r--r-- | app/views/tools/ajaxbugs.html.erb | 2 |
12 files changed, 28 insertions, 22 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 68194e7..e6022e1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -120,9 +120,10 @@ module ApplicationHelper span_content << image_tag('separator.png') else if toolbar_item[:uri].start_with? 'javascript:' - span_content << link_to_function( + span_content << link_to( image_tag(toolbar_item[:icon]), - toolbar_item[:uri].gsub(/^javascript:/, ''), + nil, + :onclick => toolbar_item[:uri].gsub(/^javascript:/, ''), :title => toolbar_item[:title] ) << ' ' else diff --git a/app/helpers/bug_helper.rb b/app/helpers/bug_helper.rb index afe37be..94c4fd7 100644 --- a/app/helpers/bug_helper.rb +++ b/app/helpers/bug_helper.rb @@ -3,6 +3,6 @@ module BugHelper # Creates links around common phrases like <tt>Bug 12345</tt> or <tt>Comment 234</tt> def linkify_comment(text) - text.gsub(/bug (\d+)/i, link_to_function('bug \1', 'buginfo(\1);')) + text.gsub(/bug (\d+)/i, link_to('bug \1', nil, :onclick => 'buginfo(\1);')) end end diff --git a/app/helpers/glsa_helper.rb b/app/helpers/glsa_helper.rb index 7770227..fad9321 100644 --- a/app/helpers/glsa_helper.rb +++ b/app/helpers/glsa_helper.rb @@ -21,21 +21,23 @@ module GlsaHelper end def add_vulnerable_package_link(name) - link_to_function( + link_to( name, - "Element.insert('packages_table_vulnerable', { bottom: '#{escape_javascript(render(:partial => '/glsa/package', :object => Package.new(:comp => "<", :slot => "*", :arch => "*", :my_type => "vulnerable")))}' })", + nil, + :onclick => "Element.insert('packages_table_vulnerable', { bottom: '#{escape_javascript(render(:partial => '/glsa/package', :object => Package.new(:comp => "<", :slot => "*", :arch => "*", :my_type => "vulnerable")))}' })", :title => 'Add package') end def add_unaffected_package_link(name) - link_to_function( + link_to( name, - "Element.insert('packages_table_unaffected', { bottom: '#{escape_javascript(render(:partial => '/glsa/package', :object => Package.new(:comp => ">=", :slot => "*", :arch => "*", :my_type => "unaffected")))}' })", + nil, + :onclick => "Element.insert('packages_table_unaffected', { bottom: '#{escape_javascript(render(:partial => '/glsa/package', :object => Package.new(:comp => ">=", :slot => "*", :arch => "*", :my_type => "unaffected")))}' })", :title => 'Add package') end def add_reference_link(name) - link_to_function name, :title => "Add reference" do |page| + link_to name, nil, :title => "Add reference" do |page| page.insert_html :bottom, :references_table, :partial => 'reference', :object => Reference.new end end diff --git a/app/views/glsa/_comment.html.erb b/app/views/glsa/_comment.html.erb index 059f4a0..20151bc 100644 --- a/app/views/glsa/_comment.html.erb +++ b/app/views/glsa/_comment.html.erb @@ -1,8 +1,8 @@ <li class="comment <%= @css_class || cycle("odd-bright", "") %>"> <input type="hidden" name="commentread-<%= comment.id %>" id="commentread-<%= comment.id %>" value="<%= comment.read ? "true" : "false" %>" /> <span class="comment-toolbox"> - <%= link_to_function(comment.read ? image_tag("icons/flag-green.png", :title => 'done') : image_tag("icons/flag.png", :title => 'todo'), - "toggleCommentRead(#{comment.id})", + <%= link_to(comment.read ? image_tag("icons/flag-green.png", :title => 'done') : image_tag("icons/flag.png", :title => 'todo'), nil, + :onclick => "toggleCommentRead(#{comment.id})", :title => 'Toggle read status', :id => "commentflag-#{comment.id}") %> </span> diff --git a/app/views/glsa/_edit_bug_row.html.erb b/app/views/glsa/_edit_bug_row.html.erb index 4fcee0e..2ef5750 100644 --- a/app/views/glsa/_edit_bug_row.html.erb +++ b/app/views/glsa/_edit_bug_row.html.erb @@ -5,9 +5,10 @@ <a href="javascript:///" onclick="buginfo(<%= bug.bug_id %>);"><strong><%= bug.bug_id %></strong></a> <small><a href="<%= bug.bug_url %>">[BZ]</a></small></td> <td><%= truncate(bug.title, :length => 60) %></td> <td> - <%= link_to_function( + <%= link_to( image_tag('icons/minus.png', :alt => 'Mark as deleted'), - "GLSAMaker.editing.bugs.del(#{bug.bug_id});" + nil, + :onclick => "GLSAMaker.editing.bugs.del(#{bug.bug_id});" ) %> </td> </tr> diff --git a/app/views/glsa/_glsa_row.html.erb b/app/views/glsa/_glsa_row.html.erb index 5c12adf..ee3710e 100644 --- a/app/views/glsa/_glsa_row.html.erb +++ b/app/views/glsa/_glsa_row.html.erb @@ -19,7 +19,7 @@ <% end %> <!--<td> <% if glsa.last_revision; glsa.last_revision.bugs.each do |b| %> - <%= link_to_function b.bug_id, "buginfo('#{b.bug_id}')" %> + <%= link_to b.bug_id, nil, :onclick => "buginfo('#{b.bug_id}')" %> <% end ; end %> </td>--> <% if current_user.is_el_jefe? %> diff --git a/app/views/glsa/_package.html.erb b/app/views/glsa/_package.html.erb index 5e3d115..3a040b6 100644 --- a/app/views/glsa/_package.html.erb +++ b/app/views/glsa/_package.html.erb @@ -7,9 +7,10 @@ <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( - image_tag('icons/package-remove.png', :alt => 'Remove package'), - "GLSAMaker.editing.packages.del(this)", + <td><%= link_to( + image_tag('icons/package-remove.png', :alt => 'Remove package'), + nil, + :onclick => "GLSAMaker.editing.packages.del(this)", :title => 'Remove package') %> <%= pf.hidden_field :my_type, :index => nil %></td> <% end %> diff --git a/app/views/glsa/_reference.html.erb b/app/views/glsa/_reference.html.erb index 8726060..4a9c206 100644 --- a/app/views/glsa/_reference.html.erb +++ b/app/views/glsa/_reference.html.erb @@ -2,9 +2,10 @@ <%= fields_for "glsa[reference][]", reference do |rf| %> <td><%= rf.text_field :title, :class => :nice, :size => 18, :index => nil %></td> <td><%= rf.text_field :url, :class => :nice, :index => nil %></td> - <td><%= link_to_function( + <td><%= link_to( image_tag('icons/reference-remove.png', :alt => 'Remove reference'), - "GLSAMaker.editing.references.del(this)", + nil, + :onclick => "GLSAMaker.editing.references.del(this)", :title => 'Remove reference') %></td> <% end %> </tr> diff --git a/app/views/glsa/show.html.erb b/app/views/glsa/show.html.erb index 1da1a94..61d0a64 100644 --- a/app/views/glsa/show.html.erb +++ b/app/views/glsa/show.html.erb @@ -13,7 +13,7 @@ <%= link_to "#{image_tag 'icons/edit.png'} Edit this draft".html_safe, edit_glsa_path(@glsa), {:class => 'button'} %> <%= link_to "#{image_tag 'icons/xml.png'} View as XML".html_safe, glsa_path(@glsa, :format => 'xml'), {:class => 'button'} %> <%= link_to "#{image_tag 'icons/txt.png'} View as Text".html_safe, glsa_path(@glsa, :format => 'txt'), {:class => 'button'} %> - <%= link_to_function "#{image_tag 'icons/reference.png'} Import references".html_safe, "GLSAMaker.editing.references.import_dialog(#{@glsa.id})", {:class => 'button'} %> + <%= link_to "#{image_tag 'icons/reference.png'} Import references".html_safe, nil, :onclick => "GLSAMaker.editing.references.import_dialog(#{@glsa.id})", {:class => 'button'} %> <%= link_to "#{image_tag 'icons/diff.png'} Compare revisions".html_safe, diff_glsa_path(@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, prepare_release_glsa_path(@glsa), {:class => 'button'} if current_user.access >= 2 %> <%= link_to "#{image_tag 'icons/delete.png'} Delete".html_safe, glsa_path(@glsa), :method => :delete, :confirm => "Do you really want to delete this item?", :class => 'button' if current_user.is_el_jefe? %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 4120f34..9ba46fc 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -70,7 +70,7 @@ <%- if flash[:notice] or flash[:error] -%> <div id="flash" class="<%= flash[:error] ? "error" : "notice" %>"> - <%= link_to_function(image_tag('icons/close.png'), {:style => 'float: right;', :alt => 'Hide the notification'}) do |page| + <%= link_to(image_tag('icons/close.png'), nil, :style => 'float: right;', :alt => 'Hide the notification') do |page| page[:flash].drop_out end %> <%- if flash[:error] -%> diff --git a/app/views/search/_cve_row.html.erb b/app/views/search/_cve_row.html.erb index 71a5eee..bbb3718 100644 --- a/app/views/search/_cve_row.html.erb +++ b/app/views/search/_cve_row.html.erb @@ -1,5 +1,5 @@ <tr> - <td class="nowrap"><%= link_to_function cve.colorize(:cve_id).html_safe, "cvepopup('#{cve.cve_id}')" %></td> + <td class="nowrap"><%= link_to cve.colorize(:cve_id).html_safe, nil, :onclick => "cvepopup('#{cve.cve_id}')" %></td> <td><%= cve.state %></td> <td><%= sanitize(cve.excerpts.summary, :tags => %w[span], :attributes => %w[class]) %></td> <td><%= cve.cvss %></td> diff --git a/app/views/tools/ajaxbugs.html.erb b/app/views/tools/ajaxbugs.html.erb index 493c4d9..9f5443f 100644 --- a/app/views/tools/ajaxbugs.html.erb +++ b/app/views/tools/ajaxbugs.html.erb @@ -3,7 +3,7 @@ <% if bug.is_a?(String) %> <li class="ajaxbugs-error"><%= bug %></li> <% else %> - <li><%= link_to_function bug.bug_id, "buginfo('#{bug.bug_id}')" %>: + <li><%= link_to bug.bug_id, nil, :onclick => "buginfo('#{bug.bug_id}')" %>: <%= truncate(bug.summary, :length => 50) %></li> <% end %> <% end %> |