{% extends 'base.html' %}
{% load i18n %}
{% load staticfiles %}
{% load compress %}

{% block title %}
  {% trans "Revision History" %}
{% endblock title %}

{% block content %}
  <div class="parent-course-history" xmlns="http://www.w3.org/1999/html">
    <div class="title">{% trans "Revision History" %}</div>

    <div>
      <p class="changed-by">
        {% with date=history_object.history_date|date:"d-m-Y" name=history_object.history_user.full_name %}
          {% blocktrans trimmed %}
            {{ date }} by {{ name }}
          {% endblocktrans %}
        {% endwith %}
        <button class="btn-show-changes show">{% trans "Show changes" %}</button>
      </p>
    </div>

    <div>
      <hr class="hr-line"/>
    </div>
    <div class="clearfix"></div>

    <div class="field-container">
      <div class="field-title">{% trans "Course Title" %}</div>
      <span class="object">{{ object.title }}</span>
      <span class="history-object">{{ history_object.title }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Course Number" %}</div>
      <span class="object">{{ object.number }}</span>
      <span class="history-object">{{ history_object.number }}</span>
      <span class="show-diff"></span>
    </div>


    <div class="field-container">
      <div class="field-title">{% trans "Brief Description" %}</div>
      <span class="object">{{ object.short_description }}</span>
      <span class="history-object">{{ history_object.short_description }}</span>
      <span class="show-diff"></span>
    </div>


    <div class="field-container">
      <div class="field-title">{% trans "Full Description" %}</div>
      <span class="object">{{ object.full_description }}</span>
      <span class="history-object">{{ history_object.full_description }}</span>
      <span class="show-diff"></span>

    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Expected Learnings" %}</div>
      <span class="object">{{ object.expected_learnings }}</span>
      <span class="history-object">{{ history_object.expected_learnings }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Primary Subject" %}</div>
      <span class="object">{{ object.primary_subject }}</span>
      <span class="history-object">{{ history_object.primary_subject }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Secondary Subject" %}</div>
      <span class="object">{{ object.secondary_subject }}</span>
      <span class="history-object">{{ history_object.secondary_subject }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Tertiary Subject" %}</div>
      <span class="object">{{ object.tertiary_subject }}</span>
      <span class="history-object">{{ history_object.tertiary_subject }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Prerequisites" %}</div>
      <span class="object">{{ object.prerequisites }}</span>
      <span class="history-object">{{ history_object.prerequisites }}</span>
      <span class="show-diff"></span>
    </div>

    <div class="field-container">
      <div class="field-title">{% trans "Course Level" %}</div>
      <span class="object">{{ object.level_type }}</span>
      <span class="history-object">{{ history_object.level_type }}</span>
      <span class="show-diff"></span>
    </div>
  </div>

{% endblock %}

{% block js %}
  {{ block.super }}
    {% compress js %}
        <script src="{% static 'bower_components/jquery/dist/jquery.js' %}"></script>
        <script src="{% static 'bower_components/google-diff-match-patch/diff_match_patch.js' %}"></script>
        <script src="{% static 'js/publisher/comparing-objects.js' %}"></script>
    {% endcompress %}
{% endblock %}
