{% extends "base_dashboard.html" %}
{% load i18n %}
{% load staticfiles %}
{% load dashboard_extras %}
{% load firstof from future %}

{% block view-name %}view-course-list{% endblock view-name %}

{% block title %}{% trans "Courses" %} {{ block.super }}{% endblock title %}

{% block header-text %}
  <h3>
    {% blocktrans with username=request.user.username %}Welcome, {{ username }}!{% endblocktrans %}
  </h3>
{% endblock %}

{% block intro-text %}
  {% blocktrans %}Here are the courses you currently have access to in {{ application_name }}:{% endblocktrans %}
{% endblock intro-text %}

{% block content %}
  <div class="row">
    <div class="col-md-8">
      <div class="course-list">
        {% for course in courses %}
          <div class="course">
            <a href="{% url 'courses:home' course_id=course.key %}">
              <span class="course-name">{% firstof course.name course.key|format_course_key %}</span>
            </a>

            {% if course.name %}
              <div class="course-key">{{ course.key|format_course_key:" / " }}</div>
            {% endif %}
          </div>
        {% endfor %}
      </div>
    </div>

    <div class="col-md-4">
      <div class="help-msg">
        <h4>{% blocktrans %}New to {{ application_name }}?{% endblocktrans %}</h4>

        {% captureas email_link %}
          <a class="feedback-email" href="mailto:{{ feedback_email }}?Subject=Feedback">
            {{ feedback_email }}</a>{% endcaptureas %}

        <p class="info-text">{% blocktrans trimmed %} Click Help in the upper-right corner to get more information
          about {{ application_name }}. Send us feedback at {{ email_link }}.{% endblocktrans %}</p>
      </div>
    </div>
  </div>
{% endblock %}
