AlchemyCMS/alchemy_cms

View on GitHub
app/views/alchemy/admin/elements/_header.html.erb

Summary

Maintainability
Test Coverage
<div class="element-header<%= ' has-hint' if element.has_hint? %>">
  <span class="element-handle">
    <% if element.definition.blank? %>
      <%= hint_with_tooltip Alchemy.t(:element_definition_missing) %>
    <% elsif element.deprecated? %>
      <%= hint_with_tooltip element.deprecation_notice %>
    <% else %>
      <%= render_icon('draggable', style: false, class: 'element', fixed_width: false) %>
    <% end %>
  </span>
  <span class="element-title">
    <span class="preview_text_element_name"><%= element.display_name %></span>
    <span class="preview_text_quote">
      <%= sanitize(element.preview_text.presence || '&nbsp;') %>
    </span>
  </span>
  <span class="element-hidden-icon">
    <%= render_icon("cloud-off", size: "1x") %>
    <span class="element-hidden-label">
      <%= Alchemy.t(:element_hidden) %>
    </span>
  </span>
  <%= button_tag({
    title: Alchemy.t(element.folded? ? :show_element_content : :hide_element_content),
    class: "element-toggle"
  }) do %>
    <% if element.compact? %>
      <%= render_icon "more-2" %>
    <% else %>
      <%= render_icon element.folded? ? "arrow-left-s" : "arrow-down-s" %>
    <% end %>
  <% end %>
</div>