<%
creating = defined?(creating) && creating
editing = defined?(editing) && editing
%>
<%
raw_model = content.is_a?(ContentSerializer) ? content.raw_model : content
%>
-
Actions
-
<%= link_to '#/', class: "expand" do %>
format_line_spacing
Expand all categories
<% end %>
<% if editing %>
-
<%= link_to raw_model do %>
<%= raw_model.class.icon %>
View this <%= content.class_name.downcase %>
<% end %>
<% end %>
<% if raw_model.persisted? %>
-
<%= link_to '#/', class: 'share' do %>
share
Share this <%= content.class_name.downcase %>
<% end %>
<% end %>
<% if user_signed_in? && current_user.id == content.user.id %>
-
<%= link_to attribute_customization_path(content_type: raw_model.class.name.downcase) do %>
tune
Configure <%= raw_model.class.name.downcase %> fields
<% end %>
<% end %>
<% if raw_model.persisted? %>
-
<%= link_to send("changelog_#{raw_model.class.name.downcase}_path", raw_model) do %>
history
View changelog
<% end %>
-
<%=
link_to send("toggle_archive_#{raw_model.class.name.downcase}_path", raw_model),
data: {
confirm: raw_model.archived? ? "This will un-archive this page." : "Are you sure you want to archive this #{raw_model.class.name.downcase}?",
} do
%>
<%= 'un' if raw_model.archived? %>archive
<%= raw_model.archived? ? 'Un-archive' : 'Archive' %> this page
<% end %>
<% if editing %>
-
<%=
link_to raw_model,
method: :delete,
data: {
confirm: "Are you sure? This will delete this entire #{raw_model.class.name.downcase}!",
} do %>
delete
Delete this page
<% end %>
<% end %>
<% end %>