{% extends edc_listboard_template %}
{% load i18n %}

{% load edc_dashboard_extras %}
{% load edc_adverse_event_extras %}

{% load tz %}
{% load static %}
{% load l10n %}

{% block listboard_panel_back %}
<a class="btn btn-default btn-sm btn-primary clearfix" role="button" href="{% url listboard_back_url|default:'listboard_back_url' %}"><i class="fas fa-reply"></i></a>
{% endblock listboard_panel_back %}


{% block listboard_table_header %}

    <!-- begin results header -->
    <th>#</th>
    <th></th>
    <th>Subject</th>
    <th>Report</th>
    <th>AE Reports</th>
    <th>Created</th>
    <th>Modified</th>
    <!-- end results header -->

{% endblock listboard_table_header %}

{% block listboard_table_button_column %}{% endblock %}

{% block listboard_table_columns %}

    <td nowrap>
        <a title="Edit Death Report" href="{%if result.death_report.href %}{{ result.death_report.href }}{% else %}#{% endif %}" {%if not result.death_report.href %} disabled {% endif %}  class="btn btn-default btn-sm"><i class="fas fa-pencil-alt fa-fw"></i></a>
        <a title="Print Death Report" role="button" href="{%if result.death_report.href %}?pdf={{result.action_identifier}}&pk={{result.str_pk}}{% else %}#{% endif %}" {%if not result.death_report.href %} disabled {% endif %} class="btn btn-default btn-sm"><i class="fas fa-file-pdf"></i></a>
    </td>
    <td><a class="btn btn-primary btn-sm" href="{%url subject_dashboard_url subject_identifier=result.subject_identifier %}" title={%  translate "Go to subject dashboard" %}><small>{{ result.subject_identifier }} <i class="fas fa-share"></i></small></a> {% copy_string_to_clipboard_button result.subject_identifier %}</td>

    <td>{{ result.reference_model_name }}
        <br><span class="text text-muted small">{{ utc_date|timeuntil:result.report_datetime.date }} ago</span>
    </td>

    <td><a href="{% url ae_listboard_url|default:'ae_listboard_url' %}?q={{result.subject_identifier }}">{{ result.parent_reference_model_name|default:"" }}</a></td>

    <td>{{ result.reference_obj.user_created|default:"---" }}<BR>{{ result.reference_obj.created|date:"SHORT_DATE_FORMAT"|default:"---" }}</td>

    <td>{{ result.reference_obj.user_modified|default:"---" }}<BR>{{ result.reference_obj.modified|date:"SHORT_DATE_FORMAT"|default:"---" }}</td>

{% endblock listboard_table_columns %}
