{% 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>,
                {{ course.modules.count }} moduł{{ course.modules.count|pluralize:"y" }},
                instruktor: {{ course.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" class="button" value="Zapisz się">
              </form>
            {% else %}
              <a href="{% url "student_registration" %}" class="button">
                  Zarejestruj się, aby zostać uczestnikiem kursu
              </a>
            {% endif %}
        </div>
    {% endwith %}
{% endblock %}