Andrey-Volkovitskiy/python-project-83

View on GitHub
page_analyzer/templates/show_url.html

Summary

Maintainability
Test Coverage
{% extends 'base.html' %}

{% block content %}
  <h1>{{ txt.WEBSITE }}: {{ 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>{{ txt.NAME }}</td>
          <td>{{ url.name }}</td>
        </tr>
        <tr>
          <td>{{ txt.CREATION_DATE }}</td>
          <td>{{ url.created_at.date() }}</td>
        </tr>
      </tbody>
    </table>
  </div>

  <h2 class="mt-5 mb-3">{{ txt.CHECKS }}</h2>
  <form method="post" action="{{ url_for('check', url_id=url.id) }}">
    <input type="submit" class="btn btn-primary" value="{{ txt.RUN_CHECK }}">
  </form>
  <div>
    <table class="table table-bordered table-hover mt-2" data-test="checks">
      <tbody>
        <tr>
          <th>ID</th>
          <th>{{ txt.STATUS_CODE_LC }}</th>
          <th>h1</th>
          <th>title</th>
          <th>description</th>
          <th>{{ txt.CREATION_DATE_LC }}</th>
        </tr>
        
        {% for check in checks %}
          <tr>
            <td>{{ check.id }}</td>
            <td>{% if check.status_code %}{{ check.status_code }}{% endif %}</td>
            <td>{% if check.h1 %}{{ check.h1 }}{% endif %}</td>
            <td>{% if check.title %}{{ check.title }}{% endif %}</td>
            <td>{% if check.description %}{{ check.description }}{% endif %}</td>
            <td>{{ check.created_at.date() }}</td>
          </tr>
        {% endfor %}
      </tbody>
    </table>
  </div>
{% endblock %}