Project

General

Profile

Feature #300 ยป 0001-Add-icon-hints-to-class-add-remove.patch

Frank Sweetser, 06/02/2010 07:01 PM

View differences:

app/helpers/application_helper.rb
end
def link_to_remove_puppetclass klass
link_to_function klass.name do |page|
link_to_function image_tag("delete.png") + " " + klass.name do |page|
page["selected_puppetclass_#{klass.id}"].remove
#TODO if the class is already selected, removing it will not add it to the avail class list
page << "if ($('puppetclass_#{klass.id}')) {"
......
def link_to_add_puppetclass klass, type
# link to remote is faster than inline js when having many classes
link_to_remote klass.klass,
link_to_remote "&nbsp;&nbsp;&nbsp;" + image_tag("add.png") + " " + klass.klass,
:url => assign_puppetclass_path(klass, :type => type),
:position => {:after => {:success => "selected_classes" }}
end
app/views/puppetclasses/_classes.html.erb
<td id="classes">
<% group.each do |list| -%>
<% next if list.nil? %>
<li title="Click to expand module class list"><%= link_to_function list.first, toggle_div(list.first) %></li>
<li title="Click to expand module class list"><%= link_to_function image_tag("application_cascade.png") + " " + list.first, toggle_div(list.first) %></li>
<div id=<%= list.first %> style="display: none;">
<% for klass in list.last.sort -%>
<% content_tag_for :div, klass, :title => "Click to add #{klass}" do %>
    (1-1/1)