$newline never
#{csrf}
^{fvInput prevAllocView}

<h2>
  _{MsgComputedAllocation}
  
<dl .deflist>
  <dt .deflist__dt>
    _{MsgAllocationUsersCount}
  <dd .deflist__dd>
    #{olength allocationUsers}
  <dt .deflist__dt>
    _{MsgAllocationCoursesCount}
  <dd .deflist__dd>
    #{olength allocationCourses}
  <dt .deflist__dt>
    _{MsgAllocationRequestedPlaces}
  <dd .deflist__dd>
    #{allocationPlacesRequested}
  <dt .deflist__dt>
    _{MsgAllocationOfferedPlaces}
  <dd .deflist__dd>
    #{allocationCapacity}
  <dt .deflist__dt>
    _{MsgAllocationTime}
  <dd .deflist__dd>
    ^{formatTimeW SelFormatDateTime allocTime}
  <dt .deflist__dt>
    _{MsgAllocationUnmatchedUsers}
  <dd .deflist__dd>
    #{unmatchedUsers}
  <dt .deflist__dt>
    _{MsgAllocationUnmatchedCourses}
  <dd .deflist__dd>
    #{unmatchedCourses}
  
<div .scrolltable .scrolltable--bordered>
  <table .table .table--striped .table--hover>
    <thead>
      <tr .table__row .table__row--head>
        $if showTerms
          <th .table__th>
            _{MsgTableTerm}
        $if showSchools
          <th .table__th>
            _{MsgTableSchool}
        <th .table__th>
          _{MsgTableCourse}
        $if eligibleCourses /= allocCourses
          <th .table__th>
            _{MsgAllocationCourseEligible}
        <th .table__th>
          _{MsgCourseCapacity}
        <th .table__th>
          _{MsgCourseAllocationMinCapacity}
        <th .table__th>
          _{MsgTableCourseMembers}
        <th .table__th>
          _{MsgAllocationMatchedUsers}
    <tbody>
      $forall ((Entity _ AllocationCourse{allocationCourseMinCapacity}, Entity cid Course{courseTerm, courseSchool, courseName, courseCapacity, courseShorthand}, participants), allocated) <- allocationCourses'
        <tr .table__row :member cid matchingLogRunCoursesExcluded:.allocation-course--excluded>
          $if showTerms
            <td .table__td>
              <div .table__td-content>
                <a href=@{TermCourseListR courseTerm}>
                  _{ShortTermIdentifier (unTermKey courseTerm)}
          $if showSchools
            <td .table__td>
              <div .table__td-content>
                <a href=@{TermSchoolCourseListR courseTerm courseSchool}>
                  #{courseSchool}
          <td .table__td>
            <div .table__td-content>
              <a href=@{CourseR courseTerm courseSchool courseShorthand CShowR}>
                #{courseName}
          $if eligibleCourses /= allocCourses
            <td .table__td>
              #{hasTickmark $ Set.member cid eligibleCourses}
          <td .table__td>
            <div .table__td-content>
              $maybe capN <- courseCapacity
                #{capN}
          <td .table__td>
            <div .table__td-content>
              $if allocationCourseMinCapacity > 1
                #{allocationCourseMinCapacity}
          <td .table__td>
            <div .table__td-content>
              #{participants}
          $maybe capN <- courseCapacity
            <td .table__td .dual-heated :degenerateHeat capN:.degenerate style="--hotness: #{allocHeat capN (allocated + participants)}">
              <div .table__td-content>
                #{allocated}
          $nothing
            <td .table__td>
              <div .table__td-content>
                #{allocated}
            
