Revision 4d8b2799
Added by Ohad Levy over 12 years ago
- ID 4d8b27996f4ba9a0b879295c48aac876e58038ce
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
refs #1201 - adds the ability not to import all subnets
TODO: redo this at some point with checkboxes