 
     input_access_el    = $('#repository_access')[0]
     source_address_el  = $('#repository_source_address')
+    remote_type_els    = $('input[name="repository[remote_type]"]')
+    remote_type_mirror_el = $('#repository_remote_type_mirror')
+
     options_non_mirror = _.clone($('#access_options_non_mirror')[0].options)
     options_mirror     = _.clone($('#access_options_mirror')[0].options)
 

    change_options()
    change_type_display()

    source_address_el.on('input', change_options)
    source_address_el.on('input', change_type_display)
    source_address_el.on('input', reset_was_source_address_set)
  return

      else
        set_options(options_non_mirror, to_non_mirror_option, last_value)

    is_mirror_selected = () ->
      remote_type_mirror_el.is(':checked')

    is_source_address_set = () ->
      source_address_el.val().trim().length > 0

    was_mirror_selected = is_mirror_selected()

    was_source_address_set = is_source_address_set()

    reset_mirror_selected = () ->
      was_mirror_selected = is_mirror_selected()

    reset_was_source_address_set = () ->
      was_source_address_set = is_source_address_set()

    change_options = (event) ->
      if !was_mirror_selected && is_mirror_selected()
        modify_access_list 'mirror'
      else if was_mirror_selected && !is_mirror_selected()
        modify_access_list 'non_mirror'
      else if !was_mirror_selected && !is_mirror_selected()
        modify_access_list 'non_mirror'

    change_type_display = (event) ->
