dashboard-list.html
2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{% 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 %}
<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_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.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">{{gettext('t_turn_of_component')}}</a>
{% else %}
<a href="/add_dependencies/{{ component.id }}" class="btn btn-primary">{{gettext('t_turn_on_component')}}</a>
<!-- Button trigger modal -->
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#components-{{ component.id }}">
{{gettext('t_delete_popup')}}
</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">Title</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{{gettext('t_components_delete')}}?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{gettext('t_close_popup')}}</button>
<a href="/remove-component/{{ component.id }}" class="btn btn-danger">{{gettext('t_delete_popup')}}</a>
</div>
</div>
</div>
</div>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
</div>