<%=
if transition.is_a?(String)
transition = this.lifecycle.find_transition(transition, current_user)
end
transition_name = transition.name
has_params = !transition.options[:params].blank?
ajax_attributes, html_attributes = attributes.partition_hash(Hobo::RapidHelper::AJAX_ATTRS)
html_attributes[:method] ||= has_params ? :get : :put
add_classes!(html_attributes, "transition-button #{transition_name}-button")
label = ht("#{this.class.name.tableize}.actions.#{transition_name}", :default => (label || transition_name.to_s.titleize))
url = object_url(this, transition_name, :method => html_attributes[:method])
if (update || !ajax_attributes.empty?) && !has_params
ajax_attributes[:message] ||= label
ajax_attributes[:method] = html_attributes[:method]
func = ajax_updater(url, update, ajax_attributes)
html_attributes.update(:onclick => "var e = this; " + func, :type =>'button', :value => label)
element(:input, html_attributes, nil, true, true)
else
button_to(label, url, html_attributes)
end
%>
<% this.lifecycle.publishable_transitions_for(current_user).each do |t| %>
<% end %>