{% extends 'TopxiaWebBundle:My:layout.html.twig' %}

{% block title %}我的课程 - {{ parent() }}{% endblock %}

{% set side_nav = 'my-notes' %}
{% set script_controller = 'my/notebooks' %}

{% block main %}

<div class="panel panel-default panel-col">
  <div class="panel-heading">我的笔记</div>
  <div class="panel-body">
    <ul class="media-list notebook-list" id="notebook-list">
      {% for member in courseMembers %}
        {% set course = courses[member.courseId] %}
              <div class="media">
                <img class="pull-left media-object" src="{{ filepath(course.largePicture, 'course.png') }}">
                <div class="media-body">
                  <h4 class="media-heading">{{course.title}}</h4>
                  <div class="notebook-metas">
                    <span class="notebook-number">共 {{ member.noteNum }} 篇笔记</span>
                  </div>
                  <div class="notebook-metas">
                    {% if member.noteLastUpdateTime > 0 %}
                      <span class="notebook-time">最后更新 {{ member.noteLastUpdateTime | smart_time }}</span>
                    {% endif %}
                    <a class="pull-right notebook-go" href="{{ path('my_notebook_show', {courseId: course.id }) }}">查看笔记</a>
                  </div>
                </div>
              </div>
      {% else %}
        <li class="empty">你还没有写过笔记</li>
      {% endfor %}
    </ul>
    {{ web_macro.paginator(paginator) }} 
  </div>
</div>
{% endblock %}