<% if file = @model.preview_file %> <% if file.is_image? %> <%= content_tag :div, nil, class: "card-img-top card-img-top-background", style: "background-image: url(#{model_model_file_path(@model, file, format: file.extension)})" %> <%= image_tag model_model_file_path(@model, file, format: file.extension), class: "card-img-top image-preview ", alt: file.name %> <% elsif helpers.renderable?(file.extension) %>
<%= render partial: "object_preview", locals: {model: @model, file: file} %>
<% end %> <% else %>

no preview availiable

<% end %>
<%= @model.name %> <%= helpers.status_badges(@model) %>
<%= link_to t(".open_button.text"), @model, {class: "btn btn-primary btn-sm", "aria-label": translate(".open_button.label", name: @model.name)} if @can_show %> <%= link_to helpers.icon("pencil-fill", t(".edit_button.text")), edit_model_path(@model), {class: "btn btn-outline-secondary btn-sm", "aria-label": translate(".edit_button.label", name: @model.name)} if @can_edit %> <%= link_to helpers.icon("trash", t(".delete_button.text")), model_path(@model), {method: :delete, class: "btn btn-outline-danger btn-sm", "aria-label": translate(".delete_button.label", name: @model.name), data: {confirm: translate("models.destroy.confirm")}} if @can_destroy %>
    <% if @creator.nil? && @model.creator %>
  • <%= helpers.icon "person", Creator.model_name.human %> <%= link_to @model.creator.name, models_path((@filters || {}).merge(creator: @model.creator)), "aria-label": [Creator.model_name.human, @model.creator.name].join(": ") %>
  • <% end %> <% if @model.collection %>
  • <%= helpers.icon "collection", @model.collection.model_name.human %> <%= link_to @model.collection.name, models_path((@filters || {}).merge(collection: @model.collection.id)), "aria-label": [@model.collection.model_name.human, @model.collection.name].join(": ") %>
  • <% end %> <% if @library.nil? && @model.library %>
  • <%= helpers.icon "boxes", Library.model_name.human %> <%= link_to @model.library.name, models_path((@filters || {}).merge(library: @model.library)), "aria-label": [Library.model_name.human, @model.library.name].join(": ") %>
  • <% end %>
<% if @model.caption %>

<%= sanitize @model.caption %>

<% end %>