StanislavSol/python-project-83

View on GitHub
page_analyzer/templates/urls/url.html

Summary

Maintainability
Test Coverage
{% extends "layout.html" %}
{% block content %}
<main class="flex-grow-1">
    <div class="container-lg mt-3">
        <h1>Сайт: {{ url.name }}</h1>
  <div class="table-responsive">
    <table class="table table-bordered table-hover text-nowrap" data-test="url">
      <tbody>
        <tr>
          <td>ID</td>
          <td>{{ url.id }}</td>
        </tr>
        <tr>
          <td>Имя</td>
          <td>{{ url.name }}</td>
        </tr>
        <tr>
          <td>Дата создания</td>
          <td>{{ url.created_at }}</td>
        </tr>
      </tbody>
    </table>
  </div>

    <h2 class="mt-5 mb-3">Проверки</h2>
    <form method="post" action="/urls/{{ url.id }}/checks">
    <input type="submit" class="btn btn-primary" value="Запустить проверку">
    </form>
    
  <div>
    <table class="table table-bordered table-hover mt-2" data-test="checks">
    <thead>
      <tr>
        <th>ID</th>
        <th>Код ответа</th>
        <th>h1</th>
        <th>title</th>
        <th>description</th>
        <th>Дата создания</th>
      </tr>
    </thead>
      <tbody>
          {% for check in checks %}
          <tr>
              <td>{{ check.id }}</td>
              <td>{{ check.status_code }}</td>
              {% if check.h1 %}
              <td>{{ check.h1 }}</td>
              {% else %}
              <td></td>
              {% endif %}
              {% if check.title %}
              <td>{{ check.title }}</td>
              {% else %}
              <td></td>
              {% endif %}
              {% if check.description %}
              <td>{{ check.description }}</td>
              {% else %}
              <td></td>
              {% endif %}
              <td>{{ check.created_at }}</td>
          </tr>
          {% endfor %}
        
    </tbody>
    </table>
  </div>

    </div>
  </main>

{% endblock %}