Sha256: 50bf372f4d4c85400bcf5a4e075cbdb204c702272e5ef329b47e20509c97df48

Contents?: true

Size: 1.31 KB

Versions: 2

Compression:

Stored size: 1.31 KB

Contents

<% namespace ||= nil %>
<% if !resource.is_a?(Column) && (
	can?(:destroy, resource) || can?(:edit, resource) || (
      resource.respond_to?(:state_events) && resource.state_events.select{|event| can? event, resource }.any?
    )
) %>
<div class="dropdown">
  <a class="dropdown-toggle" data-toggle="dropdown" href="#"><%= t('general.actions') %></a>
  <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
  <% if can? :destroy, resource %>    
    <li>
      <% working_resource = namespace.present? ? [namespace, resource] : resource %>
      <%= link_to(
        t('general.destroy'), polymorphic_or_resource_path(working_resource), id: "#{resource.class.name.tableize.singularize}_#{resource.id}", method: :delete, 
        data: { confirm: t('general.questions.are_you_sure') },
        onclick: "delete_link('#{resource.class.name.tableize.singularize}_#{resource.id}'); return false;"
      ) 
      %>
    </li>
  <% end %>
  <% if can? :edit, resource %>    
    <li><%= link_to t('general.edit'), eval("edit_#{(namespace.present? ? namespace.to_s + '_' : '')}#{type.gsub('/', '_').singularize}_path(resource)") %></li>
  <% end %>
  <% if resource.respond_to? :state_events %>
  <li class="divider"></li>
  <% end %>
  <%= render 'shared/resource/event_elements', resource: resource, type: type %>
  </ul>
</div>
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
voluntary-0.2.4 app/views/shared/resource/_actions.html.erb
voluntary-0.2.3 app/views/shared/resource/_actions.html.erb