add rich_text fields to backup and put main in container
This commit is contained in:
parent
b88ac28c9b
commit
be45f3454e
2 changed files with 12 additions and 7 deletions
|
|
@ -17,9 +17,12 @@ module Admin
|
|||
next unless klass
|
||||
|
||||
workbook.add_worksheet(name: table) do |sheet|
|
||||
sheet << klass.attribute_names
|
||||
attributes = klass.attribute_names
|
||||
attributes += klass.rich_text_association_names if klass.respond_to?(:rich_text_association_names)
|
||||
|
||||
sheet << attributes.map { _1.to_s.sub("rich_text_", "") }
|
||||
klass.find_each do |record|
|
||||
sheet << record.attributes.values
|
||||
sheet << attributes.map { _1.starts_with?("rich_text") ? record.send(_1.to_s.sub("rich_text_", "")).body&.to_html : record.send(_1) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -17,12 +17,14 @@
|
|||
<div class="row">
|
||||
<%= render partial: "layouts/sidebar" %>
|
||||
<main class="col ps-md-2 pt-2 <%= "border-start" if sidebar? %>">
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<% if false && sidebar? %>
|
||||
<a href="#" data-bs-target="#sidebar" data-bs-toggle="collapse" class="p-1 text-decoration-none"><i class="bi bi-list bi-lg py-2 p-1"></i> Menu</a>
|
||||
<% end %>
|
||||
<div class="container">
|
||||
<%= render partial: "layouts/flash" %>
|
||||
<% if false && sidebar? %>
|
||||
<a href="#" data-bs-target="#sidebar" data-bs-toggle="collapse" class="p-1 text-decoration-none"><i class="bi bi-list bi-lg py-2 p-1"></i> Menu</a>
|
||||
<% end %>
|
||||
|
||||
<%= yield %>
|
||||
<%= yield %>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue