diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4268d24..9ef764e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -621,4 +621,15 @@ module ApplicationHelper end end + def txt2html(txt) + txt. + gsub( /\n\s*\n/, '

' ). + gsub( /\n/, '
' ). + gsub( /(^|\s)(www\.[^\s])/, '\1http://\2' ). + gsub( /(https?:\/\/([^\s]+))/, + '\2' ) + end + end diff --git a/app/views/catalog/index.rhtml b/app/views/catalog/index.rhtml index 0a795a3..2311a0a 100644 --- a/app/views/catalog/index.rhtml +++ b/app/views/catalog/index.rhtml @@ -1,15 +1,25 @@

<%= _('%s:Products/Services') % @profile.name %>

- - - - - -<% @products.each do |p| %> - - - - +
<%= _('Product/Service') %><%= _('Price') %>
<%= image_tag p.image.public_filename if p.image %> <%= link_to p.name, :action => 'show', :id => p %> <%= p.price || content_tag('em', _('not informed')) %> -
+