dashboard-list.html 3.92 KB
{% extends 'base.html' %}

{% block styles %}
<style>
    .table {
        border-collapse: collapse;
        width: 100%;
    }

    .table th, .table td {
        text-align: left;
        padding: 8px;
        border-bottom: 1px solid #ddd;
    }

    .table tr:hover {
        background-color: #f5f5f5;
    }

    .search-form {
        margin-bottom: 20px;
    }

    .search-form .input-group {
        width: 300px;
    }
</style>
{% endblock %}
<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/style.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-kenU1KFdBIe4zVF0s0G1M5b4hcpxyD9F7jL+jjXkk+Q2h455rYXK/7HAuoJl+0I4" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>


</head>
<body>

    <div class="content">
{% block content %}

<h2>{{ gettext('t_installed_components') }}</h2>

<table class="table">
    <thead>
        <tr>
            <th>{{gettext('t_name')}}</th>
            <th>{{gettext('t_description')}}</th>
            <th>{{gettext('t_version')}}</th>
            <th>{{gettext('t_dependencies')}}</th>
            <th>{{gettext('t_git_link')}}</th>
            <th>{{gettext('t_install_at')}}</th>
            <th>{{gettext('t_status')}}</th>
            <th>{{gettext('t_action')}}</th>
        </tr>
    </thead>

    <tbody>
    <tr>
        <td>k2root</td>
        <td>main component</td>
        <td colspan="6">2.5.1.27</td></tr>

        {% for component in components %}
        <tr>
            <td>{{ component.name }}</td>
            <td>{{ component.description }}</td>
            <td>{{ component.version }}</td>
            <td>{{ component.dependencies }}</td>
            <td>{{ component.git_link }}</td>
            <td>{{ component.date_installed }}</td>
            <td>
                {% if component.installed %}
                Yes
                {% else %}
                No
                {% endif %}
            </td>
            <td>
                {% if component.installed %}
                <a href="/remove_dependencies/{{ component.id }}" class="btn btn-primary">Вимкнути</a>
                {% else %}
                <a href="/add_dependencies/{{ component.id }}" class="btn btn-primary">Увімкнути</a>
                <!-- Button trigger modal -->
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#components-{{ component.id }}">
 Видалити
</button>

<!-- Modal -->
<div class="modal fade" id="components-{{ component.id }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h1 class="modal-title fs-5" id="exampleModalLabel">Modal title</h1>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
        Видалити компоненту?
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <a href="/remove-component/{{ component.id }}" class="btn btn-danger">Видалити</a>
      </div>
    </div>
  </div>
</div>
                {% endif %}
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>




{% endblock %}


    </div>

</body>
</html>