{% extends 'TopxiaWebBundle::bootstrap-clear-modal-layout.html.twig' %}

{% set modalClass = 'modal-dialog-medium' %}
{% block body %}

<div class="row teacher-profile-card">
  <div class="col-md-4">
    <img class="img-responsive" src="{{ default_path('avatar',user.largeAvatar, 'large') }}">
    {% if user.id != app.user.id %}
      <div class="actions">
        <button class="btn btn-primary btn-sm btn-block follow-btn" data-url="{{ path('user_follow', {id:user.id}) }}" {% if isFollowing %} style="display:none;"{% endif %}>关注</button>
        <button class="btn btn-primary btn-sm btn-block unfollow-btn" data-url="{{ path('user_unfollow', {id:user.id}) }}" {% if not isFollowing %} style="display:none;"{% endif %}>已关注</button>
        <button class="btn btn-default btn-sm btn-block" data-url="{{path('message_create', {toId:user.id})}}" id="message_to_teacher">发私信</button>
      </div>
    {% else %}

    {% endif %}
  </div>

  <div class="col-md-8">
    <h4>{{ user.truename }}</h4>
    <div class="text-muted">{{ user.title }}</div>

    <div class="mbl">
      {% if profile %}
        {{ profile.about|raw }}
      {% endif %}
    </div>

    <p>
      
      {% if profile %}
        {% if profile.weibo %}
          <a href="{{ profile.weibo }}" target="_blank" class="mrm"><img src="{{ asset('assets/img/user/link-weibo.png') }}"> 微博</a>
        {% endif %}
        {% if profile.site %}
          <a href="{{ profile.site }}" target="_blank" class="mrm"><img src="{{ asset('assets/img/user/link-site.png') }}"> 网站</a>
        {% endif %}
      {% endif %}
    </p>
  </div>

</div>

<script>
    app.load('course/teacher-info-modal');
</script>
{% endblock %}