{% load i18n %}

<div class="tab-pane fade" id="log">
  <div class="table-responsive">
    <table class="table table-striped table-hover table-bordered bg-gradient">
      <thead >
        <tr>
          <th scope="col">{% trans 'Date' %}</th>
          <th scope="col">{% trans 'Event' %}</th>
          <th scope="col">{% trans 'User' %}</th>
        </tr>
      </thead>    
      <tbody>
        {% for log in device_logs %}
        <tr>
          <td width="13%">{{ log.date|date:"M j, Y, H:i" }}</td>
          <td class="fst-italic">{{ log.event }}</td>
          <td>{{ log.user.get_full_name|default:log.user.username }}</td>
        </tr> 
        {% empty %} 
        <tr>
          <td colspan="3" class="text-center">{% trans 'No logs recorded.' %}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
</div>
