{% extends "base_list.html" %}
{% load form_tags %}
{% load mathfilters %}
{% load static %}

{% block title %}{{object.name}}{% endblock %}

{% block lists %}

<div class="row">

<h1>{{ object.media_obj }} - {{object.media_type}}</h1>

<!-- Your existing detail page content -->
{% if object.logdata.avg_seconds_per_page %}
<p>Rate: {{object.logdata.avg_seconds_per_page}}s per page</p>
{% endif %}

<h2>Edit Log</h2>
<form method="post" class="needs-validation" novalidate>
  {% csrf_token %}
  {% for field in log_form %}
    <div class="mb-3">
      <label for="{{ field.id_for_label }}" class="form-label">{{ field.label }}</label>
      {{ field|add_class:"form-control" }}
      {% if field.help_text %}
        <div class="form-text">{{ field.help_text }}</div>
      {% endif %}
      {% for error in field.errors %}
        <div class="invalid-feedback d-block">{{ error }}</div>
      {% endfor %}
    </div>
  {% endfor %}

  <button type="submit" class="btn btn-primary">Save</button>
</form>

</div>

{% endblock %}
