{% extends "base.html" %}

{% block title %}
  {{ object.title }}
{% endblock %}

{% block content %}
  {% with subject=course.subject %}
    <h1>
      {{ object.title }}
    </h1>
    <div class="module">
      <h2>Ogólny opis kursu</h2>
      <p>
        <a href="{% url "course_list_subject" subject.slug %}">
        {{ subject.title }}</a>.
        {{ object.modules.count }} modułów.
        Instruktor: {{ object.owner.get_full_name }}
      </p>
      {{ object.overview|linebreaks }}
        {% if request.user.is_authenticated %}
        <form action="{% url "student_enroll_course" %}" method="post">
            {{ enroll_form }}
            {% csrf_token %}
            <input type="submit" value="Zapisz się">
        </form>
        {% else %}
        <a href="{% url "student_registration" %}" class="button">
            Zarejestruj się, aby zostać uczestnikiem kursu
        </a>
        {% endif %}
    </div>
  {% endwith %}
{% endblock %}
