Added work with snapshots. Part 2

This commit is contained in:
Alexey Berezhok
2025-12-25 15:10:24 +03:00
parent 5dd481a81c
commit 40f8a546f5
5 changed files with 108 additions and 3 deletions

View File

@@ -11,9 +11,11 @@
<tbody>
<% @snap_list.each do |item| %>
<tr>
<td><a href="/prjsnap_info/<%= ERB::Util.url_encode(@proj_id) %>?snap=<%= ERB::Util.url_encode(item) %>"><%= item %></a></td>
<td><a href="/prjshot/<%= ERB::Util.url_encode(@proj_id) %>?snap=<%= ERB::Util.url_encode(item) %>"><%= item %></a></td>
<td><a href="/prjsnap_delete/<%= ERB::Util.url_encode(@proj_id) %>?snap=<%= ERB::Util.url_encode(item) %>" class="icon-link"><i
class="bi bi-trash3"></i></a></td>
<td><a href="/prjsnap_restore/<%= ERB::Util.url_encode(@proj_id) %>?snap=<%= ERB::Util.url_encode(item) %>" class="icon-link"><i
class="bi bi-capslock"></i></a></td>
</tr>
<% end %>
</tbody>

View File

@@ -10,7 +10,7 @@
</div>
<div class="mb-3 text-center">
<button type="submit" class="btn btn-primary" name="cancel" value="cancel">Отменить</button>
<button type="submit" class="btn btn-danger" name="create" value="create">Создать</button>
<button type="submit" class="btn btn-success" name="create" value="create">Создать</button>
</div>
</form>
</div>

18
views/prjsnap_restore.erb Normal file
View File

@@ -0,0 +1,18 @@
<%= erb :header %>
<div class="container">
<h2 class="text-center">Удаление сатрых версий пакетов проекта <%= @proj_name %></h2>
<form action="/prjsnap_restore/<%= ERB::Util.url_encode(@proj_id) %>?snap=<%= ERB::Util.url_encode(@snap_name) %>" method="post">
<div class="form-check form-switch text-center pb-3">
<input class="form-check-input" type="checkbox" role="switch" id="yes" name="yes">
<label class="form-check-label" for="yes">
Вы уверены, что хотите восстановить пакеты из снимка <%= @snap_name %>?<br />
Все пакеты в текущем репозитории будут перезаписаны, действие не подлежит отмене.
</label>
</div>
<div class="mb-3 text-center">
<button type="submit" class="btn btn-primary" name="cancel" value="cancel">Отменить</button>
<button type="submit" class="btn btn-danger" name="restore" value="restore">Восстановить</button>
</div>
</form>
</div>
<%= erb :footer %>