Skip to content

Commit

Permalink
Display proper transition names when using transition-button tag from…
Browse files Browse the repository at this point in the history
… the rapid taglib. Also adds feature for the transition-button to look up activerecord.attribute_help.<model>.lifecycle.transitions.<transition> to display as a tooltip (html-attribute title) for the html-button generated.
  • Loading branch information
Spiralis authored and bryanlarsen committed Jul 8, 2011
1 parent 900179e commit 265a968
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hobo/lib/hobo/rapid/taglibs/rapid_lifecycles.dryml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Transitions with parameters are implemented using a form. HTML does not allow f

html_attributes[:method] ||= has_params ? :get : :put
add_classes!(html_attributes, "transition-button #{transition_name}-button")
label = ht("#{this.class.to_s.underscore}.actions.#{transition_name}", :default => (label || transition_name.to_s.titleize))
label = t("activerecord.attributes.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}", :default => (label || transition_name.to_s.titleize))
title = t("activerecord.attribute_help.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}")
html_attributes.update(:title => title) unless title.empty?
url = object_url(this, transition_name, :method => html_attributes[:method])

if (update || !ajax_attributes.empty?) && !has_params
Expand Down

0 comments on commit 265a968

Please sign in to comment.