extends /templates/base

block content

  if view.state === 'purchasing'
    p.text-center Purchasing...
    .progress.progress-striped.active
      .progress-bar(style="width: 100%")

  else if view.state === 'purchased'
    p Thank you for your purchase! You can now assign #{view.numberOfStudents} more students to paid courses.

    p.text-center
      if view.fromClassroom
        a(href="/courses/"+view.fromClassroom) Return to classroom
      else
        a(href="/courses/teachers") Return to course management.
      
  else

    h2.text-center Purchase Student Enrollments
    br

    if view.state === 'error'
      .alert.alert-danger= view.stateMessage

    p.text-center
      strong How many enrollments do you need?
    br

    p.text-center
      input#students-input(
        placeholder='<number of enrollments>'
        value=view.numberOfStudents
        type='number'
      )
    br

    .container-fluid
      .row
        .col-md-offset-3.col-md-6 One enrollment per student is required to assign them to paid CodeCombat courses.  A single student does not need multiple enrollments to access all paid courses.
    br

    p.text-center#price-form-group
      strong Total: #{view.numberOfStudents} enrollments x $#{view.pricePerStudent.toFixed(2)} = #{view.getPriceString()}

    p.text-center
      button#purchase-btn.btn.btn-lg.btn-success.uppercase Purchase Now

extends /templates/base

block content

  if view.state === 'purchasing'
    p.text-center Purchasing...
    .progress.progress-striped.active
      .progress-bar(style="width: 100%")

  else if view.state === 'purchased'
    p Thank you for your purchase! You can now assign #{view.numberOfStudents} more students to paid courses.

    p.text-center
      if view.fromClassroom
        a(href="/courses/"+view.fromClassroom) Return to classroom
      else
        a(href="/courses/teachers") Return to course management.
      
  else

    h2.text-center Purchase Student Enrollments
    br

    if view.state === 'error'
      .alert.alert-danger= view.stateMessage

    p.text-center
      strong How many additional paid enrollments do you need?
    br

    p.text-center
      input#students-input(
        placeholder='<number of enrollments>'
        value=view.numberOfStudents
        type='number'
      )
    br

    .container-fluid
      .row
        .col-md-offset-3.col-md-6 
          | Each student in a class will get access to Course 2 and up once they are enrolled in paid courses. 
          | You may assign each course to each student individually.
    br

    p.text-center#price-form-group
      strong Total: #{view.numberOfStudents} enrollments x $#{view.pricePerStudent.toFixed(2)} = #{view.getPriceString()}

    p.text-center
      button#purchase-btn.btn.btn-lg.btn-success.uppercase Purchase Now

Update enrollment terminology in PurchaseCoursesView
Update enrollment terminology in PurchaseCoursesView
