add html titles to these pages
[kwestie.git] / app / helpers / application_helper.rb
blob0d75ecce9999782739ba87865c8ab305b8d5a38a
1 # Methods added to this helper will be available to all templates in the application.
2 module ApplicationHelper
3   def form_label(obj, meth, str)
4     '<label for="%s_%s">%s</label>' % [ obj, meth, str ]
5   end
7   def focus(field_name)
8     %{
9     <script type="text/javascript">
10     // <![CDATA[
11           Field.activate('#{field_name}');
12     // ]]>
13     </script>
14     }
15   end
17   def hCard(user)
18     %{
19     <span class="vcard">
20       #{link_to user.display_name, user_url(user), :class => "author url fn nickname"}
21     </span>
22     }
23   end
25   def nice_permalink_url(issue)
26     nice_permalink_route_url( :year => issue.year, :month => issue.month, :day => issue.day, :permalink => issue.permalink.link_name )
27   end
29   def nice_permalink_path(issue)
30     nice_permalink_route_path( :year => issue.year, :month => issue.month, :day => issue.day, :permalink => issue.permalink.link_name )
31   end
32 end