{% extends 'layouts/base.html' %}
{% load i18n %}
{% load static %}

{% block content %}
  {% include 'header.html' with breadcrumb_list=breadcrumb_list %}
  <main id="main-content">
    <section>
      <div>
        <h1>Failure mode effects</h1>
        {% if object_list %}
          <div class="vertical-scroll">
            <table>
              <caption>{% translate 'Failure mode effects tabel:' %}</caption>
              <thead>
                <tr>
                  <th>{% translate 'Failure mode effect' %}</th> 
                  <th>{% translate 'Severity level' %}</th>
                  <th>{% translate 'Edit' %}</th>                       
                </tr>
              </thead>
              <tbody>
                {% for object in object_list %}                      
                  <tr>
                    <td><a href="{{ object.get_absolute_url }}">{{ object.effect}}</a></td>
                    <td>{{ object.get_severity_level_display }}</td>
                    <td><a href="{{ object.get_update_url }}">Edit</a></td>
                  </tr>
                {% endfor %}      
              </tbody>
            </table>
          </div>
          {% include 'partials/pagination.html' %}
        {% else %}
          <p>{% translate 'No failure mode effect yet defined.' %}</p>
          <a class="button" href="{% url 'fmea_failure_mode_effect_create' %}">{% translate 'Create a failure mode effect' %}</a>
        {% endif %}
      </div>
    </section>
  </main>
{% endblock %}
