{% import "macro.html.twig" as web_macro %}
<tr id="student-{{user.id}}-tr" class="students-item js-students-item">
  <td class="media media-middle" >
    <a class="pull-left js-user-card" href="/user/{{student.userId}}" data-card-url="/user/{{student.userId}}/card/show" data-user-id="{{student.userId}}">
      {{ web_macro.user_avatar(user, 'pull-left', 'avatar-sm') }}
    </a>
    <a target="_blank" href="/user/{{student.userId}}">{{ user.nickname }}</a>

    {% if student.remark %}
      <span class="color-gray text-sm" title="{{student.remark}}">({{ student.remark|plain_text(16) }})</span>
    {% endif %}
    <div class="color-gray text-sm">{{'course_manage.student.created_time'|trans({'%createdTime%': student.createdTime|date('Y-n-d H:i') })}}</div>
    {% if course.expiryDays > 0 and student.deadline > 0 %}
      <div class="color-gray text-sm">{{'course_manage.student.deadline'|trans({'%deadline%': student.deadline|date('Y-n-d H:i') })}} ({{ student.deadline|remain_time }})</div>
    {% endif %}
  </td>
  <td>
    {{ progress.percent|default(0)}}<a class="" href="javascript:;"  data-toggle="modal" data-target="#modal" data-url="{{path('course_set_manage_course_students_process', {'courseSetId': courseSet.id, 'courseId': course.id, 'userId': student.userId})}}">{{ 'course_manage.student.views_detail_btn'|trans }}</a>
  </td>
  <td>
    <a class="mrm link-primary" href="javascript:;" data-toggle="modal" data-target="#modal" data-url="/message/create/{{student.userId}}">{{'course_manage.student.send_message_btn'|trans}}</a>
    {% if app.user.isAdmin() %}
      <a class="mrm link-primary" href="javascript:;"  data-toggle="modal" data-target="#modal" data-url="{{path('course_set_manage_course_students_show', {'courseSetId': courseSet.id, 'courseId': course.id, 'userId': student.userId})}}">{{'course_manage.student.view_material_btn'|trans}}</a>
    {% elseif setting("course.buy_fill_userinfo") %}
      <a class="mrm link-primary" href="javascript:;"  data-toggle="modal" data-target="#modal" data-url="{{path('course_set_manage_course_students_defined_show', {'courseSetId': courseSet.id, 'courseId': course.id, 'userId': student.userId})}}">{{'course_manage.student.view_material_btn'|trans}}</a>
    {% endif %}
    <div class="btn-group vertical-top">
      <a href="#" class="mrm link-primary dropdown-toggle" data-toggle="dropdown">
        {{'site.default.more'|trans}}
        <span class="caret mls"></span>
      </a>
      <ul class="dropdown-menu pull-right">
        <li>
          <a class="" href="" data-toggle="modal" data-target="#modal" data-url="{{path('course_set_manage_course_students_remark', {courseSetId: courseSet.id, courseId: course.id, userId: student.userId})}}">{{'course_manage.student.remark_btn'|trans}}</a>
        </li>
        <li>
          <a class="unfollow-student-btn" href="javascript:;" data-url="{{path('user_unfollow', {id : student.userId})}}" {% if not followings[student.userId]|default(null) %} style="display: none;"{% endif %}>{{'course_manage.student.unfollow_btn'|trans}}</a>
          <a class="follow-student-btn" href="javascript:;" data-url="{{path('user_follow', {id : student.userId})}}" {% if followings[student.userId]|default(null) %} style="display: none;"{% endif %}>{{'course_manage.student.follow_btn'|trans}}</a>
        </li>
        {% if app.user.isAdmin() or  app.user.isTeacher() and course.expiryDays > 0 %}
          <li>
            <a class="" href="" data-toggle="modal" data-target="#modal" data-url="{{path('course_set_manage_course_students_expiryday', {courseSetId: course.courseSetId, courseId: course.id, userId: student.userId})}}">{{'course_manage.student.expiryday_btn'|trans}}</a>
          </li>
        {% endif %}
        {% if app.user.isAdmin() or setting('course.teacher_manage_student', 0) %}
          <li>
            <a class="js-remove-student" href="javascript:;" data-url="{{path('course_set_manage_course_students_remove', {courseSetId: courseSet.id, courseId: course.id, userId: student.userId})}}" data-user="{{'site.default.student'|trans}}">{{'course_manage.student.remove_btn'|trans}}</a>
          </li>
        {% endif %}

      </ul>
    </div>
  </td>
</tr>