Skip to content
Snippets Groups Projects
Commit a738379f authored by Arnaud Levy's avatar Arnaud Levy
Browse files

dependencies

parent a3c90084
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ class Communication::Website::Page < ApplicationRecord
dependencies += website.education_programs if kind_education_programs?
dependencies += [parent] if has_parent?
dependencies += [website.config_permalinks] if is_special_page?
dependencies
dependencies.flatten
end
def git_destroy_dependencies(website)
......
<%
expanded ||= false
%>
<% if current_user.server_admin? %>
<div class="card flex-fill w-100">
<div class="card-header">
<div class="card-actions float-end">
<button class="accordion-button bg-transparent <%= 'collapsed' unless expanded %> mt-n1"
type="button"
data-bs-toggle="collapse"
data-bs-target="#dependencies"
aria-expanded="<%= expanded %>"
aria-controls="dependencies">
</button>
</div>
<h2 class="card-title mb-0 h5">Dependencies</h2>
</div>
<div class="card-body collapse <%= 'show' if expanded %>" id="dependencies">
<h2 class="h5">git_dependencies</h2>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Class</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<% git_dependencies.each do |dependency| %>
<tr>
<td><%= dependency.id %></td>
<td><%= dependency.class %></td>
<td><%= dependency.to_s %></td>
</tr>
<% end %>
</tbody>
</table>
<h2 class="h5 mt-5">active_storage_blobs</h2>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Filename</th>
</tr>
</thead>
<tbody>
<% active_storage_blobs.each do |blob| %>
<tr>
<td><%= blob.id %></td>
<td><%= blob.filename %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<% end %>
\ No newline at end of file
<% content_for :title, @block %>
<h2>git_dependencies</h2>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Class</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<% @block.template.git_dependencies.each do |dependency| %>
<tr>
<td><%= dependency.id %></td>
<td><%= dependency.class %></td>
<td><%= dependency.to_s %></td>
</tr>
<% end %>
</tbody>
</table>
<h2>active_storage_blobs</h2>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Filename</th>
</tr>
</thead>
<tbody>
<% @block.template.active_storage_blobs.each do |blob| %>
<tr>
<td><%= blob.id %></td>
<td><%= blob.filename %></td>
</tr>
<% end %>
</tbody>
</table>
<%= render 'admin/application/dependencies',
git_dependencies: @block.template.git_dependencies,
active_storage_blobs: @block.template.active_storage_blobs,
expanded: true %>
<% content_for :action_bar_right do %>
<%= edit_link @block %>
......
......@@ -28,6 +28,9 @@
</div>
</div>
<%= render 'admin/communication/blocks/list', about: @page %>
<%= render 'admin/application/dependencies',
git_dependencies: @page.git_dependencies(@page.website),
active_storage_blobs: @page.active_storage_blobs %>
</div>
<div class="col-md-4">
<%= render 'admin/application/a11y/widget', about: @page %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment