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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
{# Tracked tables exists#}
{% if head_version_exists %}
<div id="tracked_tables">
<h3>{% trans 'Tracked tables' %}</h3>
<form method="post" action="{{ url('/database/tracking') }}" name="trackedForm"
id="trackedForm" class="ajax">
{{ get_hidden_inputs(db) }}
<table id="versions" class="table table-striped table-hover w-auto">
<thead>
<tr>
<th></th>
<th>{% trans 'Table' %}</th>
<th>{% trans 'Last version' %}</th>
<th>{% trans 'Created' %}</th>
<th>{% trans 'Updated' %}</th>
<th>{% trans 'Status' %}</th>
<th>{% trans 'Action' %}</th>
<th>{% trans 'Show' %}</th>
</tr>
</thead>
<tbody>
{% for version in versions %}
<tr>
<td class="text-center">
<input type="checkbox" name="selected_tbl[]"
class="checkall" id="selected_tbl_{{ version.table_name }}"
value="{{ version.table_name }}">
</td>
<th>
<label for="selected_tbl_{{ version.table_name }}">
{{ version.table_name }}
</label>
</th>
<td class="text-end">
{{ version.version }}
</td>
<td>
{{ version.date_created }}
</td>
<td>
{{ version.date_updated }}
</td>
<td>
<div class="wrapper toggleAjax hide">
<div class="toggleButton">
<div title="{% trans 'Click to toggle' %}" class="toggle-container {{ version.tracking_active == 1 ? 'on' : 'off' }}">
<img src="{{ image('toggle-' ~ text_dir ~ '.png') }}">
<table>
<tbody>
<tr>
<td class="toggleOn">
<span class="hide">
{{- url('/table/tracking', {
'db': version.db_name,
'table': version.table_name,
'version': version.version,
'toggle_activation': 'activate_now',
}) -}}
</span>
<div>{% trans 'active' %}</div>
</td>
<td><div> </div></td>
<td class="toggleOff">
<span class="hide">
{{- url('/table/tracking', {
'db': version.db_name,
'table': version.table_name,
'version': version.version,
'toggle_activation': 'deactivate_now',
}) -}}
</span>
<div>{% trans 'not active' %}</div>
</td>
</tr>
</tbody>
</table>
<span class="hide callback"></span>
<span class="hide text_direction">{{ text_dir }}</span>
</div>
</div>
</div>
</td>
<td>
<a class="delete_tracking_anchor ajax" href="{{ url('/database/tracking') }}" data-post="
{{- get_common({
'db': db,
'goto': url('/table/tracking'),
'back': url('/database/tracking'),
'table': version.table_name,
'delete_tracking': true
}, '', false) }}">
{{ get_icon('b_drop', 'Delete tracking'|trans) }}
</a>
</td>
<td>
<a href="{{ url('/table/tracking') }}" data-post="
{{- get_common({
'db': db,
'goto': url('/table/tracking'),
'back': url('/database/tracking'),
'table': version.table_name
}, '', false) }}">
{{ get_icon('b_versions', 'Versions'|trans) }}
</a>
<a href="{{ url('/table/tracking') }}" data-post="
{{- get_common({
'db': db,
'goto': url('/table/tracking'),
'back': url('/database/tracking'),
'table': version.table_name,
'report': true,
'version': version.version
}, '', false) }}">
{{ get_icon('b_report', 'Tracking report'|trans) }}
</a>
<a href="{{ url('/table/tracking') }}" data-post="
{{- get_common({
'db': db,
'goto': url('/table/tracking'),
'back': url('/database/tracking'),
'table': version.table_name,
'snapshot': true,
'version': version.version
}, '', false) }}">
{{ get_icon('b_props', 'Structure snapshot'|trans) }}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include 'select_all.twig' with {
'text_dir': text_dir,
'form_name': 'trackedForm'
} only %}
<button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="delete_tracking"
title="{% trans 'Delete tracking' %}">
{{ get_icon('b_drop', 'Delete tracking'|trans) }}
</button>
</form>
</div>
{% endif %}
{% if untracked_tables_exists %}
<h3>{% trans 'Untracked tables' %}</h3>
<form method="post" action="{{ url('/database/tracking') }}" name="untrackedForm"
id="untrackedForm" class="ajax">
{{ get_hidden_inputs(db) }}
<table id="noversions" class="table table-striped table-hover w-auto">
<thead>
<tr>
<th></th>
<th>{% trans 'Table' %}</th>
<th>{% trans 'Action' %}</th>
</tr>
</thead>
<tbody>
{% for table_name in untracked_tables %}
{% if get_tracker_version(db, table_name) == -1 %}
<tr>
<td class="text-center">
<input type="checkbox" name="selected_tbl[]"
class="checkall" id="selected_tbl_{{ table_name }}"
value="{{ table_name }}">
</td>
<th>
<label for="selected_tbl_{{ table_name }}">
{{ table_name }}
</label>
</th>
<td>
<a href="{{ url('/table/tracking', url_params|merge({
'db': db,
'table': table_name
})) }}">
{{ get_icon('eye', 'Track table'|trans) }}
</a>
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
{% include 'select_all.twig' with {
'text_dir': text_dir,
'form_name': 'untrackedForm'
} only %}
<button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="track" title="{% trans 'Track table' %}">
{{ get_icon('eye', 'Track table'|trans) }}
</button>
</form>
{% endif %}
|