     already_existed = true
     unless $("#enrollment_" + enrollment.id).length
       already_existed = false
-      $enrollment = $enrollment_blank.clone(true).fillTemplateData(
+      $enrollment = UL.$enrollment_blank.clone(true).fillTemplateData(
         textValues: [ "name", "membership_type", "email", "enrollment_id" ]
         id: "enrollment_" + enrollment.id
         hrefValues: [ "id", "user_id", "pseudonym_id", "communication_channel_id" ]


I18n = useI18nScope('user_lists')

$user_lists_processed_person_template = $("#user_lists_processed_person_template").removeAttr("id").detach()
$user_list_no_valid_users = $("#user_list_no_valid_users")
$user_list_with_errors = $("#user_list_with_errors")
$user_lists_processed_people = $("#user_lists_processed_people")
$user_list_duplicates_found = $("#user_list_duplicates_found")
$form = $("#enroll_users_form")
$enrollment_blank = $("#enrollment_blank").removeAttr("id").hide()
user_lists_path = $("#user_lists_path").attr("href")

UL = INST.UserLists =
  init: ->
    UL.showTextarea()

    $form.find(".cancel_button").click(->
      $(".add_users_link").show()
      $form.hide()
    ).end().find(".go_back_button").click(UL.showTextarea).end().find(".verify_syntax_button").click((e) ->
      e.preventDefault()
      UL.showProcessing()
      $.ajaxJSON user_lists_path, "POST", $form.getFormData(), UL.showResults
    ).end().submit (event) ->
      event.preventDefault()
      event.stopPropagation()
      $form.find(".add_users_button").text(I18n.t("adding_users", "Adding Users...")).attr "disabled", true
      $.ajaxJSON $form.attr("action"), "POST", $form.getFormData(), UL.success, UL.failure

    $form.find("#enrollment_type").change(->
      $("#limit_privileges_to_course_section_holder").showIf $(this).find(':selected').data("isAdmin")?
    ).change()


              UL.updateCounts()

  success: (enrollments) ->
    UL.$form.find(".user_list").val ""
    UL.showTextarea()
    return false  if not enrollments or not enrollments.length
    already_existed = 0
