Project

General

Profile

« Previous | Next » 

Revision 4d8b2799

Added by Ohad Levy over 12 years ago

  • ID 4d8b27996f4ba9a0b879295c48aac876e58038ce

refs #1201 - adds the ability not to import all subnets

TODO: redo this at some point with checkboxes

View differences:

app/helpers/subnets_helper.rb
module SubnetsHelper
# expand or minimize the subnet when importing
def minimal? subnets
subnets.each {|s| return false unless s.errors.empty?}
subnets.count > 1
end
# which options should be shown when importing subnets
def options subnets
minimal?(subnets) ? "#{edit} or #{ignore}" : ignore
end
def ignore
link_to_function "ignore", "$(this).closest('.imported_subnet').remove()"
end
def edit
link_to_function "review", "$(this).parent().parent().children('.subnet_fields').show()"
end
end

Also available in: Unified diff