% user_can_modify_images = ::Refinery::Plugins.active.names.include?("refinery_images") %>
<% if any_images or user_can_modify_images %>
<%= render :partial => "existing_image" if any_images or searching? %>
<% if user_can_modify_images %>
>
<%= render :partial => "form", :locals => {:insert => true} %>
<% end %>
<% else %>
<% flash.now[:error] = t('no_images_yet', :scope => 'admin.images.records').split('.').first.html_safe + "." %>
<%= render :partial => "/shared/admin/form_actions",
:locals => {
:f => nil,
:cancel_url => '',
:hide_cancel => false,
:hide_delete => true,
:hide_submit => true,
:cancel_button_text => t('close', :scope => 'shared.admin.form_actions'),
:cancel_title => nil
} %>
<% end %>
<% content_for :javascripts do %>
<% end %>